Makefile.defs: version set 3.4.0-dev2
[sip-router] / Makefile.modules
index 1f226ba..cd391e6 100644 (file)
@@ -16,6 +16,8 @@
 #              inside modules or libs) (andrei)
 #  2009-10-01  added support for automatically installing extra utils,
 #               scripts and cfg files (andrei)
+#  2010-03-04  don't overwrite already installed .cfgs, save the .cfg as
+#              .sample in this case (andrei)
 #
 
 #
@@ -73,6 +75,14 @@ override static_modules_path=
 # temporary def (visible only in the module, not exported)
 DEFS += -DMOD_NAME='"$(MOD_NAME)"'
 
+
+ifeq (,$(findstring -DSER_MOD_INTERFACE, $(DEFS)))
+       MODIFACE=-DOPENSER_MOD_INTERFACE
+else
+       MODIFACE=-DSER_MOD_INTERFACE
+endif
+
+
 ifneq ($(makefile_defs_included),1)
 $(error "the local makefile does not include Makefile.defs!")
 endif
@@ -209,10 +219,17 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
        @for r in $(MOD_INSTALL_CFGS) ; do \
                if [ -n "$$r" ]; then \
                        if [ -f "$$r" ]; then \
+                               n=`basename "$$r"` ; \
                                $(call try_err, $(INSTALL_TOUCH) \
-                                       $(cfg_prefix)/$(cfg_dir)/`basename "$$r"` ); \
+                                       "$(cfg_prefix)/$(cfg_dir)/$$n.sample" ); \
                                $(call try_err,\
-                                       $(INSTALL_CFG)  "$$r"  $(cfg_prefix)/$(cfg_dir) ); \
+                                       $(INSTALL_CFG)  "$$r"  \
+                                               "$(cfg_prefix)/$(cfg_dir)/$$n.sample"); \
+                               if [ -z "${skip_cfg_install}" -a \
+                                               ! -f "$(cfg_prefix)/$(cfg_dir)$$n" ]; then \
+                                       mv -f $(cfg_prefix)/$(cfg_dir)$$n.sample \
+                                               $(cfg_prefix)/$(cfg_dir)$$n; \
+                               fi ; \
                        else \
                                echo "ERROR: $$r not found" ; \
                                if [ ${err_fail} = 1 ] ; then \
@@ -264,7 +281,7 @@ $(share_prefix)/$(share_dir):
 ifneq (,$(wildcard doc/Makefile))
 #doc/Makefile present => we can generate README
 
-README: doc/*.xml
+README: doc/*.xml ../../docbook/entities.xml
        $(MAKE) -C doc $(MOD_NAME).txt
        mv doc/$(MOD_NAME).txt $@
 
@@ -288,6 +305,10 @@ man:
 
 endif
 
+
+printmiface:
+       @echo -n $(MODIFACE)
+
 endif # ifeq($(makefile_defs),1)
 
 include $(COREPATH)/Makefile.cfg