Browse Source

makefile: FLAVOUR support

Basic support for sip-router, ser and kamailio flavours and
install flavours, e.g.:
make config FLAVOUR=sip-router
make config INSTALL_FLAVOUR=kamailio; make install (will install
only kamailio specific tools, but won't change the main name)
make config FLAVOUR=ser; make install (will install ser tools and
change the name to ser).

Note that FLAVOUR does not influence the module list (one should
use modules_dirs, group_include and/or modules, modules_s,
modules_k) and that for now choosing kamailio will only change the
name.
Andrei Pelinescu-Onciul 16 years ago
parent
commit
caf3128c54
3 changed files with 28 additions and 3 deletions
  1. 7 1
      Makefile
  2. 20 1
      Makefile.defs
  3. 1 1
      Makefile.targets

+ 7 - 1
Makefile

@@ -915,6 +915,8 @@ proper-libs realclean-libs distclean-libs maintainer-clean-libs:
 			$(MAKE) -C lib $(patsubst %-libs,%,$@)
 			$(MAKE) -C lib $(patsubst %-libs,%,$@)
 
 
 
 
+# clean extra binary names (common "flavour" names)
+clean: clean-extra-names
 # clean modules on make clean
 # clean modules on make clean
 clean: clean-modules
 clean: clean-modules
 # clean utils on make clean
 # clean utils on make clean
@@ -922,9 +924,13 @@ clean: clean-utils
 # cleaning in libs always when cleaning sip-router
 # cleaning in libs always when cleaning sip-router
 clean: clean-libs
 clean: clean-libs
 
 
+.PHONY: clean-extra-names
+clean-extra-names:
+	@rm -f $(filter-out $(MAIN_NAME), sip-router ser kamailio)
+
 # proper/distclean a.s.o modules, utils and libs too
 # proper/distclean a.s.o modules, utils and libs too
 
 
-proper: proper-modules proper-utils proper-libs
+proper: clean-extra-names proper-modules proper-utils proper-libs
 distclean: distclean-modules distclean-utils distclean-libs
 distclean: distclean-modules distclean-utils distclean-libs
 realclean: realclean-modules realclean-utils realclean-libs
 realclean: realclean-modules realclean-utils realclean-libs
 maintainer-clean: maintainer-clean-modules maintainer-clean-utils \
 maintainer-clean: maintainer-clean-modules maintainer-clean-utils \

+ 20 - 1
Makefile.defs

@@ -111,14 +111,33 @@ export makefile_defs
 ifeq ($(quiet),verbose)
 ifeq ($(quiet),verbose)
 $(info normal Makefile.defs exec)
 $(info normal Makefile.defs exec)
 endif # verbose
 endif # verbose
+
+# flavour: sip-router, ser or kamailio
+FLAVOUR=sip-router
+
+ifeq ($(FLAVOUR),sip-router)
 # main binary name
 # main binary name
 MAIN_NAME=ser
 MAIN_NAME=ser
+else ifeq ($(FLAVOUR),ser)
+# main binary name
+MAIN_NAME=ser
+else ifeq ($(FLAVOUR),kamailio)
+# main binary name
+MAIN_NAME=kamailio
+else # default:
+# main binary name
+MAIN_NAME=sip-router
+endif
+
 #prefix for various configs and scripts
 #prefix for various configs and scripts
 #config name/name-prefix for distributed configs
 #config name/name-prefix for distributed configs
 CFG_NAME=sip-router
 CFG_NAME=sip-router
 #config name/name-prefix for distributed scripts
 #config name/name-prefix for distributed scripts
 SCR_NAME=sip-router
 SCR_NAME=sip-router
 
 
+# what to install
+INSTALL_FLAVOUR=$(FLAVOUR)
+
 #version number
 #version number
 VERSION = 2
 VERSION = 2
 PATCHLEVEL = 99
 PATCHLEVEL = 99
@@ -1898,7 +1917,7 @@ export exported_vars
 # variable changeable only at configure time (once saved in config.mak they
 # variable changeable only at configure time (once saved in config.mak they
 #  cannot be overwritten from environment or command line, unless make cfg
 #  cannot be overwritten from environment or command line, unless make cfg
 #  is run)
 #  is run)
-saved_fixed_vars:=	MAIN_NAME  CFG_NAME SCR_NAME \
+saved_fixed_vars:=	MAIN_NAME  CFG_NAME SCR_NAME FLAVOUR INSTALL_FLAVOUR \
 		RELEASE OS ARCH \
 		RELEASE OS ARCH \
 		C_DEFS DEFS_RM PROFILE CC LD MKDEP MKTAGS LDFLAGS C_INCLUDES \
 		C_DEFS DEFS_RM PROFILE CC LD MKDEP MKTAGS LDFLAGS C_INCLUDES \
 		MOD_LDFLAGS LIB_LDFLAGS UTILS_LDFLAGS LIB_SONAME LD_RPATH \
 		MOD_LDFLAGS LIB_LDFLAGS UTILS_LDFLAGS LIB_SONAME LD_RPATH \

+ 1 - 1
Makefile.targets

@@ -26,7 +26,7 @@ clean_targets:=	clean proper distclean realclean maintainer-clean local-clean \
 				maintaner-clean-utils \
 				maintaner-clean-utils \
 				clean-libs proper-libs realclean-libs distclean-libs \
 				clean-libs proper-libs realclean-libs distclean-libs \
 				maintainer-clean-libs \
 				maintainer-clean-libs \
-				clean-tmp clean_doxygen
+				clean-tmp clean_doxygen clean-extra-names
 doc_targets:=	README man install-doc install-man install-ser-man \
 doc_targets:=	README man install-doc install-man install-ser-man \
 		install-every-module-doc install-every-module-man \
 		install-every-module-doc install-every-module-man \
 		$(foreach m,$(modules_dirs),$(m)-doc $(m)-readme $(m)-man) \
 		$(foreach m,$(modules_dirs),$(m)-doc $(m)-readme $(m)-man) \