Module: sip-router
Branch: master
Commit: dd15ae96c06c1e39f42894238cff74efff3563fa
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=dd15ae9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Mar 7 11:59:45 2011 +0100
makefile: store the flavour in tarball
- Makefile.vars is auto-generated to store the flavour when creating the
tarball
- Makefile.vars is stored inside the tarball
- do 'make maintainer-clean' or 'make clean-makefile-vars' to remove it
- allow to build the packaged flavour even when 'make FLAVOUR=... cfg'
is forgotten - suggested by Olle E. Johansson
---
Makefile | 11 +++++++++--
Makefile.defs | 2 ++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 3997a38..44db945 100644
--- a/Makefile
+++ b/Makefile
@@ -772,12 +772,16 @@ utils:
dbg: sip-router
gdb -command debug.gdb
+.PHONY: makefile_vars makefile-vars
+makefile_vars makefile-vars:
+ echo "FLAVOUR?=$(FLAVOUR)" > Makefile.vars
+
.PHONY: tar
.PHONY: dist
dist: tar
-tar: $(auto_gen_keep)
+tar: makefile_vars $(auto_gen_keep)
$(TAR) -C .. \
--exclude=$(notdir $(CURDIR))/test* \
--exclude=$(notdir $(CURDIR))/tmp* \
@@ -1143,7 +1147,7 @@ maintainer-clean: modules=$(modules_all)
proper realclean distclean maintainer-clean: clean_cfg
# on maintainer clean, remove also the configured module list
-maintainer-clean: clean_modules_cfg
+maintainer-clean: clean_modules_cfg clean_makefile_vars
.PHONY: proper-all realclean-all distclean-all
proper-all realclean-all distclean-all: cmodules=$(all_modules_lst)
@@ -1158,6 +1162,9 @@ clean_cfg clean-cfg:
clean_modules_cfg clean-modules-cfg:
rm -f modules.lst
+.PHONY: clean_makefile_vars clean-makefile-vars
+ rm -f Makefile.vars
+
.PHONY: dbschema
dbschema:
-@echo "Build database schemas"
diff --git a/Makefile.defs b/Makefile.defs
index 008316c..dfad205 100644
--- a/Makefile.defs
+++ b/Makefile.defs
@@ -117,6 +117,8 @@ ifeq ($(quiet),verbose)
$(info normal Makefile.defs exec)
endif # verbose
+-include Makefile.vars
+
# usage: $(call set_if_empty,VAR,value)
set_if_empty=$(if $($(1)),,$(eval override $(1)=$(2)))