diff options
Diffstat (limited to 'rules')
-rw-r--r-- | rules/build-perl.mk | 12 | ||||
-rw-r--r-- | rules/build-prog.mk | 20 | ||||
-rw-r--r-- | rules/shell-wrapper.mk | 4 |
3 files changed, 25 insertions, 11 deletions
diff --git a/rules/build-perl.mk b/rules/build-perl.mk index 2c1908d356..157ed2b831 100644 --- a/rules/build-perl.mk +++ b/rules/build-perl.mk @@ -14,7 +14,7 @@ # Build a perl script. Invoke like this: # # driver/mangler_PERL_SRC = ghc-asm.lprl -# driver/mangler_dist_PROG = ghc-asm +# driver/mangler_dist_PROGNAME = ghc-asm # # $(eval $(call build-perl,driver/mangler,dist)) @@ -24,6 +24,15 @@ $(call profStart, build-perl($1,$2)) # $1 = dir # $2 = distdir +ifneq "$$(CLEANING)" "YES" +ifeq "$$($1_$2_PROGNAME)" "" +$$(error $1_$2_PROGNAME is not set) +endif +ifneq "$$($1_$2_PROG)" "" +$$(error $1_$2_PROG is set) +endif +$1_$2_PROG = $$($1_$2_PROGNAME) + ifneq "$$($$($1_$2_PROG)_INPLACE)" "" $$(error $$($1_$2_PROG)_INPLACE defined twice) endif @@ -32,6 +41,7 @@ $$($1_$2_PROG)_INPLACE = $$(INPLACE_TOPDIR)/$$($1_$2_PROG) else $$($1_$2_PROG)_INPLACE = $$(INPLACE_BIN)/$$($1_$2_PROG) endif +endif $1_$2_INPLACE = $$($$($1_$2_PROG)_INPLACE) diff --git a/rules/build-prog.mk b/rules/build-prog.mk index 4bf9ab09e4..597315983d 100644 --- a/rules/build-prog.mk +++ b/rules/build-prog.mk @@ -15,7 +15,7 @@ # # utils/genapply_MODULES = Main # utils/genapply_HC_OPTS = -package Cabal -# utils/genapply_dist_PROG = genapply +# utils/genapply_dist_PROGNAME = genapply # # $(eval $(call build-prog,utils/genapply,dist-install,1)) @@ -27,9 +27,13 @@ $(call profStart, build-prog($1,$2,$3)) # $3 = GHC stage to use (0 == bootstrapping compiler) ifneq "$$(CLEANING)" "YES" -ifeq "$$($1_$2_PROG)" "" -$$(error $1_$2_PROG is not set) +ifeq "$$($1_$2_PROGNAME)" "" +$$(error $1_$2_PROGNAME is not set) endif +ifneq "$$($1_$2_PROG)" "" +$$(error $1_$2_PROG is set) +endif +$1_$2_PROG = $$($1_$2_PROGNAME)$$(exeext) endif ifeq "$$(findstring $3,0 1 2)" "" @@ -88,20 +92,20 @@ $1_$2_INPLACE = endif else ifeq "$(findstring clean,$(MAKECMDGOALS))" "" -ifneq "$$($$($1_$2_PROG)_INPLACE)" "" -$$(error $$($1_$2_PROG)_INPLACE defined twice) +ifneq "$$($$($1_$2_PROGNAME)_INPLACE)" "" +$$(error $$($1_$2_PROGNAME)_INPLACE defined twice) endif endif ifeq "$$($1_$2_TOPDIR)" "YES" -$$($1_$2_PROG)_INPLACE = $$(INPLACE_TOPDIR)/$$($1_$2_PROG) +$$($1_$2_PROGNAME)_INPLACE = $$(INPLACE_TOPDIR)/$$($1_$2_PROG) else -$$($1_$2_PROG)_INPLACE = $$(INPLACE_BIN)/$$($1_$2_PROG) +$$($1_$2_PROGNAME)_INPLACE = $$(INPLACE_BIN)/$$($1_$2_PROG) endif # Where do we install the inplace version? ifeq "$$($1_$2_WANT_INPLACE_WRAPPER)" "YES" $1_$2_INPLACE = $$(INPLACE_LIB)/bin/$$($1_$2_PROG) else -$1_$2_INPLACE = $$($$($1_$2_PROG)_INPLACE) +$1_$2_INPLACE = $$($$($1_$2_PROGNAME)_INPLACE) endif endif diff --git a/rules/shell-wrapper.mk b/rules/shell-wrapper.mk index 450c989e87..687c408348 100644 --- a/rules/shell-wrapper.mk +++ b/rules/shell-wrapper.mk @@ -17,7 +17,7 @@ $(call profStart, shell-wrapper($1,$2)) # $2 = distdir ifeq "$$($1_$2_SHELL_WRAPPER_NAME)" "" -$1_$2_SHELL_WRAPPER_NAME = $1/$$($1_$2_PROG).wrapper +$1_$2_SHELL_WRAPPER_NAME = $1/$$($1_$2_PROGNAME).wrapper endif ifeq "$$($1_$2_WANT_INPLACE_WRAPPER)" "YES" @@ -90,7 +90,7 @@ endif ifeq "$$($1_$2_WANT_BINDIST_WRAPPER)" "YES" -$1_$2_BINDIST_WRAPPER = $1/$2/build/tmp/$$($1_$2_PROG)-bindist +$1_$2_BINDIST_WRAPPER = $1/$2/build/tmp/$$($1_$2_PROGNAME)-bindist all_$1_$2 : $$($1_$2_BINDIST_WRAPPER) |