X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=utils%2Fhsc2hs%2FMakefile;h=07e574c0ace285143821210c99b2ce3f891ad37c;hp=0216983e08b0cc7ca760dd2487f4d2e43ebbb5eb;hb=329b02ee067c93031866854884f0a57d0e93b193;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1 diff --git a/utils/hsc2hs/Makefile b/utils/hsc2hs/Makefile index 0216983..07e574c 100644 --- a/utils/hsc2hs/Makefile +++ b/utils/hsc2hs/Makefile @@ -13,7 +13,7 @@ include $(GHC_COMPAT_DIR)/compat.mk # This is required because libghccompat.a must be built with # $(GhcHcOpts) because it is linked to the compiler, and hence # we must also build with $(GhcHcOpts) here: -SRC_HC_OPTS += $(GhcHcOpts) +SRC_HC_OPTS += $(GhcHcOpts) $(GhcStage1HcOpts) HS_PROG = hsc2hs-bin ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32" @@ -23,17 +23,13 @@ ifeq "$(HOSTPLATFORM)" "i386-unknown-cygwinw32" HS_PROG = hsc2hs$(exeext) endif -ifeq "$(ghc_ge_504)" "NO" -SRC_HC_OPTS += -package util -endif - # Note: Somehow we should pass $(exeext) here, but the history of changes used # for calling the C preprocessor via GHC has changed a few times, making a # clean solution impossible. So we revert to a hack in Main.hs... SRC_HC_OPTS += -Wall ifneq "$(HOSTPLATFORM)" "i386-unknown-mingw32" -INSTALLED_SCRIPT_PROG = hsc2hs +INSTALLED_SCRIPT_PROG = hsc2hs-ghc endif INPLACE_SCRIPT_PROG = hsc2hs-inplace @@ -63,7 +59,7 @@ ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32" extra_flags=$(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS))) endif -HSC2HS_EXTRA="--cc=$(CC) --ld=$(CC) $(extra_flags) --cflag=-D__GLASGOW_HASKELL__=$(ProjectVersionInt) -I$(FPTOOLS_TOP_ABS_PLATFORM)/$(GHC_INCLUDE_DIR_REL)" +HSC2HS_EXTRA=--cc=$(CC) --ld=$(CC) $(extra_flags) --cflag=-D__GLASGOW_HASKELL__=$(ProjectVersionInt) -I$(FPTOOLS_TOP_ABS_PLATFORM)/$(GHC_INCLUDE_DIR_REL) endif $(SCRIPT_PROG) : Makefile @@ -95,4 +91,14 @@ clean distclean maintainer-clean :: $(MAKE) INSTALLING=0 BIN_DIST=0 $(MFLAGS) $@ endif +ifeq "$(INSTALLING)$(HOSTPLATFORM)" "0i386-unknown-mingw32" +all :: $(INPLACE_SCRIPT_PROG).bat + +# See "MSys Note 3" in compiler/Makefile +FULL_INPLACE_PATH=$(subst /,\,$(FPTOOLS_TOP_ABS_PLATFORM)/utils/hsc2hs/) +$(INPLACE_SCRIPT_PROG).bat : + echo '@call $(FULL_INPLACE_PATH)$(HS_PROG) --template=$(FULL_INPLACE_PATH)template-hsc.h $(HSC2HS_EXTRA) %*' >> $@ + chmod 755 $@ +endif + include $(TOP)/mk/target.mk