From 5c5be9c76ef1628329a6689f1e20927e96e631a8 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Wed, 14 Nov 2012 01:40:26 +0400 Subject: Allow using GNU m4 for generating manifests --- rules/common.mk | 1 + rules/ips-manifest.mk | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/rules/common.mk b/rules/common.mk index 7b1d829..0e4ba57 100644 --- a/rules/common.mk +++ b/rules/common.mk @@ -125,6 +125,7 @@ install : install-stamp clean :: rm -f *-stamp rm -rf $(workdir) + [ -z "$(generated-files)" ] || rm -f $(generated-files) __common_mk := included diff --git a/rules/ips-manifest.mk b/rules/ips-manifest.mk index 7eb9fdf..618e217 100644 --- a/rules/ips-manifest.mk +++ b/rules/ips-manifest.mk @@ -74,10 +74,21 @@ manifests := $(wildcard *.p5m) # Manifest generators: manifests-x := $(wildcard *.p5m.x) -manifests += $(manifests-x:%.x=%) +manifests-generated += $(manifests-x:%.x=%) %.p5m: %.p5m.x ./$< > $@ +manifests-m4 := $(wildcard *.p5m.m4) +ifneq (,$(manifests-m4)) +build-depends += gnu-m4 +endif +manifests-generated += $(manifests-m4:%.m4=%) +%.p5m: %.p5m.m4 + gm4 $< > $@ + +manifests += $(manifests-generated) +generated-files += $(manifests-generated) + #TODO: Expand "glob" action in manifests: globalizator := /usr/share/cibs/scripts/globalizator glob-manifests := $(manifests:%=$(manifestdir)/glob-%) -- cgit v1.2.3