Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 777379 - Set .DEFAULT_GOAL unconditionally, override with OVERRID…
Browse files Browse the repository at this point in the history
…E_DEFAULT_GOAL, and fix pymake to be on par with GNU make when handling .DEFAULT_GOAL. r=gps
  • Loading branch information
glandium committed May 5, 2013
1 parent e0b3562 commit d731818
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion browser/installer/windows/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ else
PPL_LOCALE_ARGS=$(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer
endif

.DEFAULT_GOAL := installer
OVERRIDE_DEFAULT_GOAL := installer
installer::
$(MAKE) -C .. installer-stage
$(MAKE) $(CONFIG_DIR)/setup.exe
Expand Down
5 changes: 4 additions & 1 deletion build/pymake/pymake/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1670,8 +1670,11 @@ def foundtarget(self, t):
Inform the makefile of a target which is a candidate for being the default target,
if there isn't already a default target.
"""
if self.defaulttarget is None and t != '.PHONY':
flavor, source, value = self.variables.get('.DEFAULT_GOAL')
if self.defaulttarget is None and t != '.PHONY' and value is None:
self.defaulttarget = t
self.variables.set('.DEFAULT_GOAL', Variables.FLAVOR_SIMPLE,
Variables.SOURCE_AUTOMATIC, t)

def getpatternvariables(self, pattern):
assert isinstance(pattern, Pattern)
Expand Down
5 changes: 3 additions & 2 deletions build/pymake/tests/default-goal.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
not-default:
@echo TEST-FAIL
@echo TEST-FAIL did not run default rule

default:
@echo TEST-PASS
@echo $(if $(filter not-default,$(INTERMEDIATE_DEFAULT_GOAL)),TEST-PASS,TEST-FAIL .DEFAULT_GOAL not set by $(MAKE))

INTERMEDIATE_DEFAULT_GOAL := $(.DEFAULT_GOAL)
.DEFAULT_GOAL := default
2 changes: 1 addition & 1 deletion config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ default all:: $(PURGECACHES_FILES)
$(PURGECACHES_FILES):
if test -d $(@D) ; then touch $@ ; fi

.DEFAULT_GOAL ?= default
.DEFAULT_GOAL := $(or $(OVERRIDE_DEFAULT_GOAL),default)

#############################################################################
# Derived targets and dependencies
Expand Down
2 changes: 1 addition & 1 deletion js/src/config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ default all:: $(PURGECACHES_FILES)
$(PURGECACHES_FILES):
if test -d $(@D) ; then touch $@ ; fi

.DEFAULT_GOAL ?= default
.DEFAULT_GOAL := $(or $(OVERRIDE_DEFAULT_GOAL),default)

#############################################################################
# Derived targets and dependencies
Expand Down
2 changes: 1 addition & 1 deletion tools/update-packaging/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ endif
MAR_BIN = $(LIBXUL_DIST)/host/bin/mar$(HOST_BIN_SUFFIX)
MBSDIFF_BIN = $(LIBXUL_DIST)/host/bin/mbsdiff$(HOST_BIN_SUFFIX)

.DEFAULT_GOAL := full-update
OVERRIDE_DEFAULT_GOAL := full-update
full-update:: complete-patch

ifeq ($(OS_TARGET), WINNT)
Expand Down

0 comments on commit d731818

Please sign in to comment.