[build] Allow optional config-user.mk file for per-user build config.
authorMatthias Bolte <matthias.bolte@googlemail.com>
Thu, 16 Apr 2009 14:14:15 +0000 (16:14 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Thu, 16 Apr 2009 14:15:43 +0000 (16:15 +0200)
Signed-off-by: Matthias Bolte <matthias.bolte@googlemail.com>

.gitignore
Makefile
config.mk

index d0bc775..6fd7f45 100644 (file)
@@ -1,3 +1,4 @@
 *.a
 *.o
 *.so
+config-user.mk
index 3aa349c..18cd569 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
 # Copyright (C) 2009 Matthias Bolte <matthias.bolte@googlemail.com>
 #
 
-SUBDIRS = cli misc include
+PWD = $(shell pwd)
 
 #
 # Rules
@@ -20,13 +20,13 @@ clean: cli-clean misc-clean
 install: cli-install misc-install include-install
 
 %-all:
-       @echo $@ | sed 's,\([a-z]*\)-all,echo "building \1"; $(MAKE) -C \1 all;,g' | sh
+       @echo $@ | sed 's,\([a-z]*\)-all,echo "building \1"; $(MAKE) -I $(PWD) -C \1 all;,g' | sh
 
 %-clean:
-       @echo $@ | sed 's,\([a-z]*\)-clean,echo "cleaning \1"; $(MAKE) -C \1 clean;,g' | sh
+       @echo $@ | sed 's,\([a-z]*\)-clean,echo "cleaning \1"; $(MAKE) -I $(PWD) -C \1 clean;,g' | sh
 
 %-install:
-       @echo $@ | sed 's,\([a-z]*\)-install,echo "installing \1"; $(MAKE) -C \1 install;,g' | sh
+       @echo $@ | sed 's,\([a-z]*\)-install,echo "installing \1"; $(MAKE) -I $(PWD) -C \1 install;,g' | sh
 
 new:
        $(MAKE) clean && $(MAKE)
index a494fab..e5f1129 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -21,3 +21,9 @@ CFLAGS  += -std=gnu99 -Wall -Werror -W -Wextra -Wmissing-declarations \
 
 # Debugging
 CFLAGS  += -O0 -g -ggdb
+
+#
+# Include optional user config
+#
+
+-include config-user.mk