]> ocean-lang.org Git - ocean/commitdiff
Makefile: auto-support .mdc files.
authorNeilBrown <neilb@suse.de>
Sat, 22 Jun 2013 09:17:49 +0000 (19:17 +1000)
committerNeilBrown <neilb@suse.de>
Sat, 22 Jun 2013 09:17:49 +0000 (19:17 +1000)
Any *.mdc cause "md2c" to be run to create a "*.mk" file which is
included and used.

Signed-off-by: NeilBrown <neilb@suse.de>
csrc/Makefile

index d1beada54e6b78e1dc3ce6822ea4e520962718d9..86e4c023f9c118ba63ac4a471dccc340e9f7b365 100644 (file)
@@ -1,6 +1,10 @@
 
-ifneq "$(wildcard *.mk)" ""
-include *.mk
+mkfiles = $(wildcard *.mk)
+mdfiles = $(wildcard *.mdc)
+mdkfiles = $(mdfiles:.mdc=.mk)
+missingmk = $(filter-out $(mkfiles),$(mdkfiles))
+ifneq "$(mkfiles)" ""
+include $(mkfiles)
 endif
 
 bootstrap:
@@ -9,3 +13,13 @@ bootstrap:
        cp boot-strap/md2c .
        ./md2c mdcode.mdc
 
+md2c = $(wildcard md2c)
+ifeq "$(md2c)" "md2c"
+ifneq "$(missingmk)" ""
+-include $(missingmk)
+endif
+endif
+
+%.mk : %.mdc md2c
+       ./md2c $*.mdc
+