X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FMakefile;h=ddc4032983e00fd51adc8ffef0f40ada9d3669a0;hb=fffba9e37c59f6b03bb79dcafb818b88abc0ed47;hp=f74ed8b2822d3b82b7f8c2612019d940ec0b9ef1;hpb=397858e2648824c5d71b3ddd365be8c5129cddc7;p=ghc-hetmet.git diff --git a/ghc/compiler/Makefile b/ghc/compiler/Makefile index f74ed8b..ddc4032 100644 --- a/ghc/compiler/Makefile +++ b/ghc/compiler/Makefile @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# $Id: Makefile,v 1.84 2000/07/17 11:15:08 simonmar Exp $ +# $Id: Makefile,v 1.95 2000/10/12 12:31:11 sewardj Exp $ TOP = .. include $(TOP)/mk/boilerplate.mk @@ -17,8 +17,61 @@ WAYS=$(GhcCompilerWays) # be to do ` env PATH=$(PATH) make hsc 'to minimise the environment. (or the # equivalent of `env' if it doesn't exist locally). # +ifneq "$(way)" "dll" HS_PROG=hsc$(_way) +else +HS_PROG=hsc +endif +# ----------------------------------------------------------------------------- +# Create compiler configuration + +CONFIG_HS = main/Config.hs +boot :: $(CONFIG_HS) + +$(CONFIG_HS) : $(FPTOOLS_TOP)/mk/config.mk Makefile + @$(RM) -f $(CONFIG_HS) + @echo -n "Creating $(CONFIG_HS) ... " + @echo "module Config where" >>$(CONFIG_HS) + @echo "cProjectName = \"$(ProjectName)\"" >> $(CONFIG_HS) + @echo "cProjectVersion = \"$(ProjectVersion)\"" >> $(CONFIG_HS) + @echo "cProjectVersionInt = \"$(ProjectVersionInt)\"" >> $(CONFIG_HS) + @echo "cHscIfaceFileVersion = \"$(HscIfaceFileVersion)\"" >> $(CONFIG_HS) + @echo "cHOSTPLATFORM = \"$(HOSTPLATFORM)\"" >> $(CONFIG_HS) + @echo "cTARGETPLATFORM = \"$(TARGETPLATFORM)\"" >> $(CONFIG_HS) + @echo "cCURRENT_DIR = \"$(CURRENT_DIR)\"" >> $(CONFIG_HS) + @echo "cGHC_LIB_DIR = \"$(GHC_LIB_DIR)\"" >> $(CONFIG_HS) + @echo "cGHC_RUNTIME_DIR = \"$(GHC_RUNTIME_DIR)\"" >> $(CONFIG_HS) + @echo "cGHC_UTILS_DIR = \"$(GHC_UTILS_DIR)\"" >> $(CONFIG_HS) + @echo "cGHC_INCLUDE_DIR = \"$(GHC_INCLUDE_DIR)\"" >> $(CONFIG_HS) + @echo "cGHC_DRIVER_DIR = \"$(GHC_DRIVER_DIR)\"" >> $(CONFIG_HS) + @echo "cGCC = \"$(WhatGccIsCalled)\"" >> $(CONFIG_HS) + @echo "cGhcWithNativeCodeGen = \"$(GhcWithNativeCodeGen)\"" >> $(CONFIG_HS) + @echo "cLeadingUnderscore = \"$(LeadingUnderscore)\"" >> $(CONFIG_HS) + @echo "cGHC_UNLIT = \"$(GHC_UNLIT)\"" >> $(CONFIG_HS) + @echo "cGHC_HSC = \"$(GHC_HSC)\"" >> $(CONFIG_HS) + @echo "cGHC_MANGLER = \"$(GHC_MANGLER)\"" >> $(CONFIG_HS) + @echo "cGHC_SPLIT = \"$(GHC_SPLIT)\"" >> $(CONFIG_HS) + @echo "cGHC_STATS = \"$(GHC_STATS)\"" >> $(CONFIG_HS) + @echo "cGHC_SYSMAN = \"$(GHC_SYSMAN)\"" >> $(CONFIG_HS) + @echo "cEnableWin32DLLs = \"$(EnableWin32DLLs)\"" >> $(CONFIG_HS) + @echo "cCP = \"$(CP)\"" >> $(CONFIG_HS) + @echo "cRM = \"$(RM)\"" >> $(CONFIG_HS) + @echo "cCONTEXT_DIFF = \"$(CONTEXT_DIFF)\"" >> $(CONFIG_HS) + @echo "cHaveLibGmp = \"$(HaveLibGmp)\"" >> $(CONFIG_HS) + @echo "cGhcWithRegisterised = \"$(GhcWithRegisterised)\"" >> $(CONFIG_HS) + @echo "cUSER_WAY_NAMES = \"$(USER_WAY_NAMES)\"" >> $(CONFIG_HS) + @echo "cUSER_WAY_OPTS = \"$(USER_WAY_OPTS)\"" >> $(CONFIG_HS) + @echo "clibdir = \"$(libdir)\"" >> $(CONFIG_HS) + @echo "clibexecdir = \"$(libexecdir)\"" >> $(CONFIG_HS) + @echo "cdatadir = \"$(datadir)\"" >> $(CONFIG_HS) + @echo "cbindir = \"$(bindir)\"" >> $(CONFIG_HS) + @echo "cDEFAULT_TMPDIR = \"$(DEFAULT_TMPDIR)\"" >> $(CONFIG_HS) + @echo "cFPTOOLS_TOP_ABS = \"$(FPTOOLS_TOP_ABS)\"" >> $(CONFIG_HS) + @echo "cRAWCPP = \"$(RAWCPP)\"" >> $(CONFIG_HS) + @echo done. + +CLEAN_FILES += $(CONFIG_HS) # ----------------------------------------------------------------------------- # Compilation history for Patrick @@ -37,7 +90,7 @@ $(HS_PROG) :: $(HS_SRCS) DIRS = \ utils basicTypes types hsSyn prelude rename typecheck deSugar coreSyn \ specialise simplCore stranal stgSyn simplStg codeGen absCSyn main \ - profiling parser usageSP cprAnalysis javaGen + profiling parser usageSP cprAnalysis javaGen ghci ifeq ($(GhcWithNativeCodeGen),YES) @@ -51,7 +104,7 @@ endif endif -HS_SRCS = $(foreach dir,$(DIRS),$(wildcard $(dir)/*.lhs)) +HS_SRCS = $(foreach dir,$(DIRS),$(wildcard $(dir)/*.lhs) $(wildcard $(dir)/*.hs)) ifneq "$(GhcWithHscBuiltViaC)" "YES" HS_SRCS += rename/ParseIface.hs parser/Parser.hs @@ -105,10 +158,21 @@ empty:= space:= $(empty) $(empty) SRC_HC_OPTS += \ - -cpp -fglasgow-exts -Rghc-timing \ - -I. -IcodeGen -InativeGen -Iparser \ + -cpp -fglasgow-exts \ + -Rghc-timing -I. -IcodeGen -InativeGen -Iparser \ -i$(subst $(space),:,$(DIRS)) +ghc_407_at_least = $(shell expr "$(GhcMinVersion)" \>= 7) +ifeq "$(ghc_407_at_least)" "1" +ifneq "$(mingw32_TARGET_OS)" "1" +SRC_HC_OPTS += -package concurrent -package posix -package text +else +SRC_HC_OPTS += -package concurrent -package text +endif +else +SRC_HC_OPTS += -syslib concurrent -syslib posix -syslib misc +endif + SRC_CC_OPTS += -Iparser -I. -I$(TOP)/includes -O SRC_HC_OPTS += -recomp $(GhcHcOpts) @@ -218,6 +282,8 @@ utils/PrimPacked_HC_OPTS = -fvia-C -monly-3-regs -optC-funfolding-interface-thre # separate bugfix to the fixpoint finder. simplStg/UpdAnal_HC_OPTS = -fno-strictness +stgSyn/StgInterp_HC_OPTS = -fvia-C + # ---------------------------------------------------------------------------- # C compilations @@ -225,6 +291,53 @@ SRC_C_OPTS += -O -I. -IcodeGen # ---------------------------------------------------------------------------- +# Generate supporting stuff for prelude/PrimOp.lhs +# from prelude/primops.txt + +GENPOC=$(TOP)/utils/genprimopcode/genprimopcode + +PRIMOP_BITS=primop-data-decl.hs-incl \ + primop-tag.hs-incl \ + primop-list.hs-incl \ + primop-has-side-effects.hs-incl \ + primop-out-of-line.hs-incl \ + primop-commutable.hs-incl \ + primop-needs-wrapper.hs-incl \ + primop-can-fail.hs-incl \ + primop-strictness.hs-incl \ + primop-usage.hs-incl \ + primop-primop-info.hs-incl + +prelude/PrimOp.o: $(PRIMOP_BITS) + +depend :: $(PRIMOP_BITS) + +primop-data-decl.hs-incl: prelude/primops.txt + $(GENPOC) --data-decl < $< > $@ +primop-tag.hs-incl: prelude/primops.txt + $(GENPOC) --primop-tag < $< > $@ +primop-list.hs-incl: prelude/primops.txt + $(GENPOC) --primop-list < $< > $@ +primop-has-side-effects.hs-incl: prelude/primops.txt + $(GENPOC) --has-side-effects < $< > $@ +primop-out-of-line.hs-incl: prelude/primops.txt + $(GENPOC) --out-of-line < $< > $@ +primop-commutable.hs-incl: prelude/primops.txt + $(GENPOC) --commutable < $< > $@ +primop-needs-wrapper.hs-incl: prelude/primops.txt + $(GENPOC) --needs-wrapper < $< > $@ +primop-can-fail.hs-incl: prelude/primops.txt + $(GENPOC) --can-fail < $< > $@ +primop-strictness.hs-incl: prelude/primops.txt + $(GENPOC) --strictness < $< > $@ +primop-usage.hs-incl: prelude/primops.txt + $(GENPOC) --usage < $< > $@ +primop-primop-info.hs-incl: prelude/primops.txt + $(GENPOC) --primop-primop-info < $< > $@ + + + +# ---------------------------------------------------------------------------- # Parsers/lexers parser/hschooks.o : parser/hschooks.c @@ -248,7 +361,7 @@ parser/Parser.hs : parser/Parser.y #----------------------------------------------------------------------------- # Linking -SRC_LD_OPTS += -no-link-chk +SRC_LD_OPTS += -no-link-chk -ldl ifneq "$(GhcWithHscBuiltViaC)" "YES" ifeq "$(GhcReportCompiles)" "YES" @@ -281,6 +394,7 @@ endif # clean CLEAN_FILES += $(wildcard */*.$(way_)o */*.$(way_)hi) +CLEAN_FILES += $(PRIMOP_BITS) # Extra tidy, remove the .hc files (if you've got them). MAINTAINER_CLEAN_FILES += $(wildcard */*.hc) \