We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7086ed0 commit 7a78e72Copy full SHA for 7a78e72
src/Makefile
@@ -10,7 +10,22 @@ THIS_MAKEFILE:=$(lastword $(MAKEFILE_LIST))
10
11
CONFIGFILE ?=../config.mk
12
$(info Using config file ${CONFIGFILE})
13
-include ${CONFIGFILE}
+
14
+CONFIGFILEPATH:=$(shell ls ${CONFIGFILE} >/dev/null 2>/dev/null && realpath ${CONFIGFILE})
15
+ifeq ($(CONFIGFILEPATH),)
16
+ ifeq ($(shell dirname ${CONFIGFILE}),.)
17
+ CONFIGFILEPATH:=$(shell ls ../${CONFIGFILE} >/dev/null 2>/dev/null && realpath ../${CONFIGFILE})
18
+ ifneq ($(CONFIGFILEPATH),)
19
+ $(info Config file ${CONFIGFILE} not found; using ../${CONFIGFILE})
20
+ endif
21
22
+endif
23
24
25
+ $(error Config file ${CONFIGFILE} not found)
26
+else
27
+ include ${CONFIGFILEPATH}
28
29
30
CC ?= cc
31
AWK ?= awk
0 commit comments