X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fhsc2hs%2FMakefile;h=de8d64f06b85cbc5fc0986d5085210fe902f14e4;hb=e4fa0854318cde1a317727ab3d29edc0ca772e9d;hp=70d027f1bbcc60d60e638d62528245df36a4fcae;hpb=f6e429f8f5a533d699a69ffc733a56be5ddff5a9;p=ghc-hetmet.git diff --git a/utils/hsc2hs/Makefile b/utils/hsc2hs/Makefile index 70d027f..de8d64f 100644 --- a/utils/hsc2hs/Makefile +++ b/utils/hsc2hs/Makefile @@ -39,9 +39,17 @@ else extra_flags= endif +nothing= +space=$(nothing) $(nothing) +# Given +# foo bar +# make +# :\"-Ifoo\":\"-Ibar\" +GMP_INCLUDE_DIRS_STRINGS = $(subst $(space),,$(foreach d,$(GMP_INCLUDE_DIRS),:\"-I$(d)\")) + $(INPLACE_HS): Makefile $(FPTOOLS_TOP)/mk/config.mk echo "import System.Cmd; import System.Environment; import System.Exit" > $@ - echo "main = do args <- getArgs; rawSystem \"$(FPTOOLS_TOP_ABS)/$(GHC_HSC2HS_DIR_REL)/$(HS_PROG)\" (\"--template=$(FPTOOLS_TOP_ABS)/$(GHC_HSC2HS_DIR_REL)/template-hsc.h\":\"--cc=$(CC)\":\"--ld=$(CC)\"$(patsubst %,:\"%\",$(extra_flags)):\"--cflag=-D__GLASGOW_HASKELL__=$(ProjectVersionInt)\":\"-I$(FPTOOLS_TOP_ABS)/$(GHC_INCLUDE_DIR_REL)\":\"-I$(FPTOOLS_TOP_ABS)/gmp/gmpbuild\":args) >>= exitWith" >> $@ + echo "main = do args <- getArgs; rawSystem \"$(FPTOOLS_TOP_ABS)/$(GHC_HSC2HS_DIR_REL)/$(HS_PROG)\" (\"--template=$(FPTOOLS_TOP_ABS)/$(GHC_HSC2HS_DIR_REL)/template-hsc.h\":\"--cc=$(CC)\":\"--ld=$(CC)\"$(patsubst %,:\"%\",$(extra_flags)):\"--cflag=-D__GLASGOW_HASKELL__=$(ProjectVersionInt)\":\"-I$(FPTOOLS_TOP_ABS)/$(GHC_INCLUDE_DIR_REL)\":\"-I$(FPTOOLS_TOP_ABS)/gmp/gmpbuild\"$(GMP_INCLUDE_DIRS_STRINGS):args) >>= exitWith" >> $@ $(INPLACE_PROG): $(INPLACE_HS) $(HC) --make $< -o $@