mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 11:06:31 +00:00
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r43996 | kpfleming | 2006-09-29 11:47:05 -0500 (Fri, 29 Sep 2006) | 2 lines another cross-compile fix ........ r43997 | kpfleming | 2006-09-29 11:52:27 -0500 (Fri, 29 Sep 2006) | 2 lines support --without-curl in configure script ........ r44008 | kpfleming | 2006-09-29 13:25:49 -0500 (Fri, 29 Sep 2006) | 2 lines don't abuse CFLAGS and LDFLAGS for build of Asterisk components, because they are also then used for non-Asterisk components (like menuselect); use our own variables instead ........ r44011 | kpfleming | 2006-09-29 13:40:17 -0500 (Fri, 29 Sep 2006) | 2 lines missed one conversion to ASTCFLAGS ........ r44012 | kpfleming | 2006-09-29 13:49:07 -0500 (Fri, 29 Sep 2006) | 2 lines yet another place where we were not using the correct CFLAGS by default ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
106 lines
2.9 KiB
Makefile
106 lines
2.9 KiB
Makefile
#
|
|
# Asterisk -- A telephony toolkit for Linux.
|
|
#
|
|
# Makefile rules for subdirectories containing modules
|
|
#
|
|
# Copyright (C) 2006, Digium, Inc.
|
|
#
|
|
# Kevin P. Fleming <kpfleming@digium.com>
|
|
#
|
|
# This program is free software, distributed under the terms of
|
|
# the GNU General Public License
|
|
#
|
|
|
|
ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
|
|
ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
|
|
endif
|
|
|
|
ifeq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
|
|
ASTCFLAGS+=${GC_CFLAGS}
|
|
endif
|
|
|
|
ifneq ($(findstring STATIC_BUILD,$(MENUSELECT_CFLAGS)),)
|
|
STATIC_BUILD=-static
|
|
endif
|
|
|
|
include $(ASTTOPDIR)/Makefile.rules
|
|
|
|
comma:=,
|
|
|
|
define module_o_template
|
|
$(2): $(3)
|
|
$(2): ASTCFLAGS+=-DAST_MODULE=\"$(1)\" $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
|
|
endef
|
|
|
|
define module_so_template
|
|
$(1)=$(1).so
|
|
$(1).so: ASTCFLAGS+=-fPIC
|
|
$(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
|
|
$(1).so: ASTLDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
|
|
$(1).so: $(2)
|
|
endef
|
|
|
|
define module_a_template
|
|
$(1)=modules.link
|
|
modules.link: $(2)
|
|
endef
|
|
|
|
$(foreach mod,$(C_MODS),$(eval $(call module_o_template,$(mod),$(mod).o,$(mod).c)))
|
|
|
|
$(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_template,$(mod),$(mod).o)))
|
|
|
|
$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(CC_MODS)),$(eval $(call module_so_template,$(mod),$(mod).oo)))
|
|
|
|
$(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.link
|
|
__embed_ldscript:
|
|
@echo "../$(SUBDIR)/modules.link"
|
|
__embed_ldflags:
|
|
@echo "$(foreach mod,$(filter $(EMBEDDED_MODS),$(C_MODS)),$(foreach dep,$(MENUSELECT_DEPENDS_$(mod)),$(dep)_LDFLAGS))"
|
|
@echo "$(foreach mod,$(filter $(EMBEDDED_MODS),$(CC_MODS)),$(foreach dep,$(MENUSELECT_DEPENDS_$(mod)),$(dep)_LDFLAGS))"
|
|
__embed_libs:
|
|
@echo "$(foreach mod,$(filter $(EMBEDDED_MODS),$(C_MODS)),$(foreach dep,$(MENUSELECT_DEPENDS_$(mod)),$(dep)_LIB))"
|
|
@echo "$(foreach mod,$(filter $(EMBEDDED_MODS),$(CC_MODS)),$(foreach dep,$(MENUSELECT_DEPENDS_$(mod)),$(dep)_LIB))"
|
|
else
|
|
__embed_ldscript:
|
|
__embed_ldflags:
|
|
__embed_libs:
|
|
endif
|
|
|
|
modules.link:
|
|
@rm -f $@
|
|
@for file in $(patsubst $(ASTTOPDIR)/%,%,$(realpath $^)); do echo "INPUT (../$${file})" >> $@; done
|
|
|
|
clean-depend::
|
|
rm -f .depend
|
|
|
|
clean:: clean-depend
|
|
rm -f *.so *.o *.oo
|
|
rm -f modules.link
|
|
|
|
install:: all
|
|
for x in $(LOADABLE_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
|
|
|
|
uninstall::
|
|
|
|
ifneq ($(wildcard .depend),)
|
|
include .depend
|
|
endif
|
|
|
|
depend: .depend
|
|
|
|
.depend:
|
|
../build_tools/mkdep $(ASTCFLAGS) `ls *.c *.cc 2> /dev/null`
|