From b813ee240df586cbd5e49068f42a26c11a62da28 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 13 Mar 2007 14:43:40 +0000 Subject: [PATCH] fix module builds to not have to rebuild every time you run make git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4580 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- build/modmake.rules.in | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build/modmake.rules.in b/build/modmake.rules.in index 2fe9c930fd..d41dc5f8d8 100644 --- a/build/modmake.rules.in +++ b/build/modmake.rules.in @@ -38,18 +38,21 @@ CXXLINK = $(LIBTOOL) --mode=link --tag=CXX $(CXXLD) $(ALL_CXXFLAGS) $(LDFLAGS) - CURDIR=$(shell pwd) CSOURCEFILE=$(CURDIR)/$(MODNAME).c CXXSOURCEFILE=$(CURDIR)/$(MODNAME).cpp -#LINK_TYPE=$(shell if test -f $(CSOURCEFILE); then echo "clink"; else echo "cxxlink"; fi;) +SOURCEFILE=$(shell if test -f $(CSOURCEFILE); then echo $(CSOURCEFILE); else echo $(CXXSOURCEFILE); fi;) -all: depend $(MODNAME).$(DYNAMIC_LIB_EXTEN) local_all +all: local_depend local_all $(MODNAME).$(DYNAMIC_LIB_EXTEN) Makefile depend: local_depend clean: local_clean mod_clean install: all depend_install local_install mod_install distclean: clean local_distclean extraclean: distclean local_extraclean -$(MODNAME).o: depend +Makefile: + @if test ! -f $@; then \ + echo include $(switch_srcdir)/build/modmake.rules > Makefile ; \ + fi ; -$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).o $(LOCAL_OBJS) +$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).o $(LOCAL_OBJS) $(SOURCEFILE) @if test -f $(CSOURCEFILE); then \ echo $(LINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS); \ $(LINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS); \