diff --git a/Makefile.in b/Makefile.in index 1a6f004d5c1..ee1da71bde9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -205,6 +205,21 @@ codesighs: # defined in package-name.mk export MOZ_SOURCE_STAMP +#XXX: this is a hack, since we don't want to clobber for MSVC +# PGO support, but we can't do this test in client.mk +ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_) +# No point in clobbering if PGO has been explicitly disabled. +ifndef NO_PROFILE_GUIDED_OPTIMIZE +maybe_clobber_profiledbuild: clean +else +maybe_clobber_profiledbuild: +endif +else +maybe_clobber_profiledbuild: +endif + +.PHONY: maybe_clobber_profiledbuild + # Look for R_386_PC32 relocations in shared libs, these # break x86_64 builds and SELinux users. ifeq ($(OS_TARGET)_$(TARGET_XPCOM_ABI),Linux_x86-gcc3) diff --git a/client.mk b/client.mk index 0e22371c63b..ad6f4b09a1e 100644 --- a/client.mk +++ b/client.mk @@ -212,6 +212,7 @@ profiledbuild:: $(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_GENERATE=1 $(MAKE) -C $(PGO_OBJDIR) package OBJDIR=${PGO_OBJDIR} JARLOG_DIR=${PGO_OBJDIR}/jarlog/en-US $(PROFILE_GEN_SCRIPT) + $(MAKE) -f $(TOPSRCDIR)/client.mk maybe_clobber_profiledbuild $(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_USE=1 ##################################################### @@ -253,7 +254,7 @@ endif # loop through them. ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_BUILD_PROJECTS),,1)) -configure depend realbuild install export libs clean realclean distclean alldep preflight postflight upload sdk:: +configure depend realbuild install export libs clean realclean distclean alldep preflight postflight maybe_clobber_profiledbuild upload sdk:: set -e; \ for app in $(MOZ_BUILD_PROJECTS); do \ $(MAKE) -f $(TOPSRCDIR)/client.mk $@ MOZ_CURRENT_PROJECT=$$app; \ @@ -353,7 +354,7 @@ realbuild:: $(OBJDIR)/Makefile $(OBJDIR)/config.status # Other targets # Pass these target onto the real build system -install export libs clean realclean distclean alldep upload sdk:: $(OBJDIR)/Makefile $(OBJDIR)/config.status +install export libs clean realclean distclean alldep maybe_clobber_profiledbuild upload sdk:: $(OBJDIR)/Makefile $(OBJDIR)/config.status $(MOZ_MAKE) $@ #################################### @@ -412,4 +413,4 @@ echo-variable-%: # in parallel. .NOTPARALLEL: -.PHONY: checkout real_checkout depend realbuild build profiledbuild export libs alldep install clean realclean distclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all everything configure preflight_all preflight postflight postflight_all upload sdk +.PHONY: checkout real_checkout depend realbuild build profiledbuild maybe_clobber_profiledbuild export libs alldep install clean realclean distclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all everything configure preflight_all preflight postflight postflight_all upload sdk diff --git a/config/rules.mk b/config/rules.mk index 29078c9ad1e..726368514ec 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -815,9 +815,6 @@ ifdef SHARED_LIBRARY $(SHARED_LIBRARY_NAME) $(DIST)/$(MOZ_APP_NAME) endif endif # SHARED_LIBRARY || PROGRAM -else # ! WINNT_ -# Force rebuilding all objects on the second pass -$(OBJS): FORCE endif # WINNT_ endif # MOZ_PROFILE_USE ifdef MOZ_PROFILE_GENERATE diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk index 29078c9ad1e..726368514ec 100644 --- a/js/src/config/rules.mk +++ b/js/src/config/rules.mk @@ -815,9 +815,6 @@ ifdef SHARED_LIBRARY $(SHARED_LIBRARY_NAME) $(DIST)/$(MOZ_APP_NAME) endif endif # SHARED_LIBRARY || PROGRAM -else # ! WINNT_ -# Force rebuilding all objects on the second pass -$(OBJS): FORCE endif # WINNT_ endif # MOZ_PROFILE_USE ifdef MOZ_PROFILE_GENERATE