Commit 2b85372c authored by ian@well-typed.com's avatar ian@well-typed.com

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).
parent 8640750e
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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)
......
......@@ -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))
......
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))
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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))
......@@ -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))
......@@ -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
......
......@@ -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))
......@@ -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))
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment