[project @ 2001-08-15 09:33:41 by rrt]
[ghc-hetmet.git] / ghc / compiler / Makefile
index 74029fe..f08e884 100644 (file)
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.176 2001/07/17 17:27:20 sof Exp $
+# $Id: Makefile,v 1.184 2001/08/15 09:33:41 rrt Exp $
 
 TOP = ..
 include $(TOP)/mk/boilerplate.mk
@@ -62,6 +62,10 @@ $(CONFIG_HS) : $(FPTOOLS_TOP)/mk/config.mk Makefile
        @echo "cGHC_SYSMAN_DIR       = \"$(GHC_SYSMAN_DIR)\"" >> $(CONFIG_HS)
        @echo "cGHC_CP               = \"$(GHC_CP)\"" >> $(CONFIG_HS)
        @echo "cGHC_PERL             = \"$(GHC_PERL)\"" >> $(CONFIG_HS)
+ifeq ($(GhcWithIlx),YES)
+       @echo "cILX2IL               = \"$(ILX2IL)\"" >> $(CONFIG_HS)
+       @echo "cILASM                = \"$(ILASM)\"" >> $(CONFIG_HS)
+endif
        @echo "cEnableWin32DLLs      = \"$(EnableWin32DLLs)\"" >> $(CONFIG_HS)
        @echo "cCONTEXT_DIFF         = \"$(CONTEXT_DIFF)\"" >> $(CONFIG_HS)
        @echo "cHaveLibGmp           = \"$(HaveLibGmp)\"" >> $(CONFIG_HS)
@@ -113,6 +117,7 @@ compiling_with_4xx=NO
 else
 bootstrapped = $(shell if (test $(CANON_HC_VERSION) -ge $(ProjectVersionInt)0); then echo YES; else echo NO; fi)
 compiling_with_4xx = $(shell if (test $(CANON_HC_VERSION) -lt 5000); then echo YES; else echo NO; fi)
+ghc_502_at_least = $(shell if (test $(CANON_HC_VERSION) -ge 5020); then echo YES; else echo NO; fi)
 endif
 
 # Only include GHCi if we're bootstrapping with at least version 411
@@ -126,26 +131,27 @@ endif
 # Enable code that assumes a MSDOSish subshell. See mk/config.mk.in
 # for explanatory comment as to what this does.
 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-ghc_501_at_least = $(shell if (test $(CANON_HC_VERSION) -gt 5000); then echo YES; else echo NO; fi)
+ghc_501_at_least = $(shell if (test $(CANON_HC_VERSION) -ge 5010); then echo YES; else echo NO; fi)
 
 # -----------------------------------------------
-# GHCi calls the C procedure 'system', but alas GHC 4.08's 
-# implementation of this (in the library System) didn't work 
-# properly on Windows.  Everything is fine if you are compiling
-# GHC with GHC 5.01 or better, but lacking that we have the following
+# GHCi calls the C procedure 'rawSystem'; but alas GHC 4.08 
+# does not have this.  Everything is fine if you are compiling
+# GHC with GHC 5.02 or better, but lacking that we have the following
 # hack: 
-#      copy system.c from lib/std (where it is correct) 
-#      into main/system.c (where it'll be compiled and
-#                          linked with the compiler)
+#      copy rawSystem.c from hslibs/lang/cbits
+#       and SystemExts.lhs from hslibs/lang
+#      into main/ (where they'll be compiled and linked with the compiler)
 
-ifneq "$(ghc_501_at_least)" "YES"
-C_SRCS += main/system.c
+ifneq "$(ghc_502_at_least)" "YES"
+C_SRCS += main/rawSystem.c
+HS_SRCS += main/SystemExts.lhs
 SRC_CC_OPTS += -I$(GHC_LIB_DIR)/std/cbits
 SRC_MKDEPENDC_OPTS += -I$(GHC_LIB_DIR)/std/cbits
-HS_OBJS += main/system.o
-
-main/system.c : ../lib/std/cbits/system.c
-       $(CP) ../lib/std/cbits/system.c main
+HS_OBJS += main/rawSystem.o
+main/rawSystem.c : $(FPTOOLS_TOP)/hslibs/lang/cbits/rawSystem.c
+       $(CP) $< main
+main/SystemExts.lhs: $(FPTOOLS_TOP)/hslibs/lang/SystemExts.lhs
+       $(CP) $< main
 endif
 endif
 #              End of system hack
@@ -229,7 +235,7 @@ endif
 
 SRC_CC_OPTS += -Iparser -I. -I$(TOP)/includes -O
 SRC_HC_OPTS += -recomp $(GhcHcOpts)
-SRC_HC_OPTS += -H16m
+SRC_HC_OPTS += -H16M
 
 #      Special flags for particular modules
 #      The standard suffix rule for compiling a Haskell file
@@ -305,6 +311,8 @@ SRC_C_OPTS     += -O -I. -IcodeGen
 #              Generate supporting stuff for prelude/PrimOp.lhs 
 #              from prelude/primops.txt
 
+CLEAN_FILES += prelude/primops.txt
+
 GENPOC=$(TOP)/utils/genprimopcode/genprimopcode
 
 PRIMOP_BITS=primop-data-decl.hs-incl \
@@ -374,7 +382,7 @@ ghc-inplace : $(HS_PROG)
        chmod 755 $@
 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
        @$(RM) $@.bat
-       echo "@"$(subst /,\\,$(FPTOOLS_TOP_ABS)/ghc/compiler/$(HS_PROG)) "-B$(FPTOOLS_TOP_ABS) %*" >$@.bat
+       echo "@"$(subst /,\\,$(FPTOOLS_TOP_ABS)/ghc/compiler/$(HS_PROG)) "-B$(FPTOOLS_TOP_ABS) %1 %2 %3 %4 %5 %6 %7 %8 %9" >$@.bat
        chmod 755 $@.bat
 endif