[asterisk-commits] kpfleming: branch kpfleming/multimodule-build r112356 - in /team/kpfleming/mu...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 1 17:44:07 CDT 2008


Author: kpfleming
Date: Tue Apr  1 17:44:07 2008
New Revision: 112356

URL: http://svn.digium.com/view/asterisk?view=rev&rev=112356
Log:
save work in progress

Added:
    team/kpfleming/multimodule-build/astbuild/
    team/kpfleming/multimodule-build/astbuild/Makefile.core   (with props)
    team/kpfleming/multimodule-build/res/Makefile.astbuild   (with props)
    team/kpfleming/multimodule-build/res/res_ael_share_2.c   (with props)
    team/kpfleming/multimodule-build/res/res_blargh.cc   (with props)
    team/kpfleming/multimodule-build/res/res_blargh_parser.cc   (with props)
    team/kpfleming/multimodule-build/res/res_blarney.cc   (with props)

Added: team/kpfleming/multimodule-build/astbuild/Makefile.core
URL: http://svn.digium.com/view/asterisk/team/kpfleming/multimodule-build/astbuild/Makefile.core?view=auto&rev=112356
==============================================================================
--- team/kpfleming/multimodule-build/astbuild/Makefile.core (added)
+++ team/kpfleming/multimodule-build/astbuild/Makefile.core Tue Apr  1 17:44:07 2008
@@ -1,0 +1,182 @@
+all:
+
+dist-clean::
+	rm -f .*.moduleinfo .moduleinfo
+	rm -f .*.makeopts .makeopts
+
+# XXX: this will now be a full path
+SUBDIR:=$(shell pwd)
+
+# list of module names (all modules, using virtual names for modules that have them)
+all-mods :=
+
+# list of modules names to *not* build
+mods-n :=
+
+# list of module names to build
+mods-m :=
+mods-y :=
+
+include Makefile.astbuild
+
+$(warning mods-n = $(mods-n))
+$(warning mods-m = $(mods-m))
+$(warning mods-y = $(mods-y))
+
+# lists of module names (all modules, using virtual names for modules that have them)
+all-mods-c :=
+all-mods-cc :=
+
+# lists of module names (modules to build)
+mods-c-m = $(single-mods-c-m) $(multi-mods-c-m)
+mods-c-y = $(single-mods-c-y) $(multi-mods-c-y)
+mods-cc-m = $(single-mods-cc-m) $(multi-mods-cc-m)
+mods-cc-y = $(single-mods-cc-y) $(multi-mods-cc-y)
+
+# lists of module names (multi-component modules)
+multi-mods-m = $(multi-mods-c-m) $(multi-mods-cc-m)
+multi-mods-y = $(multi-mods-c-y) $(multi-mods-cc-y)
+multi-mods-c-m :=
+multi-mods-c-y :=
+multi-mods-cc-m :=
+multi-mods-cc-y :=
+
+# lists of module names (single-component modules)
+single-mods-m = $(single-mods-c-m) $(single-mods-cc-m)
+single-mods-y = $(single-mods-c-y) $(single-mods-cc-y)
+single-mods-c-m :=
+single-mods-c-y :=
+single-mods-cc-m :=
+single-mods-cc-y :=
+
+# lists of object names (all objects)
+objs-m = $(single-objs-m) $(multi-objs-m)
+objs-y = $(single-objs-y) $(multi-objs-y)
+objs-c-m = $(single-objs-c-m) $(multi-objs-c-m)
+objs-c-y = $(single-objs-c-y) $(multi-objs-c-y)
+objs-cc-m = $(single-objs-cc-m) $(multi-objs-cc-m)
+objs-cc-y = $(single-objs-cc-y) $(multi-objs-cc-y)
+
+# lists of object names (objects in multi-component modules)
+multi-objs-m = $(multi-objs-c-m) $(multi-objs-cc-m)
+multi-objs-y = $(multi-objs-c-y) $(multi-objs-cc-y)
+multi-objs-c-m :=
+multi-objs-c-y :=
+multi-objs-cc-m :=
+multi-objs-cc-y :=
+
+# lists of object names (objects in single-component modules)
+single-objs-m = $(single-objs-c-m) $(single-objs-cc-m)
+single-objs-y = $(single-objs-c-y) $(single-objs-cc-y)
+single-objs-c-m :=
+single-objs-c-y :=
+single-objs-cc-m :=
+single-objs-cc-y :=
+
+# steps
+# - split contents of all-mods into all-mods-(c,cc)
+# - find matching C sources that are not already a component and add to all-mods-c
+# - find matching CC sources that are not already a component and add to all-mods-cc
+# - repopulate all-mods with complete lists
+
+# find all multi-component C modules in all-mods and move them to all-mods-c
+all-mods-c := $(strip $(foreach mod,$(all-mods),$(if $(filter %.o,$($(mod))),$(mod))))
+# find all multi-component CC modules in all-mods and move them to all-mods-cc
+all-mods-cc := $(strip $(foreach mod,$(all-mods),$(if $(filter %.oo,$($(mod))),$(mod))))
+
+$(warning all-mods-c = $(all-mods-c))
+$(warning all-mods-cc = $(all-mods-cc))
+
+# find all available C modules that aren't already known
+ifneq ($(MODULE_PREFIX),)
+  # scan for matching C sources which could be modules
+  found-mods-c := $(patsubst %.c,%,$(wildcard $(MODULE_PREFIX)_*.c))
+  # remove anything already in all-mods
+  found-mods-c := $(filter-out $(all-mods),$(found-mods-c))
+  # remove anything that is a component of any module in all-mods-c
+  found-mods-c := $(filter-out $(foreach mod,$(all-mods-c),$(patsubst %.o,%,$($(mod)))),$(found-mods-c))
+endif
+
+# find all available CC modules that aren't already known
+ifneq ($(MODULE_PREFIX),)
+  # scan for matching CC sources which could be modules
+  found-mods-cc := $(patsubst %.cc,%,$(wildcard $(MODULE_PREFIX)_*.cc))
+  # remove anything already in all-mods
+  found-mods-cc := $(filter-out $(all-mods),$(found-mods-cc))
+  # remove anything that is a component of any module in all-mods-cc
+  found-mods-cc := $(filter-out $(foreach mod,$(all-mods-cc),$(patsubst %.oo,%,$($(mod)))),$(found-mods-cc))
+endif
+
+$(warning found-mods-c = $(found-mods-c))
+$(warning found-mods-cc = $(found-mods-cc))
+
+all-mods-c := $(sort $(all-mods-c) $(found-mods-c))
+all-mods-cc := $(sort $(all-mods-cc) $(found-mods-cc))
+
+$(warning all-mods-c = $(all-mods-c))
+$(warning all-mods-cc = $(all-mods-cc))
+
+all-mods := $(sort $(all-mods-c) $(all-mods-cc))
+
+mods-m += $(filter-out $(mods-y) $(mods-n),$(all-mods))
+
+$(warning mods-y = $(mods-y))
+$(warning mods-m = $(mods-m))
+
+multi-mods-c-m := $(filter-out $(mods-y) $(mods-n),$(foreach mod,$(all-mods-c),$(if $($(mod)),$(mod))))
+multi-mods-c-y := $(filter-out $(mods-m) $(mods-n),$(foreach mod,$(all-mods-c),$(if $($(mod)),$(mod))))
+multi-mods-cc-m := $(filter-out $(mods-y) $(mods-n),$(foreach mod,$(all-mods-cc),$(if $($(mod)),$(mod))))
+multi-mods-cc-y := $(filter-out $(mods-m) $(mods-n),$(foreach mod,$(all-mods-cc),$(if $($(mod)),$(mod))))
+
+$(warning multi-mods-c-m = $(multi-mods-c-m))
+$(warning multi-mods-c-y = $(multi-mods-c-y))
+$(warning multi-mods-cc-m = $(multi-mods-cc-m))
+$(warning multi-mods-cc-y = $(multi-mods-cc-y))
+
+# function: module-base
+#
+# get the base file for a module, the one that contains its dependency
+# and other build-related information; this will be either the
+# file with the same name as the module, or the first component of its
+# component list if it is a multi-component module
+#
+module-base = $(if $($(1)),$(basename $(firstword $($(1)))),$(1))
+
+# function: modname-multi
+#
+# get the module name that a component will be linked into
+modname-multi = $(sort $(foreach m,$(multi-used),\
+		$(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=))))
+
+$(warning module-base for res_config_odbc = $(call module-base,res_config_odbc))
+$(warning module-base for res_ael_foo = $(call module-base,res_ael_foo))
+
+.%.moduleinfo: %.c
+	@echo "<member name=\"$*\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.o $(SUBDIR)/$*.so\">" > $@
+	@$(AWK) -f $(ASTTOPDIR)/build_tools/get_moduleinfo $< >> $@
+	@echo "</member>" >> $@
+
+.%.moduleinfo: %.cc
+	@echo "<member name=\"$*\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.oo $(SUBDIR)/$*.so\">" > $@
+	@$(AWK) -f $(ASTTOPDIR)/build_tools/get_moduleinfo $< >> $@
+	@echo "</member>" >> $@
+
+.moduleinfo:: $(addsuffix .moduleinfo,$(addprefix .,$(foreach mod,$(all-mods),$(call module-base,$(mod)))))
+	@echo "<category name=\"MENUSELECT_$(MENUSELECT_CATEGORY)\" displayname=\"$(MENUSELECT_DESCRIPTION)\" remove_on_change=\"$(SUBDIR)/modules.link\">" > $@
+	@cat $^ >> $@
+	@echo "</category>" >> $@
+
+moduleinfo: .moduleinfo
+	@cat $<
+
+.%.makeopts: %.c
+	@$(AWK) -f $(ASTTOPDIR)/build_tools/get_makeopts $< > $@
+
+.%.makeopts: %.cc
+	@$(AWK) -f $(ASTTOPDIR)/build_tools/get_makeopts $< > $@
+
+.makeopts:: $(addsuffix .makeopts,$(addprefix .,$(foreach mod,$(all-mods),$(call module-base,$(mod)))))
+	@cat $^ > $@
+
+makeopts: .makeopts
+	@cat $<

Propchange: team/kpfleming/multimodule-build/astbuild/Makefile.core
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/kpfleming/multimodule-build/astbuild/Makefile.core
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/kpfleming/multimodule-build/astbuild/Makefile.core
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/kpfleming/multimodule-build/res/Makefile.astbuild
URL: http://svn.digium.com/view/asterisk/team/kpfleming/multimodule-build/res/Makefile.astbuild?view=auto&rev=112356
==============================================================================
--- team/kpfleming/multimodule-build/res/Makefile.astbuild (added)
+++ team/kpfleming/multimodule-build/res/Makefile.astbuild Tue Apr  1 17:44:07 2008
@@ -1,0 +1,16 @@
+MODULE_PREFIX=res
+MENUSELECT_CATEGORY=RES
+MENUSELECT_DESCRIPTION=Resource Modules
+
+all-mods = res_snmp res_ael_foo res_blargh
+
+res_snmp = res_snmp.o snmp/agent.o
+
+res_ael_foo = res_ael_share.o ael/ael_lex.o ael/ael.tab.o ael/pval.o res_ael_share_2.o
+
+res_blargh = res_blargh.oo res_blargh_parser.oo
+
+mods-y = res_config_odbc res_blargh
+
+mods-n = res_config_pgsql res_snmp
+

Propchange: team/kpfleming/multimodule-build/res/Makefile.astbuild
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/kpfleming/multimodule-build/res/Makefile.astbuild
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/kpfleming/multimodule-build/res/Makefile.astbuild
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/kpfleming/multimodule-build/res/res_ael_share_2.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/multimodule-build/res/res_ael_share_2.c?view=auto&rev=112356
==============================================================================
    (empty)

Propchange: team/kpfleming/multimodule-build/res/res_ael_share_2.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/kpfleming/multimodule-build/res/res_ael_share_2.c
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/kpfleming/multimodule-build/res/res_ael_share_2.c
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/kpfleming/multimodule-build/res/res_blargh.cc
URL: http://svn.digium.com/view/asterisk/team/kpfleming/multimodule-build/res/res_blargh.cc?view=auto&rev=112356
==============================================================================
    (empty)

Propchange: team/kpfleming/multimodule-build/res/res_blargh.cc
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/kpfleming/multimodule-build/res/res_blargh.cc
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/kpfleming/multimodule-build/res/res_blargh.cc
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/kpfleming/multimodule-build/res/res_blargh_parser.cc
URL: http://svn.digium.com/view/asterisk/team/kpfleming/multimodule-build/res/res_blargh_parser.cc?view=auto&rev=112356
==============================================================================
    (empty)

Propchange: team/kpfleming/multimodule-build/res/res_blargh_parser.cc
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/kpfleming/multimodule-build/res/res_blargh_parser.cc
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/kpfleming/multimodule-build/res/res_blargh_parser.cc
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/kpfleming/multimodule-build/res/res_blarney.cc
URL: http://svn.digium.com/view/asterisk/team/kpfleming/multimodule-build/res/res_blarney.cc?view=auto&rev=112356
==============================================================================
    (empty)

Propchange: team/kpfleming/multimodule-build/res/res_blarney.cc
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/kpfleming/multimodule-build/res/res_blarney.cc
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/kpfleming/multimodule-build/res/res_blarney.cc
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list