diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-11-15 16:20:28 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-11-24 17:44:57 +0100 |
commit | 88531199d2f46f8758dd1ef3262e567cc849c0b8 (patch) | |
tree | 610ecc205121ddd7421755e07be878901830ed73 /conf/generate-unit-conf/Makefile | |
parent | 597a0e00c4fcb1af745804be6249f08203084f62 (diff) |
Generate afm-unit.conf using m4
The use of m4 to generate the afm-unit.conf and
afm-unit-debug.conf files has benefits:
- the sync between debug versus not debug is mechanical
- it allows easier maintainance by improving readability
and writability (ex: macros TARGET or UNIT_NAME_BASE)
Change-Id: Ic0427bedf4f8a5b174318562336603077f174fa5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'conf/generate-unit-conf/Makefile')
-rw-r--r-- | conf/generate-unit-conf/Makefile | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/conf/generate-unit-conf/Makefile b/conf/generate-unit-conf/Makefile new file mode 100644 index 0000000..5f5346b --- /dev/null +++ b/conf/generate-unit-conf/Makefile @@ -0,0 +1,25 @@ +.PHONY: all + +MAIN = afm-unit + +FILES = $(MAIN) binder.inc provided.inc service.inc Makefile + +DIR = .. + +#AFM_CONFIG_DIR ?= /etc/afm +AFM_CONFIG_DIR ?= "@afm_confdir@" + +C = -DAFM_CONFIG_DIR=$(AFM_CONFIG_DIR) + +D = -DAGL_DEVEL + +all: $(DIR)/afm-unit.conf.in $(DIR)/afm-unit-debug.conf.in + +$(DIR)/afm-unit.conf.in: $(FILES) + @echo generating $@ + @m4 $C $< | sed '/^[ \t]*\\*[ \t]*$$/d' > $@ + +$(DIR)/afm-unit-debug.conf.in: $(FILES) + @echo generating $@ + @m4 $C $D $< | sed '/^[ \t]*\\*[ \t]*$$/d' > $@ + |