aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.moddir_rules
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-05 17:27:02 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-05 17:27:02 +0000
commita81a01d13cccf2e06c5fdcf4664ebfb2660771c6 (patch)
tree46b03bcec373b9f9b47852df2e857f61ea2e76b4 /Makefile.moddir_rules
parenteb61f174cd11d0acf999e823c560065a84a54057 (diff)
merge two rules with the same right hand;
document a bit what is done here. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88587 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'Makefile.moddir_rules')
-rw-r--r--Makefile.moddir_rules16
1 files changed, 14 insertions, 2 deletions
diff --git a/Makefile.moddir_rules b/Makefile.moddir_rules
index 38caf2294..f2ea69c20 100644
--- a/Makefile.moddir_rules
+++ b/Makefile.moddir_rules
@@ -11,6 +11,13 @@
# the GNU General Public License
#
+# Makefile rules for building modules.
+
+# In most cases, we set target-specific variables for certain targets
+# (remember that they apply recursively to prerequisites).
+# Also note that we can only set one variable per rule, so we have to
+# repeat the left hand side to set multiple variables.
+
ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
ifeq ($(findstring astmm.h,$(ASTCFLAGS)),)
ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
@@ -29,9 +36,14 @@ include $(ASTTOPDIR)/Makefile.rules
comma:=,
-$(addsuffix .o,$(C_MODS)): ASTCFLAGS+=-DAST_MODULE=\"$*\" $(MENUSELECT_OPTS_$*:%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_INCLUDE))
-$(addsuffix .oo,$(CC_MODS)): ASTCFLAGS+=-DAST_MODULE=\"$*\" $(MENUSELECT_OPTS_$*:%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_INCLUDE))
+# Both C++ and C++ sources need their module name in AST_MODULE
+# We also pass whatever _INCLUDE list is generated by menuselect
+# (they are stored in file 'makeopts')
+
+$(addsuffix .oo,$(CC_MODS)) $(addsuffix .o,$(C_MODS)): \
+ ASTCFLAGS+= -DAST_MODULE=\"$*\" $(MENUSELECT_OPTS_$*:%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_INCLUDE))
+# For loadable modules, pass _LIB and _LDFLAGS from menuselect.
$(LOADABLE_MODS:%=%.so): ASTCFLAGS+=-fPIC
$(LOADABLE_MODS:%=%.so): LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_LIB))
$(LOADABLE_MODS:%=%.so): ASTLDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_LDFLAGS))