[SR-Dev] git:ser_core_cvs: make: workaround for backwards compat. with make 3.80

Andrei Pelinescu-Onciul andrei at iptel.org
Fri Apr 3 16:05:09 CEST 2009


Module: sip-router
Branch: ser_core_cvs
Commit: 724ca0875cdc778cbc23154a998a03c3d4431c99
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=724ca0875cdc778cbc23154a998a03c3d4431c99

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Thu Apr  2 18:42:58 2009 +0000

make: workaround for backwards compat. with make 3.80

- workaround for export not supported in gnu make 3.80 target
  specific variables: use $(mk_params) for each $(MAKE) invocation

---

 INSTALL  |    2 +-
 Makefile |   28 ++++++++++++++++++----------
 2 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/INSTALL b/INSTALL
index cc2da92..0da2303 100644
--- a/INSTALL
+++ b/INSTALL
@@ -53,7 +53,7 @@ Requirements:
 - bison or yacc (Berkley yacc)
 - flex
 - GNU make (on Linux this is the standard "make", on *BSD and Solaris is
- called "gmake") version >= 3.79.
+ called "gmake") version >= 3.80.
 - sed and tr (used in the makefiles)
 - GNU tar ("gtar" on Solaris) and gzip if you want "make tar" to work
 - GNU install, BSD install or Solaris install if you want "make
diff --git a/Makefile b/Makefile
index 1a12f9a..4c75fe0 100644
--- a/Makefile
+++ b/Makefile
@@ -56,6 +56,9 @@
 #              added cfg-defs, new target that only rebuilds config.mak
 #  2009-03-10  replaced DEFS with C_DEFS (DEFS are now used only for
 #              "temporary" defines inside modules or libs) (andrei)
+#  2009-04-02  workaround for export not supported in gnu make 3.80
+#               target specific variables: use mk_params for each
+#               $(MAKE) invocation (andrei)
 #
 
 auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
@@ -381,7 +384,8 @@ modules: modules.lst
 		if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
 			echo  "" ; \
 			echo  "" ; \
-			if  $(MAKE) -C $$r || [ ${err_fail} != 1 ] ; then \
+			if  $(MAKE) -C $$r $(mk_params) || [ ${err_fail} != 1 ] ; \
+			then\
 				:; \
 			else \
 				exit 1; \
@@ -395,7 +399,7 @@ $(extra_objs):
 		if [ -n "$$r" -a -r "$$r/Makefile"  ]; then \
 			echo  "" ; \
 			echo  "Making static module $r" ; \
-			if $(MAKE) -C $$r static ; then  \
+			if $(MAKE) -C $$r static $(mk_params) ; then  \
 				:; \
 			else \
 				exit 1; \
@@ -409,7 +413,8 @@ utils:
 		if [ -n "$$r" ]; then \
 			echo  "" ; \
 			echo  "" ; \
-			if  $(MAKE) -C $$r || [ ${err_fail} != 1 ] ; then \
+			if  $(MAKE) -C $$r $(mk_params) || [ ${err_fail} != 1 ] ; \
+			then \
 				:; \
 			else \
 				exit 1; \
@@ -466,7 +471,7 @@ tar:
 .PHONY: bin
 bin:
 	mkdir -p tmp/ser/usr/local
-	$(MAKE) install basedir=tmp/ser 
+	$(MAKE) install basedir=tmp/ser $(mk_params)
 	$(TAR) -C tmp/ser/ -zcf ../$(NAME)-$(RELEASE)_$(OS)_$(ARCH).tar.gz .
 	rm -rf tmp/ser
 
@@ -484,7 +489,7 @@ deb:
 sunpkg:
 	mkdir -p tmp/ser
 	mkdir -p tmp/ser_sun_pkg
-	$(MAKE) install basedir=tmp/ser prefix=/usr/local
+	$(MAKE) install basedir=tmp/ser prefix=/usr/local $(mk_params)
 	(cd pkg/solaris; \
 	pkgmk -r ../../tmp/ser/usr/local -o -d ../../tmp/ser_sun_pkg/ -v "$(RELEASE)" ;\
 	cd ../..)
@@ -501,7 +506,7 @@ modules-doc: modules.lst
 		if [ -n "$$r" ]; then \
 			echo  "" ; \
 			echo  "" ; \
-			$(MAKE) -C $$r/doc $(doc_format) ; \
+			$(MAKE) -C $$r/doc $(doc_format)  $(mk_params); \
 		fi ; \
 	done 
 
@@ -514,7 +519,8 @@ README: modules.lst
 		if [ -n "$$r" ]; then \
 			echo  "" ; \
 			echo  "" ; \
-			if  $(MAKE) -C $$r README || [ ${err_fail} != 1 ] ; then \
+			if  $(MAKE) -C $$r README $(mk_params) || \
+				[ ${err_fail} != 1 ] ; then \
 				:; \
 			else \
 				exit 1; \
@@ -531,7 +537,8 @@ man: modules.lst
 		if [ -n "$$r" ]; then \
 			echo  "" ; \
 			echo  "" ; \
-			if  $(MAKE) -C $$r man || [ ${err_fail} != 1 ] ; then \
+			if  $(MAKE) -C $$r man $(mk_params) || [ ${err_fail} != 1 ] ; \
+			then \
 				:; \
 			else \
 				exit 1; \
@@ -540,7 +547,7 @@ man: modules.lst
 	done; true
 
 .PHONY: install
-install: export compile_for_install=yes
+install: mk_params="compile_for_install=yes"
 install: install-bin install-modules install-cfg \
 	install-doc install-man install-utils install-share
 
@@ -636,7 +643,8 @@ install-modules: modules.lst $(modules_prefix)/$(modules_dir)
 		if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
 			echo  "" ; \
 			echo  "" ; \
-			if  $(MAKE) -C $$r install || [ ${err_fail} != 1 ] ; then \
+			if  $(MAKE) -C $$r install $(mk_params) || \
+				[ ${err_fail} != 1 ] ; then \
 				:; \
 			else \
 				exit 1; \




More information about the sr-dev mailing list