Automatically define _INPLACE variables for perl programs too
authorIan Lynagh <ian@well-typed.com>
Sun, 3 Mar 2013 22:29:57 +0000 (22:29 +0000)
committerIan Lynagh <ian@well-typed.com>
Sun, 3 Mar 2013 22:29:57 +0000 (22:29 +0000)
and use them for split

compiler/ghc.mk
driver/split/ghc.mk
ghc/ghc.mk
mk/config.mk.in
rules/build-perl.mk

index a27208b..181aba9 100644 (file)
@@ -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'                                >> $@
index 11e3eed..9ee4cd6 100644 (file)
@@ -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
index 73d0253..292ae92 100644 (file)
@@ -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"
index 69bb2b8..5cd1667 100644 (file)
@@ -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
 
index ff2a6ff..2c1908d 100644 (file)
@@ -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))