Skip to content
Snippets Groups Projects
Commit 5387ac44 authored by Jason Parker's avatar Jason Parker
Browse files

Don't unnecessarily rebuild things on every run of 'make'.

Review: https://reviewboard.asterisk.org/r/2449/
........

Merged revisions 385745 from http://svn.asterisk.org/svn/asterisk/branches/1.8


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@385768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 918addee
No related branches found
No related tags found
No related merge requests found
......@@ -360,7 +360,7 @@ makeopts.embed_rules: menuselect.makeopts
+@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LDFLAGS)
+@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LIBS)
$(SUBDIRS): makeopts cleantest main/version.c include/asterisk/build.h include/asterisk/buildopts.h defaults.h makeopts.embed_rules
$(SUBDIRS): makeopts .lastclean main/version.c include/asterisk/build.h include/asterisk/buildopts.h defaults.h makeopts.embed_rules
ifeq ($(findstring $(OSARCH), mingw32 cygwin ),)
# Non-windows:
......@@ -386,26 +386,25 @@ $(MOD_SUBDIRS): makeopts
$(OTHER_SUBDIRS): makeopts
+@_ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
defaults.h: makeopts cleantest build_tools/make_defaults_h
defaults.h: makeopts .lastclean build_tools/make_defaults_h
@build_tools/make_defaults_h > $@.tmp
@cmp -s $@.tmp $@ || mv $@.tmp $@
@rm -f $@.tmp
main/version.c: FORCE cleantest
main/version.c: FORCE .lastclean
@build_tools/make_version_c > $@.tmp
@cmp -s $@.tmp $@ || mv $@.tmp $@
@rm -f $@.tmp
include/asterisk/buildopts.h: menuselect.makeopts cleantest
include/asterisk/buildopts.h: menuselect.makeopts .lastclean
@build_tools/make_buildopts_h > $@.tmp
@cmp -s $@.tmp $@ || mv $@.tmp $@
@rm -f $@.tmp
# build.h must depend on cleantest, or parallel make may wipe it out after it's
# been created. But since build.h contains a timestamp, the cmp trick used above
# won't work. Just testing for existence is good enough.
include/asterisk/build.h: cleantest
@test -f $@ || build_tools/make_build_h > $@
# build.h must depend on .lastclean, or parallel make may wipe it out after it's
# been created.
include/asterisk/build.h: .lastclean
@build_tools/make_build_h > $@
$(SUBDIRS_CLEAN):
+@$(SUBMAKE) -C $(@:-clean=) clean
......@@ -459,7 +458,7 @@ datafiles: _all doc/core-en_US.xml
done
$(MAKE) -C sounds install
doc/core-en_US.xml: makeopts cleantest $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
doc/core-en_US.xml: makeopts .lastclean $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
@printf "Building Documentation For: "
@echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $@
@echo "<!DOCTYPE docs SYSTEM \"appdocsxml.dtd\">" >> $@
......@@ -473,7 +472,7 @@ doc/core-en_US.xml: makeopts cleantest $(foreach dir,$(MOD_SUBDIRS),$(shell $(GR
@echo
@echo "</docs>" >> $@
doc/full-en_US.xml: makeopts cleantest $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
doc/full-en_US.xml: makeopts .lastclean $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
ifeq ($(PYTHON),:)
@echo "--------------------------------------------------------------------------"
@echo "--- Please install python to build full documentation ---"
......@@ -823,8 +822,8 @@ sounds:
# .cleancount is the global clean count, and .lastclean is the
# last clean count we had
cleantest:
@cmp -s .cleancount .lastclean || $(MAKE) clean
.lastclean: .cleancount
@$(MAKE) clean
@[ -f "$(DESTDIR)$(ASTDBDIR)/astdb.sqlite3" ] || [ ! -f "$(DESTDIR)$(ASTDBDIR)/astdb" ] || [ ! -f menuselect.makeopts ] || grep -q MENUSELECT_UTILS=.*astdb2sqlite3 menuselect.makeopts || (sed -i.orig -e's/MENUSELECT_UTILS=\(.*\)/MENUSELECT_UTILS=\1 astdb2sqlite3/' menuselect.makeopts && echo "Updating menuselect.makeopts to include astdb2sqlite3" && echo "Original version backed up to menuselect.makeopts.orig")
$(SUBDIRS_UNINSTALL):
......@@ -902,19 +901,19 @@ MAKE_MENUSELECT=CC="$(BUILD_CC)" CXX="" LD="" AR="" RANLIB="" \
CFLAGS="$(BUILD_CFLAGS)" LDFLAGS="$(BUILD_LDFLAGS)" \
$(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
menuselect/menuselect: menuselect/makeopts cleantest
menuselect/menuselect: menuselect/makeopts .lastclean
+$(MAKE_MENUSELECT) menuselect
menuselect/cmenuselect: menuselect/makeopts cleantest
menuselect/cmenuselect: menuselect/makeopts .lastclean
+$(MAKE_MENUSELECT) cmenuselect
menuselect/gmenuselect: menuselect/makeopts cleantest
menuselect/gmenuselect: menuselect/makeopts .lastclean
+$(MAKE_MENUSELECT) gmenuselect
menuselect/nmenuselect: menuselect/makeopts cleantest
menuselect/nmenuselect: menuselect/makeopts .lastclean
+$(MAKE_MENUSELECT) nmenuselect
menuselect/makeopts: makeopts cleantest
menuselect/makeopts: makeopts .lastclean
+$(MAKE_MENUSELECT) makeopts
menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml build_tools/cflags-devmode.xml sounds/sounds.xml build_tools/embed_modules.xml utils/utils.xml agi/agi.xml configure makeopts
......@@ -945,7 +944,6 @@ menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(di
.PHONY: full
.PHONY: _full
.PHONY: prereqs
.PHONY: cleantest
.PHONY: uninstall
.PHONY: _uninstall
.PHONY: uninstall-all
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment