summaryrefslogtreecommitdiff
path: root/res/Makefile
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2012-09-07 20:53:48 +0000
committerDavid M. Lee <dlee@digium.com>2012-09-07 20:53:48 +0000
commitcab7acd21da199865281c8ac2cd508125842acd2 (patch)
tree62e7afc551c3acbeb9e482b6b2b2e07549b15166 /res/Makefile
parentdbdcee80f4b7652ed45367cd96e610761b8a136d (diff)
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
Diffstat (limited to 'res/Makefile')
-rw-r--r--res/Makefile13
1 files changed, 9 insertions, 4 deletions
diff --git a/res/Makefile b/res/Makefile
index bfbca76b3..6a83b6ca3 100644
--- a/res/Makefile
+++ b/res/Makefile
@@ -67,17 +67,22 @@ endif
ael/pval.o: ael/pval.c
clean::
+ $(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
+.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
-res_rtp_asterisk.o: pjproject/build.mak $(PJ_LIB_FILES)
+$(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)
-
-$(PJ_LIB_FILES):
- cd pjproject && make dep && make