Remove portions that weren't meant to be committed for the OS X compat fix
[asterisk/asterisk.git] / Makefile.moddir_rules
index 9258e8d..72d4c2a 100644 (file)
 # 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
- endif
-endif
-
 ifeq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
-  ASTCFLAGS+=${GC_CFLAGS}
+  _ASTCFLAGS+=${GC_CFLAGS}
 endif
 
 ifneq ($(findstring STATIC_BUILD,$(MENUSELECT_CFLAGS)),)
@@ -44,19 +38,18 @@ include $(ASTTOPDIR)/Makefile.rules
 
 ifneq ($(MODULE_PREFIX),)
     ALL_C_MODS:=
-    ALL_C_MODS+=$(foreach p,$(MODULE_PREFIX),$(patsubst %.c,%,$(wildcard $(p)_*.c)))
     ALL_CC_MODS:=
+    ALL_C_MODS+=$(foreach p,$(MODULE_PREFIX),$(patsubst %.c,%,$(wildcard $(p)_*.c)))
     ALL_CC_MODS+=$(foreach p,$(MODULE_PREFIX),$(patsubst %.cc,%,$(wildcard $(p)_*.cc)))
+endif
  
-    C_MODS:=$(filter-out $(MENUSELECT_$(MENUSELECT_CATEGORY)),$(ALL_C_MODS))
-    CC_MODS:=$(filter-out $(MENUSELECT_$(MENUSELECT_CATEGORY)),$(ALL_CC_MODS))
-
-    # and store in the list of embedded or loadable modules
-    ifneq ($(findstring $(MENUSELECT_CATEGORY),$(MENUSELECT_EMBED)),)
-       EMBEDDED_MODS:=$(C_MODS) $(CC_MODS)
-    else
-       LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
-    endif
+C_MODS:=$(filter-out $(MENUSELECT_$(MENUSELECT_CATEGORY)),$(ALL_C_MODS))
+CC_MODS:=$(filter-out $(MENUSELECT_$(MENUSELECT_CATEGORY)),$(ALL_CC_MODS))
+
+ifneq ($(findstring $(MENUSELECT_CATEGORY),$(MENUSELECT_EMBED)),)
+    EMBEDDED_MODS:=$(C_MODS) $(CC_MODS)
+else
+    LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
 endif
 
 # Both C++ and C++ sources need their module name in AST_MODULE
@@ -64,18 +57,18 @@ endif
 # (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))
+       _ASTCFLAGS+= -DAST_MODULE=\"$*\" $(MENUSELECT_OPTS_$*:%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_INCLUDE))
 
 ifeq ($(findstring $(OSARCH), mingw32 cygwin ),)
    # don't define -fPIC on mingw32 and cygwin, it is the default
-   $(LOADABLE_MODS:%=%.so): ASTCFLAGS+=-fPIC
+   $(LOADABLE_MODS:%=%.so): _ASTCFLAGS+=-fPIC
 endif
 
 # For loadable modules, pass _LIB and _LDFLAGS from menuselect.
 $(LOADABLE_MODS:%=%.so): LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_LIB))
-$(LOADABLE_MODS:%=%.so): ASTLDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_LDFLAGS))
+$(LOADABLE_MODS:%=%.so): _ASTLDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_LDFLAGS))
 
-$(EMBEDDED_MODS:%=%.o): ASTCFLAGS+=-DEMBEDDED_MODULE=$*
+$(EMBEDDED_MODS:%=%.o): _ASTCFLAGS+=-DEMBEDDED_MODULE=$*
 
 $(addsuffix .so,$(filter $(LOADABLE_MODS),$(C_MODS))): %.so: %.o
 $(addsuffix .so,$(filter $(LOADABLE_MODS),$(CC_MODS))): %.so: %.oo
@@ -116,8 +109,8 @@ modules.link:
        @for file in $(patsubst %,$(SUBDIR)/%,$(filter-out %.eo,$^)); do echo "INPUT (../$${file})" >> $@; done
 
 clean::
-       rm -f *.so *.o *.oo *.eo
-       rm -f .*.o.d .*.oo.d
+       rm -f *.so *.o *.oo *.eo *.i *.ii
+       rm -f .*.d
        rm -f *.s *.i
        rm -f modules.link