asterisk/res/Makefile

89 lines
2.9 KiB
Makefile
Raw Normal View History

#
# Asterisk -- A telephony toolkit for Linux.
#
# Makefile for resource modules
#
# Copyright (C) 1999-2006, Digium, Inc.
#
# This program is free software, distributed under the terms of
# the GNU General Public License
#
-include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps
Merged revisions 93180 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r93180 | kpfleming | 2007-12-16 22:44:51 -0800 (Sun, 16 Dec 2007) | 23 lines In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html, rizzo brought up some issues related to the way that the metadata required for menuselect and the rest of the build system is extracted from the source files. Since I had a few hours to kill on an airplane today, I decided to improve this situation... so now the system caches the extracted metadata and uses it to build the menuselect 'tree' as much as it can. The result of this is that when a single source file is changed, only the metadata for that file needs to be extracted again, and the rest is used from the cache files. I also reduced the number of forked processes required to do the metadata extraction; it was actually possible to do most of what we needed in the Makefiles themselves without using any shell scripts at all! On my laptop, these changes resulted in an 80% decrease in the time required for the 'menuselect.makeopts' automatic check to occur after editing a single source file. While doing this work I also cleaned up a few minor things in the Makefiles, adding a check for 'awk' to the configure script and changed all remaining places we use 'grep' or 'awk' to use the ones found by the configure script, and changed the 'prep_tarball' script to build the menuselect metadata so that tarballs of Asterisk will include it and won't require the user to wait while it is extracted after unpacking. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:25:35 +00:00
MODULE_PREFIX=res
MENUSELECT_CATEGORY=RES
MENUSELECT_DESCRIPTION=Resource Modules
all: _all
include $(ASTTOPDIR)/Makefile.moddir_rules
ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
# cygwin has some dependencies among res_ things.
# We use order-only dependencies, and then add the libraries as required.
res_agi.so: | res_speech.so
res_agi.so_LIBS:= -lres_speech.so
endif
res_config_ldap.o: _ASTCFLAGS+=-DLDAP_DEPRECATED
ael/ael_lex.o: ael/ael_lex.c ../include/asterisk/ael_structs.h ael/ael.tab.h
ael/ael_lex.o: _ASTCFLAGS+=-I. -Iael -Wno-unused
ael/ael.tab.o: ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h
ael/ael.tab.o: _ASTCFLAGS+=-I. -Iael -DYYENABLE_NLS=0
$(if $(filter res_ais,$(EMBEDDED_MODS)),modules.link,res_ais.so): ais/clm.o ais/evt.o
ais/clm.o ais/evt.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ais)
$(if $(filter res_snmp,$(EMBEDDED_MODS)),modules.link,res_snmp.so): snmp/agent.o
snmp/agent.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_snmp)
$(if $(filter res_ael_share,$(EMBEDDED_MODS)),modules.link,res_ael_share.so): ael/ael_lex.o ael/ael.tab.o ael/pval.o
ael/ael_lex.o ael/ael.tab.o ael/pval.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ael_share)
ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),)
ael/ael_lex.c: ael/ael.flex
else
ael/ael_lex.c:
endif
$(ECHO_PREFIX) echo " [FLEX] $< -> $@"
$(CMD_PREFIX) (cd ael; $(FLEX) ael.flex)
$(CMD_PREFIX) sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' $@ > $@.fix
$(CMD_PREFIX) echo "#include \"asterisk.h\"" > $@
$(CMD_PREFIX) echo >> $@
$(CMD_PREFIX) cat $@.fix >> $@
$(CMD_PREFIX) rm $@.fix
ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),)
ael/ael.tab.c ael/ael.tab.h: ael/ael.y
else
ael/ael.tab.c ael/ael.tab.h:
endif
$(ECHO_PREFIX) echo " [BISON] $< -> $@"
$(CMD_PREFIX) (cd ael; $(BISON) -v -d ael.y)
ael/pval.o: ael/pval.c
clean::
Fix parallel make for res_asterisk_rtp. Fixes a build regression introduced in r369517 "Add support for ICE/STUN/TURN in res_rtp_asterisk and chan_sip." [1]. [1] http://svnview.digium.com/svn/asterisk?view=revision&revision=369517 When compiling asterisk in parallel like: $ make -j 10 It's possible to get errors like the following: .pjlib-util-test-x86_64-unknown-linux-gnu.depend:120: *** missing separator. Stop. make[4]: *** [depend] Error 2 make[3]: *** [dep] Error 1 make[2]: *** [/home/sruffell/asterisk-working/res/pjproject/pjnath/lib/libpjnath-x86_64-unknown-linux-gnu.a] Error 2 make[3]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. This is because the build system is trying to build each of the libraries in pjproject in parallel. Now the build will build pjproject in a single job and link the results into res_asterisk_rtp. Parallel builds, on one test system, saves ~1.5 minutes from a default Asterisk build: Single job: $ git clean -fdx >/dev/null && time ( ./configure >/dev/null 2>&1 && make >/dev/null 2>&1 ) real 2m34.529s user 1m41.810s sys 0m15.970s Parallel make: $ git clean -fdx >/dev/null && time ( ./configure >/dev/null 2>&1 && make -j10 >/dev/null 2>&1 ) real 1m2.353s user 2m39.120s sys 0m18.850s (closes issue ASTERISK-20362) Reported by: Shaun Ruffel Patches: 0001-res_asterisk_rtp-Fix-build-error-when-using-parallel.patch uploaded by Shaun Ruffel (License #5417) ........ Merged revisions 372609 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-07 20:53:48 +00:00
$(MAKE) -C pjproject realclean
rm -f snmp/*.o snmp/*.i ael/*.o ael/*.i ais/*.o ais/*.i
pjproject/build.mak:
cd pjproject && ./configure AR="" CFLAGS=-fPIC --disable-floating-point --disable-sound --disable-oss --disable-speex-aec --disable-l16-codec --disable-gsm-codec --disable-g722-codec --disable-g7221-codec --disable-speex-codec --disable-ilbc-codec --disable-g711-codec
Fix parallel make for res_asterisk_rtp. Fixes a build regression introduced in r369517 "Add support for ICE/STUN/TURN in res_rtp_asterisk and chan_sip." [1]. [1] http://svnview.digium.com/svn/asterisk?view=revision&revision=369517 When compiling asterisk in parallel like: $ make -j 10 It's possible to get errors like the following: .pjlib-util-test-x86_64-unknown-linux-gnu.depend:120: *** missing separator. Stop. make[4]: *** [depend] Error 2 make[3]: *** [dep] Error 1 make[2]: *** [/home/sruffell/asterisk-working/res/pjproject/pjnath/lib/libpjnath-x86_64-unknown-linux-gnu.a] Error 2 make[3]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. This is because the build system is trying to build each of the libraries in pjproject in parallel. Now the build will build pjproject in a single job and link the results into res_asterisk_rtp. Parallel builds, on one test system, saves ~1.5 minutes from a default Asterisk build: Single job: $ git clean -fdx >/dev/null && time ( ./configure >/dev/null 2>&1 && make >/dev/null 2>&1 ) real 2m34.529s user 1m41.810s sys 0m15.970s Parallel make: $ git clean -fdx >/dev/null && time ( ./configure >/dev/null 2>&1 && make -j10 >/dev/null 2>&1 ) real 1m2.353s user 2m39.120s sys 0m18.850s (closes issue ASTERISK-20362) Reported by: Shaun Ruffel Patches: 0001-res_asterisk_rtp-Fix-build-error-when-using-parallel.patch uploaded by Shaun Ruffel (License #5417) ........ Merged revisions 372609 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-07 20:53:48 +00:00
.PHONY : pjproject
pjproject: pjproject/build.mak
# Make sure we always build pjproject with a single job.
$(MAKE) -j1 -C pjproject dep
$(MAKE) -j1 -C pjproject
include pjproject/build.mak
Fix parallel make for res_asterisk_rtp. Fixes a build regression introduced in r369517 "Add support for ICE/STUN/TURN in res_rtp_asterisk and chan_sip." [1]. [1] http://svnview.digium.com/svn/asterisk?view=revision&revision=369517 When compiling asterisk in parallel like: $ make -j 10 It's possible to get errors like the following: .pjlib-util-test-x86_64-unknown-linux-gnu.depend:120: *** missing separator. Stop. make[4]: *** [depend] Error 2 make[3]: *** [dep] Error 1 make[2]: *** [/home/sruffell/asterisk-working/res/pjproject/pjnath/lib/libpjnath-x86_64-unknown-linux-gnu.a] Error 2 make[3]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. This is because the build system is trying to build each of the libraries in pjproject in parallel. Now the build will build pjproject in a single job and link the results into res_asterisk_rtp. Parallel builds, on one test system, saves ~1.5 minutes from a default Asterisk build: Single job: $ git clean -fdx >/dev/null && time ( ./configure >/dev/null 2>&1 && make >/dev/null 2>&1 ) real 2m34.529s user 1m41.810s sys 0m15.970s Parallel make: $ git clean -fdx >/dev/null && time ( ./configure >/dev/null 2>&1 && make -j10 >/dev/null 2>&1 ) real 1m2.353s user 2m39.120s sys 0m18.850s (closes issue ASTERISK-20362) Reported by: Shaun Ruffel Patches: 0001-res_asterisk_rtp-Fix-build-error-when-using-parallel.patch uploaded by Shaun Ruffel (License #5417) ........ Merged revisions 372609 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-07 20:53:48 +00:00
$(PJ_LIB_FILES): pjproject
res_rtp_asterisk.o: $(PJ_LIB_FILES)
res_rtp_asterisk.o: _ASTCFLAGS+=$(PJ_CFLAGS)
res_rtp_asterisk.so: _ASTLDFLAGS+=$(PJ_LDFLAGS)
res_rtp_asterisk.so: LIBS+=$(PJ_LDLIBS)