From f42322773daee9727e6063da7f15aca457c553f9 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sat, 22 Jun 2013 19:17:49 +1000 Subject: [PATCH] Makefile: auto-support .mdc files. Any *.mdc cause "md2c" to be run to create a "*.mk" file which is included and used. Signed-off-by: NeilBrown --- csrc/Makefile | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/csrc/Makefile b/csrc/Makefile index d1beada..86e4c02 100644 --- a/csrc/Makefile +++ b/csrc/Makefile @@ -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 + -- 2.43.0