diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-03-03 22:49:41 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-03-03 22:52:50 +0000 |
commit | 2b85372ca18115bb1d6363256fcea6f54e415bed (patch) | |
tree | 1ccbbac74ddbb89430cc07cbdedd9b48a5a44662 /rules/build-prog.mk | |
parent | 8640750e136f98767fc0678b35a20a6fb7970241 (diff) | |
download | haskell-2b85372ca18115bb1d6363256fcea6f54e415bed.tar.gz |
Automatically add the $(exeext) to program names
We now define _PROGNAME, and _PROG is automatically defined with
$(exeext). This will shortly automatically use the right exeext
depending on what stage it is being compiled with (exeext may be
different for different stages when cross-compiling).
Diffstat (limited to 'rules/build-prog.mk')
-rw-r--r-- | rules/build-prog.mk | 20 |
1 files changed, 12 insertions, 8 deletions
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 |