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 | |
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).
-rw-r--r-- | driver/ghc/ghc.mk | 2 | ||||
-rw-r--r-- | driver/ghci/ghc.mk | 2 | ||||
-rw-r--r-- | driver/haddock/ghc.mk | 2 | ||||
-rw-r--r-- | driver/split/ghc.mk | 2 | ||||
-rw-r--r-- | ghc/ghc.mk | 6 | ||||
-rw-r--r-- | rules/build-perl.mk | 12 | ||||
-rw-r--r-- | rules/build-prog.mk | 20 | ||||
-rw-r--r-- | rules/shell-wrapper.mk | 4 | ||||
-rw-r--r-- | utils/compare_sizes/ghc.mk | 2 | ||||
-rw-r--r-- | utils/count_lines/ghc.mk | 2 | ||||
-rw-r--r-- | utils/deriveConstants/ghc.mk | 2 | ||||
-rw-r--r-- | utils/genapply/ghc.mk | 2 | ||||
-rw-r--r-- | utils/genprimopcode/ghc.mk | 2 | ||||
-rw-r--r-- | utils/ghc-cabal/ghc.mk | 2 | ||||
-rw-r--r-- | utils/ghc-pkg/ghc.mk | 6 | ||||
-rw-r--r-- | utils/ghc-pwd/ghc.mk | 2 | ||||
-rw-r--r-- | utils/ghctags/ghc.mk | 2 | ||||
-rw-r--r-- | utils/hp2ps/ghc.mk | 2 | ||||
-rw-r--r-- | utils/hpc/ghc.mk | 2 | ||||
-rw-r--r-- | utils/mkUserGuidePart/ghc.mk | 2 | ||||
-rw-r--r-- | utils/runghc/ghc.mk | 2 | ||||
-rw-r--r-- | utils/touchy/ghc.mk | 2 | ||||
-rw-r--r-- | utils/unlit/ghc.mk | 2 |
23 files changed, 48 insertions, 36 deletions
diff --git a/driver/ghc/ghc.mk b/driver/ghc/ghc.mk index dee9d5715c..31df04a988 100644 --- a/driver/ghc/ghc.mk +++ b/driver/ghc/ghc.mk @@ -14,7 +14,7 @@ ifeq "$(Windows_Host)" "YES" driver/ghc_dist_C_SRCS = ghc.c ../utils/cwrapper.c ../utils/getLocation.c driver/ghc_dist_CC_OPTS += -I driver/utils -driver/ghc_dist_PROG = ghc-$(ProjectVersion) +driver/ghc_dist_PROGNAME = ghc-$(ProjectVersion) driver/ghc_dist_INSTALL = YES driver/ghc_dist_INSTALL_INPLACE = NO diff --git a/driver/ghci/ghc.mk b/driver/ghci/ghc.mk index c231347c0b..736b7a927d 100644 --- a/driver/ghci/ghc.mk +++ b/driver/ghci/ghc.mk @@ -31,7 +31,7 @@ else # Windows_Host... driver/ghci_dist_C_SRCS = ghci.c ../utils/cwrapper.c ../utils/getLocation.c driver/ghci_dist_CC_OPTS += -I driver/utils -driver/ghci_dist_PROG = ghci$(exeext) +driver/ghci_dist_PROGNAME = ghci driver/ghci_dist_INSTALL = YES driver/ghci_dist_INSTALL_INPLACE = YES driver/ghci_dist_OTHER_OBJS = driver/ghci/ghci.res diff --git a/driver/haddock/ghc.mk b/driver/haddock/ghc.mk index 06a6cecc30..3fe7174353 100644 --- a/driver/haddock/ghc.mk +++ b/driver/haddock/ghc.mk @@ -14,7 +14,7 @@ ifeq "$(Windows_Host)" "YES" driver/haddock_dist_C_SRCS = haddock.c ../utils/cwrapper.c ../utils/getLocation.c driver/haddock_dist_CC_OPTS += -I driver/utils -driver/haddock_dist_PROG = haddock-$(ProjectVersion) +driver/haddock_dist_PROGNAME = haddock-$(ProjectVersion) driver/haddock_dist_INSTALL = YES driver/haddock_dist_INSTALL_INPLACE = NO diff --git a/driver/split/ghc.mk b/driver/split/ghc.mk index 9ee4cd604e..461dd5ac62 100644 --- a/driver/split/ghc.mk +++ b/driver/split/ghc.mk @@ -11,7 +11,7 @@ # ----------------------------------------------------------------------------- driver/split_PERL_SRC = ghc-split.lprl -driver/split_dist_PROG = ghc-split +driver/split_dist_PROGNAME = ghc-split driver/split_dist_TOPDIR = YES driver/split_dist_INSTALL = YES driver/split_dist_INSTALL_INPLACE = YES diff --git a/ghc/ghc.mk b/ghc/ghc.mk index 3466b51e6f..44dd126d37 100644 --- a/ghc/ghc.mk +++ b/ghc/ghc.mk @@ -72,9 +72,9 @@ ifeq "$(GhcProfiled)" "YES" ghc_stage2_PROGRAM_WAY = p endif -ghc_stage1_PROG = ghc-stage1$(exeext) -ghc_stage2_PROG = ghc-stage2$(exeext) -ghc_stage3_PROG = ghc-stage3$(exeext) +ghc_stage1_PROGNAME = ghc-stage1 +ghc_stage2_PROGNAME = ghc-stage2 +ghc_stage3_PROGNAME = ghc-stage3 ghc_stage1_SHELL_WRAPPER = YES ghc_stage2_SHELL_WRAPPER = YES 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) diff --git a/utils/compare_sizes/ghc.mk b/utils/compare_sizes/ghc.mk index 7a7142c19b..d659a5e6d8 100644 --- a/utils/compare_sizes/ghc.mk +++ b/utils/compare_sizes/ghc.mk @@ -2,7 +2,7 @@ utils/compare_sizes_USES_CABAL = YES utils/compare_sizes_PACKAGE = compareSizes utils/compare_sizes_MODULES = Main -utils/compare_sizes_dist-install_PROG = compareSizes$(exeext) +utils/compare_sizes_dist-install_PROGNAME = compareSizes utils/compare_sizes_dist-install_INSTALL_INPLACE = NO $(eval $(call build-prog,utils/compare_sizes,dist-install,1)) diff --git a/utils/count_lines/ghc.mk b/utils/count_lines/ghc.mk index c467413381..4f3f43e77a 100644 --- a/utils/count_lines/ghc.mk +++ b/utils/count_lines/ghc.mk @@ -1,5 +1,5 @@ utils/count_lines_PERL_SRC = count_lines.lprl -utils/count_lines_dist_PROG = count_lines +utils/count_lines_dist_PROGNAME = count_lines $(eval $(call build-perl,utils/count_lines,dist)) diff --git a/utils/deriveConstants/ghc.mk b/utils/deriveConstants/ghc.mk index f181077080..525a936960 100644 --- a/utils/deriveConstants/ghc.mk +++ b/utils/deriveConstants/ghc.mk @@ -11,7 +11,7 @@ # ----------------------------------------------------------------------------- utils/deriveConstants_dist_MODULES = DeriveConstants -utils/deriveConstants_dist_PROG = deriveConstants$(exeext) +utils/deriveConstants_dist_PROGNAME = deriveConstants utils/deriveConstants_dist_INSTALL_INPLACE = YES utils/deriveConstants_HC_OPTS += -package process -package containers diff --git a/utils/genapply/ghc.mk b/utils/genapply/ghc.mk index cd42cb4e34..14b003c042 100644 --- a/utils/genapply/ghc.mk +++ b/utils/genapply/ghc.mk @@ -11,7 +11,7 @@ # ----------------------------------------------------------------------------- utils/genapply_dist_MODULES = GenApply -utils/genapply_dist_PROG = genapply$(exeext) +utils/genapply_dist_PROGNAME = genapply utils/genapply_dist_INSTALL_INPLACE = YES utils/genapply_HC_OPTS += -package pretty diff --git a/utils/genprimopcode/ghc.mk b/utils/genprimopcode/ghc.mk index b4fb6c01de..01229ce0dd 100644 --- a/utils/genprimopcode/ghc.mk +++ b/utils/genprimopcode/ghc.mk @@ -11,7 +11,7 @@ # ----------------------------------------------------------------------------- utils/genprimopcode_dist_MODULES = Lexer Main ParserM Parser Syntax -utils/genprimopcode_dist_PROG = genprimopcode$(exeext) +utils/genprimopcode_dist_PROGNAME = genprimopcode utils/genprimopcode_dist_HC_OPTS = -package array utils/genprimopcode_dist_INSTALL_INPLACE = YES diff --git a/utils/ghc-cabal/ghc.mk b/utils/ghc-cabal/ghc.mk index 5835749d9f..c80c4ef7ef 100644 --- a/utils/ghc-cabal/ghc.mk +++ b/utils/ghc-cabal/ghc.mk @@ -57,7 +57,7 @@ $(eval $(call all-target,utils/ghc-cabal,$(ghc-cabal_INPLACE))) utils/ghc-cabal_USES_CABAL = YES utils/ghc-cabal_PACKAGE = ghc-cabal -utils/ghc-cabal_dist-install_PROG = ghc-cabal$(exeext) +utils/ghc-cabal_dist-install_PROGNAME = ghc-cabal utils/ghc-cabal_dist-install_INSTALL_INPLACE = NO utils/ghc-cabal_dist-install_WANT_BINDIST_WRAPPER = YES utils/ghc-cabal_dist-install_MODULES = Main diff --git a/utils/ghc-pkg/ghc.mk b/utils/ghc-pkg/ghc.mk index 4464ba1cde..51c3cb4c36 100644 --- a/utils/ghc-pkg/ghc.mk +++ b/utils/ghc-pkg/ghc.mk @@ -34,14 +34,12 @@ utils/ghc-pkg_dist_SHELL_WRAPPER = YES utils/ghc-pkg_dist_INSTALL_SHELL_WRAPPER_NAME = ghc-pkg-$(ProjectVersion) utils/ghc-pkg_dist_WANT_INSTALLED_WRAPPER = YES -INSTALL_LIBEXECS += utils/ghc-pkg/dist/build/tmp/$(utils/ghc-pkg_dist_PROG) - $(eval $(call shell-wrapper,utils/ghc-pkg,dist)) endif utils/ghc-pkg_dist_USES_CABAL = YES -utils/ghc-pkg_dist_PROG = ghc-pkg$(exeext) +utils/ghc-pkg_dist_PROGNAME = ghc-pkg utils/ghc-pkg_dist_SHELL_WRAPPER = YES utils/ghc-pkg_dist_INSTALL_INPLACE = YES @@ -59,7 +57,7 @@ ifneq "$(Stage1Only)" "YES" utils/ghc-pkg_dist-install_USES_CABAL = YES -utils/ghc-pkg_dist-install_PROG = ghc-pkg +utils/ghc-pkg_dist-install_PROGNAME = ghc-pkg utils/ghc-pkg_dist-install_SHELL_WRAPPER = YES utils/ghc-pkg_dist-install_INSTALL = YES utils/ghc-pkg_dist-install_INSTALL_SHELL_WRAPPER_NAME = ghc-pkg-$(ProjectVersion) diff --git a/utils/ghc-pwd/ghc.mk b/utils/ghc-pwd/ghc.mk index e9c0d4aff4..ac6bc768f6 100644 --- a/utils/ghc-pwd/ghc.mk +++ b/utils/ghc-pwd/ghc.mk @@ -3,7 +3,7 @@ utils/ghc-pwd_USES_CABAL = YES utils/ghc-pwd_PACKAGE = ghc-pwd utils/ghc-pwd_dist-install_INSTALL_INPLACE = YES utils/ghc-pwd_dist-install_WANT_BINDIST_WRAPPER = YES -utils/ghc-pwd_dist-install_PROG = ghc-pwd$(exeext) +utils/ghc-pwd_dist-install_PROGNAME = ghc-pwd $(eval $(call build-prog,utils/ghc-pwd,dist-install,1)) diff --git a/utils/ghctags/ghc.mk b/utils/ghctags/ghc.mk index 949a05174b..07ab41e9f5 100644 --- a/utils/ghctags/ghc.mk +++ b/utils/ghctags/ghc.mk @@ -12,7 +12,7 @@ utils/ghctags_USES_CABAL = YES utils/ghctags_PACKAGE = ghctags -utils/ghctags_dist-install_PROG = ghctags$(exeext) +utils/ghctags_dist-install_PROGNAME = ghctags utils/ghctags_dist-install_INSTALL = NO utils/ghctags_dist-install_INSTALL_INPLACE = YES $(eval $(call build-prog,utils/ghctags,dist-install,2)) diff --git a/utils/hp2ps/ghc.mk b/utils/hp2ps/ghc.mk index 097f912dcb..00923d3d78 100644 --- a/utils/hp2ps/ghc.mk +++ b/utils/hp2ps/ghc.mk @@ -16,7 +16,7 @@ utils/hp2ps_dist_C_SRCS = AreaBelow.c Curves.c Error.c Main.c \ Axes.c Dimensions.c Key.c PsFile.c Shade.c \ Utilities.c utils/hp2ps_dist_EXTRA_LIBRARIES = m -utils/hp2ps_dist_PROG = $(CrossCompilePrefix)hp2ps$(exeext) +utils/hp2ps_dist_PROGNAME = $(CrossCompilePrefix)hp2ps utils/hp2ps_dist_INSTALL = YES utils/hp2ps_dist_INSTALL_INPLACE = YES diff --git a/utils/hpc/ghc.mk b/utils/hpc/ghc.mk index 917e099ef8..60c13d411e 100644 --- a/utils/hpc/ghc.mk +++ b/utils/hpc/ghc.mk @@ -14,5 +14,5 @@ utils/hpc_USES_CABAL = YES utils/hpc_PACKAGE = hpc-bin utils/hpc_dist-install_INSTALL = YES utils/hpc_dist-install_INSTALL_INPLACE = YES -utils/hpc_dist-install_PROG = hpc$(exeext) +utils/hpc_dist-install_PROGNAME = hpc $(eval $(call build-prog,utils/hpc,dist-install,1)) diff --git a/utils/mkUserGuidePart/ghc.mk b/utils/mkUserGuidePart/ghc.mk index ae305f9139..aabe69ae4e 100644 --- a/utils/mkUserGuidePart/ghc.mk +++ b/utils/mkUserGuidePart/ghc.mk @@ -12,7 +12,7 @@ utils/mkUserGuidePart_USES_CABAL = YES utils/mkUserGuidePart_PACKAGE = mkUserGuidePart -utils/mkUserGuidePart_dist_PROG = mkUserGuidePart$(exeext) +utils/mkUserGuidePart_dist_PROGNAME = mkUserGuidePart utils/mkUserGuidePart_dist_INSTALL_INPLACE = YES $(eval $(call build-prog,utils/mkUserGuidePart,dist,1)) diff --git a/utils/runghc/ghc.mk b/utils/runghc/ghc.mk index a181938f3b..cde8102312 100644 --- a/utils/runghc/ghc.mk +++ b/utils/runghc/ghc.mk @@ -12,7 +12,7 @@ utils/runghc_PACKAGE = runghc utils/runghc_dist-install_USES_CABAL = YES -utils/runghc_dist-install_PROG = runghc$(exeext) +utils/runghc_dist-install_PROGNAME = runghc utils/runghc_dist-install_SHELL_WRAPPER = YES utils/runghc_dist-install_INSTALL = YES utils/runghc_dist-install_INSTALL_INPLACE = YES diff --git a/utils/touchy/ghc.mk b/utils/touchy/ghc.mk index 8c316ba993..b2911aaaa6 100644 --- a/utils/touchy/ghc.mk +++ b/utils/touchy/ghc.mk @@ -11,7 +11,7 @@ # ----------------------------------------------------------------------------- utils/touchy_dist_C_SRCS = touchy.c -utils/touchy_dist_PROG = touchy$(exeext) +utils/touchy_dist_PROGNAME = touchy utils/touchy_dist_TOPDIR = YES utils/touchy_dist_INSTALL = YES utils/touchy_dist_INSTALL_INPLACE = YES diff --git a/utils/unlit/ghc.mk b/utils/unlit/ghc.mk index 597a9018c2..765c96969b 100644 --- a/utils/unlit/ghc.mk +++ b/utils/unlit/ghc.mk @@ -11,7 +11,7 @@ # ----------------------------------------------------------------------------- utils/unlit_dist_C_SRCS = unlit.c -utils/unlit_dist_PROG = unlit$(exeext) +utils/unlit_dist_PROGNAME = unlit utils/unlit_dist_TOPDIR = YES utils/unlit_dist_INSTALL = YES utils/unlit_dist_INSTALL_INPLACE = YES |