[asterisk-commits] branch group/new_loader_completion r37717 - in
/team/group/new_loader_complet...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sat Jul 15 17:48:28 MST 2006
Author: kpfleming
Date: Sat Jul 15 19:48:28 2006
New Revision: 37717
URL: http://svn.digium.com/view/asterisk?rev=37717&view=rev
Log:
more prep work for embedded modules
Modified:
team/group/new_loader_completion/Makefile.moddir_rules
team/group/new_loader_completion/Makefile.rules
team/group/new_loader_completion/apps/Makefile
team/group/new_loader_completion/cdr/Makefile
team/group/new_loader_completion/channels/Makefile
team/group/new_loader_completion/codecs/Makefile
team/group/new_loader_completion/formats/Makefile
team/group/new_loader_completion/funcs/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=37717&r1=37716&r2=37717&view=diff
==============================================================================
--- team/group/new_loader_completion/Makefile.moddir_rules (original)
+++ team/group/new_loader_completion/Makefile.moddir_rules Sat Jul 15 19:48:28 2006
@@ -10,6 +10,8 @@
# This program is free software, distributed under the terms of
# the GNU General Public License
#
+
+EMBED_SUBMODULES=
include $(ASTTOPDIR)/Makefile.rules
@@ -35,17 +37,25 @@
$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
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_c_template,$(mod))))
-$(foreach mod,$(C_MODS),$(eval $(call module_so_o_template,$(mod))))
+$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(C_MODS)),$(eval $(call module_so_o_template,$(mod))))
$(foreach mod,$(CC_MODS),$(eval $(call module_oo_cc_template,$(mod))))
-$(foreach mod,$(CC_MODS),$(eval $(call module_so_oo_template,$(mod))))
+$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(CC_MODS)),$(eval $(call module_so_oo_template,$(mod))))
.PHONY: clean clean-depend depend uninstall _all
-_all: $(SELECTED_MODS:%=%.so)
+_all: $(LOADABLE_MODS:%=%.so)
clean-depend::
rm -f .depend
@@ -54,7 +64,7 @@
rm -f *.so *.o *.oo
install:: all
- for x in $(SELECTED_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(LOADABLE_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
uninstall::
Modified: team/group/new_loader_completion/Makefile.rules
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/Makefile.rules?rev=37717&r1=37716&r2=37717&view=diff
==============================================================================
--- team/group/new_loader_completion/Makefile.rules (original)
+++ team/group/new_loader_completion/Makefile.rules Sat Jul 15 19:48:28 2006
@@ -11,43 +11,123 @@
# the GNU General Public License
#
-define module_o_template
-$(1).o: $(1).c
- $$(CC) -c -o $$@ $$< $$(CFLAGS) $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
+ifeq ($(NOISY_BUILD),)
+
+define ast_make_o_c
+$(1): $(2)
+ @echo " [CC] $$< -> $$@"
+ @$$(CC) -o $$@ -c $$< $$(CFLAGS)
endef
-define module_so_template
-$(1).so: $(1).o
- $$(CC) $$(SOLINK) -o $$@ $$^ $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+define ast_make_oo_cc
+$(1): $(2)
+ @echo " [CXX] $$< -> $$@"
+ @$$(CXX) -o $$@ -c $$< $$(CFLAGS)
endef
-%.o: %.c
- $(CC) -c -o $@ $< $(CFLAGS)
+define ast_make_c_y
+$(1): $(2)
+ @echo " [BISON] $$< -> $$@"
+ @bison -o $$@ -d --name-prefix=ast_yy $$<
+endef
-$(foreach mod,$(SELECTED_MODS),$(eval $(call module_o_template,$(mod))))
+define ast_make_c_fl
+$(1): $(2)
+ @echo " [FLEX] $$< -> $$@"
+ @flex -o $$@ --full $$<
+endef
-$(foreach mod,$(SELECTED_MODS),$(eval $(call module_so_template,$(mod))))
+define ast_make_so_o
+$(1): $(2)
+ @echo " [LD] $$^ -> $$@"
+ @$$(CC) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
+endef
-.PHONY: clean clean-depend depend uninstall _all
+define ast_make_so_oo
+$(1): $(2)
+ @echo " [LDXX] $$^ -> $$@"
+ @$$(CXX) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
+endef
-_all: $(SELECTED_MODS:%=%.so)
+define ast_make_a_o
+$(1): $(2)
+ @echo " [AR] $$^ -> $$@"
+ @$$(AR) cr $$@ $$^
+ @$$(RANLIB) $$@
+endef
-clean-depend::
- rm -f .depend
+define ast_make_final
+$(1): $(2)
+ @echo " [LD] $$^ -> $$@"
+ @$$(CC) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
+endef
-clean:: clean-depend
- rm -f *.so *.o
+define ast_make_final_host
+$(1): $(2)
+ @echo " [LD] $$^ -> $$@"
+ @$$(HOST_CC) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
+endef
-install:: all
- for x in $(SELECTED_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+else
-uninstall::
+define ast_make_o_c
+$(1): $(2)
+ $$(CC) -o $$@ -c $$< $$(CFLAGS)
+endef
-ifneq ($(wildcard .depend),)
- include .depend
+define ast_make_oo_cc
+$(1): $(2)
+ $$(CXX) -o $$@ -c $$< $$(CFLAGS)
+endef
+
+define ast_make_c_y
+$(1): $(2)
+ bison -o $$@ -d --name-prefix=ast_yy $$<
+endef
+
+define ast_make_c_fl
+$(1): $(2)
+ flex -o $$@ --full $$<
+endef
+
+define ast_make_so_o
+$(1): $(2)
+ $$(CC) -o $$@ $$(LDFAGS) $$(SOLINK) $$^ $$(LIBS)
+endef
+
+define ast_make_so_oo
+$(1): $(2)
+ $$(CXX) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
+endef
+
+define ast_make_a_o
+$(1): $(2)
+ $$(AR) cr $$@ $$^
+ $$(RANLIB) $$@
+endef
+
+define ast_make_final
+$(1): $(2)
+ $$(CC) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
+endef
+
+define ast_make_final_host
+$(1): $(2)
+ $$(HOST_CC) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
+endef
+
endif
-depend: .depend
+$(eval $(call ast_make_o_c,%.o,%.c))
-.depend:
- ../build_tools/mkdep $(CFLAGS) `ls *.c`
+$(eval $(call ast_make_oo_cc,%.oo,%.cc))
+
+$(eval $(call ast_make_so_o,%.so,%.o))
+
+$(eval $(call ast_make_so_oo,%.so,%.oo))
+
+$(eval $(call ast_make_final,%,%.o))
+
+$(eval $(call ast_make_c_y,%.c,%.y))
+
+$(eval $(call ast_make_c_fl,%.c,%.fl))
Modified: team/group/new_loader_completion/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/apps/Makefile?rev=37717&r1=37716&r2=37717&view=diff
==============================================================================
--- team/group/new_loader_completion/apps/Makefile (original)
+++ team/group/new_loader_completion/apps/Makefile Sat Jul 15 19:48:28 2006
@@ -17,7 +17,12 @@
C_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%,$(wildcard app_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.cc,%,$(wildcard app_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring apps,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
ifneq ($(findstring ODBC_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),)
MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_ODBC_STORAGE)
Modified: team/group/new_loader_completion/cdr/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/cdr/Makefile?rev=37717&r1=37716&r2=37717&view=diff
==============================================================================
--- team/group/new_loader_completion/cdr/Makefile (original)
+++ team/group/new_loader_completion/cdr/Makefile Sat Jul 15 19:48:28 2006
@@ -17,7 +17,12 @@
C_MODS:=$(filter-out $(MENUSELECT_CDR),$(patsubst %.c,%,$(wildcard cdr_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_CDR),$(patsubst %.cc,%,$(wildcard cdr_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring cdr,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
all: _all
Modified: team/group/new_loader_completion/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/Makefile?rev=37717&r1=37716&r2=37717&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/Makefile (original)
+++ team/group/new_loader_completion/channels/Makefile Sat Jul 15 19:48:28 2006
@@ -55,7 +55,12 @@
PWLIBDIR=$(HOME)/pwlib
endif
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring channels,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
all: _all
@@ -79,7 +84,7 @@
chan_oss.o: busy.h ringtone.h
-chan_iax2.so: iax2-parser.o iax2-provision.o
+$(eval $(call ast_mod_submodule,chan_iax2,iax2-parser.o iax2-provision.o))
chan_alsa.o: busy.h ringtone.h
@@ -98,5 +103,5 @@
misdn_config.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\"
-chan_misdn.so: chan_misdn.o misdn_config.o misdn/chan_misdn_lib.a
+$(eval $(call ast_mod_submodule,chan_misdn,chan_misdn.o misdn_config.o misdn/chan_misdn_lib.a))
chan_misdn.so: LIBS+=-lisdnnet -lmISDN
Modified: team/group/new_loader_completion/codecs/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/codecs/Makefile?rev=37717&r1=37716&r2=37717&view=diff
==============================================================================
--- team/group/new_loader_completion/codecs/Makefile (original)
+++ team/group/new_loader_completion/codecs/Makefile Sat Jul 15 19:48:28 2006
@@ -19,7 +19,12 @@
C_MODS:=$(filter-out $(MENUSELECT_CODECS),$(patsubst %.c,%,$(wildcard codec_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_CODECS),$(patsubst %.cc,%,$(wildcard codec_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring codecs,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
LIBILBC:=ilbc/libilbc.a
LIBLPC10:=lpc10/liblpc10.a
@@ -30,7 +35,7 @@
GSM_INCLUDE:=-Igsm/inc
GSM_LIB:=
-codec_gsm.so: gsm/lib/libgsm.a
+$(eval $(call ast_mod_submodule,codec_gsm,gsm/lib/libgsm.a))
endif
include $(ASTTOPDIR)/Makefile.moddir_rules
@@ -47,9 +52,9 @@
$(LIBLPC10):
@CFLAGS="$(ASTCFLAGS)" $(MAKE) -C lpc10 all
-codec_lpc10.so: $(LIBLPC10)
+$(eval $(call ast_mod_submodule,codec_lpc10,$(LIBLPC10)))
$(LIBILBC):
@CFLAGS="$(ASTCFLAGS)" $(MAKE) -C ilbc all
-codec_ilbc.so: $(LIBILBC)
+$(eval $(call ast_mod_submodule,codec_ilbc,$(LIBILBC)))
Modified: team/group/new_loader_completion/formats/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/formats/Makefile?rev=37717&r1=37716&r2=37717&view=diff
==============================================================================
--- team/group/new_loader_completion/formats/Makefile (original)
+++ team/group/new_loader_completion/formats/Makefile Sat Jul 15 19:48:28 2006
@@ -17,7 +17,12 @@
C_MODS:=$(filter-out $(MENUSELECT_FORMATS),$(patsubst %.c,%,$(wildcard format_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_FORMATS),$(patsubst %.cc,%,$(wildcard format_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring formats,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
all: _all
Modified: team/group/new_loader_completion/funcs/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/Makefile?rev=37717&r1=37716&r2=37717&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/Makefile (original)
+++ team/group/new_loader_completion/funcs/Makefile Sat Jul 15 19:48:28 2006
@@ -17,7 +17,12 @@
C_MODS:=$(filter-out $(MENUSELECT_FUNCS),$(patsubst %.c,%,$(wildcard func_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_FUNCS),$(patsubst %.cc,%,$(wildcard func_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring funcs,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
all: _all
Modified: team/group/new_loader_completion/pbx/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/pbx/Makefile?rev=37717&r1=37716&r2=37717&view=diff
==============================================================================
--- team/group/new_loader_completion/pbx/Makefile (original)
+++ team/group/new_loader_completion/pbx/Makefile Sat Jul 15 19:48:28 2006
@@ -17,7 +17,12 @@
C_MODS:=$(filter-out $(MENUSELECT_PBX),$(patsubst %.c,%,$(wildcard pbx_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_PBX),$(patsubst %.cc,%,$(wildcard pbx_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring pbx,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
all: _all
@@ -32,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.
-pbx_ael.so: ael/aelbison.o ael/aelflex.o
+$(eval $(call ast_mod_submodule,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)
@@ -40,7 +45,7 @@
ael/ael.tab.c ael/ael.tab.h:
(cd ael; bison -v -d ael.y)
-$(eval $(call ast_make_o_c,dundi-parser.o,dundi-parser.c dundi-parser.h))
+dundi-parser.o: dundi-parser.h
dundi-parser.o: CFLAGS+=-I.
-pbx_dundi.so: dundi-parser.o
+$(eval $(call ast_mod_submodule,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=37717&r1=37716&r2=37717&view=diff
==============================================================================
--- team/group/new_loader_completion/res/Makefile (original)
+++ team/group/new_loader_completion/res/Makefile Sat Jul 15 19:48:28 2006
@@ -17,13 +17,18 @@
C_MODS:=$(filter-out $(MENUSELECT_RES),$(patsubst %.c,%,$(wildcard res_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_RES),$(patsubst %.cc,%,$(wildcard res_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring res,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
all: _all
include $(ASTTOPDIR)/Makefile.moddir_rules
-res_snmp.so: snmp/agent.o
+$(eval $(call ast_mod_submodule,res_snmp,snmp/agent.o))
clean::
rm -f snmp/*.o
More information about the asterisk-commits
mailing list