X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FMakefile;h=c1819f2cd269bcebd213caa4508bda25dc2240a0;hb=1f5e3b2472084434edf71a89c4764d1509e8e9b0;hp=bed555cb90def87ae1d0b2901a93a3d51f8ec4f1;hpb=1727a8c0ba62091ca42a45244de4dcb6278a02a1;p=ghc-hetmet.git diff --git a/ghc/compiler/Makefile b/ghc/compiler/Makefile index bed555c..c1819f2 100644 --- a/ghc/compiler/Makefile +++ b/ghc/compiler/Makefile @@ -216,6 +216,8 @@ $(CONFIG_HS) : $(FPTOOLS_TOP)/mk/config.mk Makefile @echo "cRAWCPP_FLAGS = \"$(RAWCPP_FLAGS)\"" >> $(CONFIG_HS) @echo "cGCC = \"$(WhatGccIsCalled)\"" >> $(CONFIG_HS) @echo "cMKDLL = \"$(BLD_DLL)\"" >> $(CONFIG_HS) + @echo "cLdIsGNULd = \"$(LdIsGNULd)\"" >> $(CONFIG_HS) + @echo "cLD_X = \"$(LD_X)\"" >> $(CONFIG_HS) @echo "cPROJECT_DIR = \"$(PROJECT_DIR)\"" >> $(CONFIG_HS) @echo "cGHC_DRIVER_DIR_REL = \"$(GHC_DRIVER_DIR_REL)\"" >> $(CONFIG_HS) @echo "cGHC_TOUCHY_PGM = \"$(GHC_TOUCHY_PGM)\"" >> $(CONFIG_HS) @@ -259,9 +261,9 @@ stage1/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk Makefile @echo "#ifndef __PLATFORM_H__" >$@ @echo "#define __PLATFORM_H__" >>$@ @echo >> $@ - @echo "#define BuildPlatform_TYPE $(BuildPlatform_CPP)" >> $@ - @echo "#define HostPlatform_TYPE $(HostPlatform_CPP)" >> $@ - @echo "#define TargetPlatform_TYPE $(TargetPlatform_CPP)" >> $@ + @echo "#define BuildPlatform_NAME \"$(BUILDPLATFORM)\"" >> $@ + @echo "#define HostPlatform_NAME \"$(HOSTPLATFORM)\"" >> $@ + @echo "#define TargetPlatform_NAME \"$(TARGETPLATFORM)\"" >> $@ @echo >> $@ @echo "#define $(BuildPlatform_CPP)_BUILD 1" >> $@ @echo "#define $(HostPlatform_CPP)_HOST 1" >> $@ @@ -305,9 +307,9 @@ stage2/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk Makefile @echo "#ifndef __PLATFORM_H__" >$@ @echo "#define __PLATFORM_H__" >>$@ @echo >> $@ - @echo "#define BuildPlatform_TYPE $(HostPlatform_CPP)" >> $@ - @echo "#define HostPlatform_TYPE $(TargetPlatform_CPP)" >> $@ - @echo "#define TargetPlatform_TYPE $(TargetPlatform_CPP)" >> $@ + @echo "#define BuildPlatform_NAME \"$(HOSTPLATFORM)\"" >> $@ + @echo "#define HostPlatform_NAME \"$(TARGETPLATFORM)\"" >> $@ + @echo "#define TargetPlatform_NAME \"$(TARGETPLATFORM)\"" >> $@ @echo >> $@ @echo "#define $(HostPlatform_CPP)_BUILD 1" >> $@ @echo "#define $(TargetPlatform_CPP)_HOST 1" >> $@ @@ -390,7 +392,7 @@ else ifneq "$(findstring $(stage), 2 3)" "" bootstrapped = YES else -bootstrapped = $(shell if (test $(GhcCanonVersion) -ge $(ProjectVersionInt) -a $(GhcPatchLevel) -ge $(ProjectPatchLevel)); then echo YES; else echo NO; fi) +bootstrapped = $(shell if (test $(GhcCanonVersion) -eq $(ProjectVersionInt) -a $(GhcPatchLevel) -eq $(ProjectPatchLevel)); then echo YES; else echo NO; fi) endif endif @@ -407,6 +409,9 @@ ifeq "$(GhcWithInterpreter) $(bootstrapped)" "YES YES" SRC_HC_OPTS += -DGHCI -package template-haskell PKG_DEPENDS += template-haskell +# Use threaded RTS with GHCi, so threads don't get blocked at the prompt. +SRC_HC_OPTS += -threaded + ALL_DIRS += ghci # If we are going to use dynamic libraries instead of .o files for ghci, @@ -491,7 +496,9 @@ PKG_DEPENDS += unix endif endif -ifneq "$(findstring YES, $(bootstrapped) $(ghc_ge_603))" "" +# We use the Cabal package in stages 2/3 only; in stage 1 we're using +# the libcompat library which provides the Cabal modules. +ifneq "$(stage)" "1" SRC_HC_OPTS += -package Cabal PKG_DEPENDS += Cabal endif @@ -552,11 +559,14 @@ ifeq "$(bootstrapped)" "YES" utils/Binary_HC_OPTS = -funbox-strict-fields endif -# BinIface and Binary take ages to both compile and run if you don's use -O +# We always optimise some low-level modules, otherwise performance of +# a non-optimised compiler is severely affected. main/BinIface_HC_OPTS += -O utils/Binary_HC_OPTS += -O utils/FastMutInt_HC_OPTS += -O - +utils/Encoding_HC_OPTS += -O +utils/StringBuffer_HC_OPTS += -O +utils/FastString_HC_OPTS += -O # ---- Profiling ---- #simplCore/Simplify_HC_OPTS = -auto-all @@ -672,7 +682,11 @@ $(odir)/ghc-inplace : $(HS_PROG) ghc-inplace : stage1/ghc-inplace $(LN_S) -f $< $@ -CLEAN_FILES += $(odir)/ghc-inplace ghc-inplace +ifeq "$(stage)" "1" +CLEAN_FILES += ghc-inplace +endif + +CLEAN_FILES += $(odir)/ghc-inplace #----------------------------------------------------------------------------- # install @@ -731,6 +745,7 @@ endif # typecheck/TcUnify_HC_OPTS += -auto-all coreSyn/CorePrep_HC_OPTS += -auto-all +# parser/Parser_HC_OPTS += -fasm #----------------------------------------------------------------------------- # Building the GHC package @@ -746,6 +761,9 @@ VERSION = $(ProjectVersion) PKG_DEPENDS += base haskell98 PACKAGE_CPP_OPTS += -DPKG_DEPENDS='$(PKG_DEPENDS)' +# Omit Main from the library, the client will want to plug their own Main in +LIBOBJS = $(filter-out $(odir)/main/Main.o $(odir)/parser/hschooks.o, $(OBJS)) + # disable splitting: it won't really help with GHC, and the specialised # build system for ghc/compiler isn't set up to handle it. SplitObjs = NO @@ -807,7 +825,11 @@ ifneq "$(BootingFromHc)" "YES" $(MKDEPENDHS) -M -optdep-f -optdep.depend-BASE $(foreach way,$(WAYS),-optdep-s -optdep$(way)) $(foreach obj,$(MKDEPENDHS_OBJ_SUFFICES),-osuf $(obj)) $(MKDEPENDHS_OPTS) $(filter-out -split-objs, $(MKDEPENDHS_HC_OPTS)) $(HS_SRCS) endif $(MKDEPENDC) -f .depend-BASE $(MKDEPENDC_OPTS) $(foreach way,$(WAYS),-s $(way)) -- $(CC_OPTS) -- $(C_SRCS) - $(PERL) -pe 'binmode(stdin); binmode(stdout); s@^(\S*\.o)@stage$(stage)/$$1@g; s@(\S*\.hi)@stage$(stage)/$$1@g' <.depend-BASE >.depend-$(stage) + $(PERL) -pe 'binmode(stdin); binmode(stdout); s@^(\S*\.o)@stage$(stage)/$$1@g; s@(\S*\.hi)@stage$(stage)/$$1@g; s@^.*/lib/compat.*$$@@g;' <.depend-BASE >.depend-$(stage) # The binmode stuff tells perl not to add stupid ^M's to the output +# +# The /lib/compat replacement is to workaround a bug in the +# -optdep--exclude-module flag in GHC 6.4. It is not required for any +# other version of GHC, but doesn't do any harm. -include .depend-$(stage)