summaryrefslogtreecommitdiff
path: root/includes/ghc.mk
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-01-30 11:19:03 +0000
committerSimon Marlow <marlowsd@gmail.com>2012-01-30 11:19:03 +0000
commit9fff25eaf08016c4c0e32a7087a1249d586550c0 (patch)
tree7a2f13260f24d610abea5cd8f8bf3a51d0787c54 /includes/ghc.mk
parent4ff3a642fbb61cf329d468993e9f732940f9f680 (diff)
downloadhaskell-9fff25eaf08016c4c0e32a7087a1249d586550c0.tar.gz
Improve support for cross-compilation
Patchset from Stephen Blackheath <stephen.blackheath@ipwnstudios.com>
Diffstat (limited to 'includes/ghc.mk')
-rw-r--r--includes/ghc.mk22
1 files changed, 20 insertions, 2 deletions
diff --git a/includes/ghc.mk b/includes/ghc.mk
index ef994f2329..74edf55b1c 100644
--- a/includes/ghc.mk
+++ b/includes/ghc.mk
@@ -129,7 +129,7 @@ endif
includes_DERIVEDCONSTANTS = includes/dist-derivedconstants/header/DerivedConstants.h
-ifeq "$(PORTING_HOST)" "YES"
+ifeq "$(PORTING_HOST)-$(AlienScript)" "YES-"
DerivedConstants.h :
@echo "*** Cross-compiling: please copy DerivedConstants.h from the target system"
@@ -145,9 +145,18 @@ $(eval $(call build-prog,includes,dist-derivedconstants,0))
$(includes_dist-derivedconstants_depfile_c_asm) : $(includes_H_CONFIG) $(includes_H_PLATFORM) $(includes_H_FILES) $$(rts_H_FILES)
includes/dist-derivedconstants/build/mkDerivedConstants.o : $(includes_H_CONFIG) $(includes_H_PLATFORM)
+ifneq "$(AlienScript)" ""
+$(INPLACE_BIN)/mkDerivedConstants$(exeext): includes/$(includes_dist-derivedconstants_C_SRCS) | $$(dir $$@)/.
+ $(WhatGccIsCalled) -o $@ $< $(CFLAGS) $(includes_CC_OPTS)
+endif
+
ifneq "$(BINDIST)" "YES"
$(includes_DERIVEDCONSTANTS) : $(INPLACE_BIN)/mkDerivedConstants$(exeext) | $$(dir $$@)/.
+ifeq "$(AlienScript)" ""
./$< >$@
+else
+ $(AlienScript) run ./$< >$@
+endif
endif
endif
@@ -157,7 +166,7 @@ endif
includes_GHCCONSTANTS = includes/dist-ghcconstants/header/GHCConstants.h
-ifeq "$(PORTING_HOST)" "YES"
+ifeq "$(PORTING_HOST)-$(AlienScript)" "YES-"
$(includes_GHCCONSTANTS) :
@echo "*** Cross-compiling: please copy DerivedConstants.h from the target system"
@@ -176,8 +185,17 @@ $(includes_dist-ghcconstants_depfile_c_asm) : $(includes_H_CONFIG) $(includes_H_
includes/dist-ghcconstants/build/mkDerivedConstants.o : $(includes_H_CONFIG) $(includes_H_PLATFORM)
+ifneq "$(AlienScript)" ""
+$(INPLACE_BIN)/mkGHCConstants$(exeext): includes/$(includes_dist-ghcconstants_C_SRCS) | $$(dir $$@)/.
+ $(WhatGccIsCalled) -o $@ $< $(CFLAGS) $(includes_CC_OPTS) $(includes_dist-ghcconstants_CC_OPTS)
+endif
+
$(includes_GHCCONSTANTS) : $(INPLACE_BIN)/mkGHCConstants$(exeext) | $$(dir $$@)/.
+ifeq "$(AlienScript)" ""
./$< >$@
+else
+ $(AlienScript) run ./$< >$@
+endif
endif
endif