summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-03-03 22:29:57 +0000
committerIan Lynagh <ian@well-typed.com>2013-03-03 22:29:57 +0000
commit7cef4375e696fd226399ea2b22efef0927680e8e (patch)
tree45ea74f7db9809c743ec48afbbd634beafafdc77
parent2bdc4fdc00f1124ee7f379057a357c1beabbf11c (diff)
downloadhaskell-7cef4375e696fd226399ea2b22efef0927680e8e.tar.gz
Automatically define _INPLACE variables for perl programs too
and use them for split
-rw-r--r--compiler/ghc.mk2
-rw-r--r--driver/split/ghc.mk2
-rw-r--r--ghc/ghc.mk6
-rw-r--r--mk/config.mk.in3
-rw-r--r--rules/build-perl.mk9
5 files changed, 12 insertions, 10 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index a27208bf22..181aba9086 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -104,7 +104,7 @@ endif
@echo 'cGHC_UNLIT_PGM :: String' >> $@
@echo 'cGHC_UNLIT_PGM = "$(utils/unlit_dist_PROG)"' >> $@
@echo 'cGHC_SPLIT_PGM :: String' >> $@
- @echo 'cGHC_SPLIT_PGM = "$(GHC_SPLIT_PGM)"' >> $@
+ @echo 'cGHC_SPLIT_PGM = "$(driver/split_dist_PROG)"' >> $@
@echo 'cLibFFI :: Bool' >> $@
ifeq "$(UseLibFFIForAdjustors)" "YES"
@echo 'cLibFFI = True' >> $@
diff --git a/driver/split/ghc.mk b/driver/split/ghc.mk
index 11e3eede96..9ee4cd604e 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_PGM)
+driver/split_dist_PROG = 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 73d025369c..292ae92cfa 100644
--- a/ghc/ghc.mk
+++ b/ghc/ghc.mk
@@ -150,9 +150,9 @@ $(GHC_STAGE2) : | $(GHC_DEPENDENCIES)
$(GHC_STAGE3) : | $(GHC_DEPENDENCIES)
ifeq "$(GhcUnregisterised)" "NO"
-$(GHC_STAGE1) : | $(SPLIT)
-$(GHC_STAGE2) : | $(SPLIT)
-$(GHC_STAGE3) : | $(SPLIT)
+$(GHC_STAGE1) : | $$(ghc-split_INPLACE)
+$(GHC_STAGE2) : | $$(ghc-split_INPLACE)
+$(GHC_STAGE3) : | $$(ghc-split_INPLACE)
endif
ifeq "$(Windows_Host)" "YES"
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 69bb2b88bb..5cd1667cc7 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -434,9 +434,6 @@ SRC_FLEX_OPTS += -8
# xxx_PGM the name of an executable, without the path
# xxx the executable relative to the current dir
-GHC_SPLIT_PGM = ghc-split
-
-SPLIT = $(INPLACE_LIB)/$(GHC_SPLIT_PGM)
TOUCHY = $(INPLACE_LIB)/touchy$(exeext)
MKDIRHIER = $(INPLACE_BIN)/mkdirhier
diff --git a/rules/build-perl.mk b/rules/build-perl.mk
index ff2a6ff625..2c1908d356 100644
--- a/rules/build-perl.mk
+++ b/rules/build-perl.mk
@@ -24,12 +24,17 @@ $(call profStart, build-perl($1,$2))
# $1 = dir
# $2 = distdir
+ifneq "$$($$($1_$2_PROG)_INPLACE)" ""
+$$(error $$($1_$2_PROG)_INPLACE defined twice)
+endif
ifeq "$$($1_$2_TOPDIR)" "YES"
-$1_$2_INPLACE = $$(INPLACE_TOPDIR)/$$($1_$2_PROG)
+$$($1_$2_PROG)_INPLACE = $$(INPLACE_TOPDIR)/$$($1_$2_PROG)
else
-$1_$2_INPLACE = $$(INPLACE_BIN)/$$($1_$2_PROG)
+$$($1_$2_PROG)_INPLACE = $$(INPLACE_BIN)/$$($1_$2_PROG)
endif
+$1_$2_INPLACE = $$($$($1_$2_PROG)_INPLACE)
+
$(call all-target,$1_$2,$$($1_$2_INPLACE))
$(call clean-target,$1,$2,$1/$2 $$($1_$2_INPLACE))