[sr-dev] git:kamailio_3.0: makefile: fix make bin & basedir

Daniel-Constantin Mierla miconda at gmail.com
Tue Dec 15 23:00:11 CET 2009


Module: sip-router
Branch: kamailio_3.0
Commit: 72ce05ee4fab38d7dd16934d93b5c05ed619b432
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=72ce05ee4fab38d7dd16934d93b5c05ed619b432

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Dec 15 00:58:14 2009 +0100

makefile: fix make bin &  basedir

- make bin and make sunpkg fixed (basedir was not an absolute
  path)
- auto-transform basedir to an absolute path if it does not start
  with '/'
- fix unexported makefile_defs, after loading the config in the
  main Makefile
(cherry picked from commit 31442b832dd4fc606833a06fb92d90f62af9f1b0)

---

 Makefile |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 16f3dbb..c274022 100644
--- a/Makefile
+++ b/Makefile
@@ -322,6 +322,7 @@ ifeq ($(makefile_defs),1)
 ifeq ($(quiet),verbose)
 $(info config.mak loaded)
 endif # verbose
+export makefile_defs
 # config_make valid & used
 config_mak=1
 ifeq ($(MAIN_NAME),)
@@ -343,6 +344,7 @@ else
 # config.mak not strictly needed, but try to load it if exists for $(Q)
 config_mak=skip
 -include config.mak
+export makefile_defs
 endif
 endif
 
@@ -491,6 +493,15 @@ ifeq ($(config_mak),1)
 
 include Makefile.cfg
 
+# fix basedir path (relative -> absolute)
+ifneq (,$(basedir))
+ifeq (,$(filter /%, $(basedir)))
+override basedir:=$(CURDIR)/$(basedir)
+# remove basedir from command line overrides
+MAKEOVERRIDES:=$(filter-out basedir=%,$ $(MAKEOVERRIDES))
+endif # (,$(filter /%, $(basedir)))
+endif # (,$(basedir))
+
 else ifneq ($(config_mak),skip)
 
 config.mak: Makefile.defs
@@ -783,7 +794,7 @@ tar: $(auto_gen_keep)
 .PHONY: bin
 bin:
 	mkdir -p tmp/$(MAIN_NAME)/usr/local
-	$(MAKE) install basedir=tmp/$(MAIN_NAME) $(mk_params)
+	$(MAKE) install basedir=$(CURDIR)/tmp/$(MAIN_NAME) $(mk_params)
 	$(TAR) -C tmp/$(MAIN_NAME)/ -zcf ../$(NAME)-$(RELEASE)_$(OS)_$(ARCH).tar.gz .
 	rm -rf tmp/$(MAIN_NAME)
 
@@ -805,7 +816,8 @@ deb:
 sunpkg:
 	mkdir -p tmp/$(MAIN_NAME)
 	mkdir -p tmp/$(MAIN_NAME)_sun_pkg
-	$(MAKE) install basedir=tmp/$(MAIN_NAME) prefix=/usr/local $(mk_params)
+	$(MAKE) install basedir=$(CURDIR)/tmp/$(MAIN_NAME) \
+			prefix=/usr/local $(mk_params)
 	(cd pkg/solaris; \
 	pkgmk -r ../../tmp/$(MAIN_NAME)/usr/local -o -d ../../tmp/$(MAIN_NAME)_sun_pkg/ -v "$(RELEASE)" ;\
 	cd ../..)




More information about the sr-dev mailing list