[asterisk-commits] branch group/new_loader_completion r37718 - in /team/group/new_loader_complet...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Jul 15 21:58:01 MST 2006


Author: kpfleming
Date: Sat Jul 15 23:58:00 2006
New Revision: 37718

URL: http://svn.digium.com/view/asterisk?rev=37718&view=rev
Log:
actually build an archive of modules that are selected to be embedded
simplify templates in Makefile.moddir_rules somewhat

Modified:
    team/group/new_loader_completion/Makefile.moddir_rules
    team/group/new_loader_completion/apps/Makefile
    team/group/new_loader_completion/channels/Makefile
    team/group/new_loader_completion/codecs/Makefile
    team/group/new_loader_completion/pbx/Makefile
    team/group/new_loader_completion/res/Makefile

Modified: team/group/new_loader_completion/Makefile.moddir_rules
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/Makefile.moddir_rules?rev=37718&r1=37717&r2=37718&view=diff
==============================================================================
--- team/group/new_loader_completion/Makefile.moddir_rules (original)
+++ team/group/new_loader_completion/Makefile.moddir_rules Sat Jul 15 23:58:00 2006
@@ -11,57 +11,64 @@
 # the GNU General Public License
 #
 
-EMBED_SUBMODULES=
-
 include $(ASTTOPDIR)/Makefile.rules
 
-define module_o_c_template
-$(1).o: $(1).c
-$(1).o: CFLAGS+=-DAST_MODULE=\"$(1)\" $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
+define module_o_template
+$(2): $(3)
+$(2): CFLAGS+=-DAST_MODULE=\"$(1)\" $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
 endef
 
-define module_oo_cc_template
-$(1).oo: $(1).cc
-$(1).oo: CFLAGS+=-DAST_MODULE=\"$(1)\" $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
-endef
-
-define module_so_o_template
-$(1).so: $(1).o
+define module_so_template
+$(1)=$(1).so
+$(1).so: $(2)
 $(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
 $(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
 endef
 
-define module_so_oo_template
-$(1).so: $(1).oo
-$(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
-$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
+define module_a_template
+$(1)=modules.a
+modules.a: $(2)
 endef
 
-define ast_mod_submodule
-ifeq ($$(findstring $(1),$$(EMBEDDED_MODS)),)
-$(1).so: $(2)
-else
-EMBED_SUBMODULES+=$(2)
-endif
-endef
+$(foreach mod,$(C_MODS),$(eval $(call module_o_template,$(mod),$(mod).o,$(mod).c)))
 
-$(foreach mod,$(C_MODS),$(eval $(call module_o_c_template,$(mod))))
+$(foreach mod,$(CC_MODS),$(eval $(call module_o_template,$(mod),$(mod).oo,$(mod).cc)))
 
-$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(C_MODS)),$(eval $(call module_so_o_template,$(mod))))
+$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(C_MODS)),$(eval $(call module_so_template,$(mod),$(mod).o)))
 
-$(foreach mod,$(CC_MODS),$(eval $(call module_oo_cc_template,$(mod))))
+$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(CC_MODS)),$(eval $(call module_so_template,$(mod),$(mod).oo)))
 
-$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(CC_MODS)),$(eval $(call module_so_oo_template,$(mod))))
+$(foreach mod,$(filter $(EMBEDDED_MODS),$(C_MODS)),$(eval $(call module_a_template,$(mod),$(mod).o)))
+
+$(foreach mod,$(filter $(EMBEDDED_MODS),$(CC_MODS)),$(eval $(call module_a_template,$(mod),$(mod).oo)))
 
 .PHONY: clean clean-depend depend uninstall _all
 
+ifneq ($(LOADABLE_MODS),)
 _all: $(LOADABLE_MODS:%=%.so)
+endif
+
+ifneq ($(EMBEDDED_MODS),)
+_all: modules.a
+endif
+
+ifeq ($(NOISY_BUILD),)
+modules.a:
+	@echo "   [AR] $^ -> $@"
+	@$(AR) cr $@ $^
+	@$(RANLIB) $@
+else
+modules.a:
+	$(AR) cr $@ $^
+	$(RANLIB) $@
+endif
 
 clean-depend::
 	rm -f .depend
 
 clean:: clean-depend
 	rm -f *.so *.o *.oo
+	rm -f modules.a
 
 install:: all
 	for x in $(LOADABLE_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done

Modified: team/group/new_loader_completion/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/apps/Makefile?rev=37718&r1=37717&r2=37718&view=diff
==============================================================================
--- team/group/new_loader_completion/apps/Makefile (original)
+++ team/group/new_loader_completion/apps/Makefile Sat Jul 15 23:58:00 2006
@@ -34,10 +34,11 @@
 MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_IMAP_STORAGE)
 endif
 
+ifeq (SunOS,$(shell uname))
+MENUSELECT_DEPENDS_app_chanspy+=RT
+RT_LIB=-lrt
+endif
+
 all: _all
 
 include $(ASTTOPDIR)/Makefile.moddir_rules
-
-ifeq (SunOS,$(shell uname))
-app_chanspy.so: LIBS+=-lrt
-endif

Modified: team/group/new_loader_completion/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/Makefile?rev=37718&r1=37717&r2=37718&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/Makefile (original)
+++ team/group/new_loader_completion/channels/Makefile Sat Jul 15 23:58:00 2006
@@ -62,6 +62,9 @@
   LOADABLE_MODS:=
 endif
 
+MENUSELECT_DEPENDS_chan_misdn=MISDN
+MISDN_LIB=-lisdnnet -lmISDN
+
 all: _all
 
 include $(ASTTOPDIR)/Makefile.moddir_rules
@@ -84,7 +87,7 @@
 
 chan_oss.o: busy.h ringtone.h
 
-$(eval $(call ast_mod_submodule,chan_iax2,iax2-parser.o iax2-provision.o))
+$(chan_iax2): iax2-parser.o iax2-provision.o
 
 chan_alsa.o: busy.h ringtone.h
 
@@ -103,5 +106,4 @@
 
 misdn_config.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\"
 
-$(eval $(call ast_mod_submodule,chan_misdn,chan_misdn.o misdn_config.o misdn/chan_misdn_lib.a))
-chan_misdn.so: LIBS+=-lisdnnet -lmISDN
+$(chan_misdn): misdn_config.o misdn/chan_misdn_lib.a

Modified: team/group/new_loader_completion/codecs/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/codecs/Makefile?rev=37718&r1=37717&r2=37718&view=diff
==============================================================================
--- team/group/new_loader_completion/codecs/Makefile (original)
+++ team/group/new_loader_completion/codecs/Makefile Sat Jul 15 23:58:00 2006
@@ -31,14 +31,13 @@
 
 all: _all
 
+include $(ASTTOPDIR)/Makefile.moddir_rules
+
 ifeq ($(GSM_LIB),internal)
 GSM_INCLUDE:=-Igsm/inc
 GSM_LIB:=
-
-$(eval $(call ast_mod_submodule,codec_gsm,gsm/lib/libgsm.a))
+$(codec_gsm): gsm/lib/libgsm.a
 endif
-
-include $(ASTTOPDIR)/Makefile.moddir_rules
 
 clean::
 	$(MAKE) -C gsm clean
@@ -52,9 +51,9 @@
 $(LIBLPC10):
 	@CFLAGS="$(ASTCFLAGS)" $(MAKE) -C lpc10 all
 
-$(eval $(call ast_mod_submodule,codec_lpc10,$(LIBLPC10)))
+$(codec_lpc10): $(LIBLPC10)
 
 $(LIBILBC):
 	@CFLAGS="$(ASTCFLAGS)" $(MAKE) -C ilbc all
 
-$(eval $(call ast_mod_submodule,codec_ilbc,$(LIBILBC)))
+$(codec_ilbc): $(LIBILBC)

Modified: team/group/new_loader_completion/pbx/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/pbx/Makefile?rev=37718&r1=37717&r2=37718&view=diff
==============================================================================
--- team/group/new_loader_completion/pbx/Makefile (original)
+++ team/group/new_loader_completion/pbx/Makefile Sat Jul 15 23:58:00 2006
@@ -37,7 +37,7 @@
 $(eval $(call ast_make_o_c,ael/aelbison.o,ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h))
 ael/aelbison.o: CFLAGS+=-I.
 
-$(eval $(call ast_mod_submodule,pbx_ael,ael/aelbison.o ael/aelflex.o))
+$(pbx_ael): ael/aelbison.o ael/aelflex.o
 
 ael/ael_lex.c:
 	(cd ael; flex ael.flex; sed -i -e "/begin standard C headers/i#include \"asterisk.h\"" ael_lex.c)
@@ -48,4 +48,4 @@
 dundi-parser.o: dundi-parser.h
 dundi-parser.o: CFLAGS+=-I.
 
-$(eval $(call ast_mod_submodule,pbx_dundi,dundi-parser.o))
+$(pbx_dundi): dundi-parser.o

Modified: team/group/new_loader_completion/res/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/res/Makefile?rev=37718&r1=37717&r2=37718&view=diff
==============================================================================
--- team/group/new_loader_completion/res/Makefile (original)
+++ team/group/new_loader_completion/res/Makefile Sat Jul 15 23:58:00 2006
@@ -28,7 +28,7 @@
 
 include $(ASTTOPDIR)/Makefile.moddir_rules
 
-$(eval $(call ast_mod_submodule,res_snmp,snmp/agent.o))
+$(res_snmp): snmp/agent.o
 
 clean::
 	rm -f snmp/*.o



More information about the asterisk-commits mailing list