Skip to content
Snippets Groups Projects
Commit 2f73bd52 authored by sof's avatar sof
Browse files

[project @ 1997-05-19 00:22:33 by sof]

Made 2.0x and fromC bootable
parent dcef38ba
No related merge requests found
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# $Id: Makefile,v 1.12 1997/03/24 04:31:45 sof Exp $ # $Id: Makefile,v 1.13 1997/05/19 00:22:33 sof Exp $
TOP = .. TOP = ..
include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/boilerplate.mk
...@@ -21,6 +21,14 @@ endif ...@@ -21,6 +21,14 @@ endif
# (included below) to kick in. # (included below) to kick in.
LIBRARY=libhsp.a LIBRARY=libhsp.a
#
# Note: there have been reports of people running up against the ARG_MAX limit
# when linking hsc with all its constituent object files. The likely source of
# the problem is that the environment is a bit too big, so a workaround could
# be to do ` env PATH=$(PATH) make hsc 'to minimise the environment. (or the
# equivalent of `env' if it doesn't exist locally).
#
HS_PROG=hsc HS_PROG=hsc
...@@ -45,6 +53,7 @@ ifeq ($(GhcWithNativeCodeGen),YES) ...@@ -45,6 +53,7 @@ ifeq ($(GhcWithNativeCodeGen),YES)
ifeq ($(GhcWithHscBuiltViaC),YES) ifeq ($(GhcWithHscBuiltViaC),YES)
# If building via C, we *assume* that it is the distributed C files, # If building via C, we *assume* that it is the distributed C files,
# which do not have a native-code generator in them # which do not have a native-code generator in them
SRC_MKDEPENDHS_OPTS += -DOMIT_NATIVE_CODEGEN
else else
DIRS += nativeGen DIRS += nativeGen
endif endif
...@@ -61,9 +70,23 @@ HS_SRCS = $(SRCS_UGNHS) \ ...@@ -61,9 +70,23 @@ HS_SRCS = $(SRCS_UGNHS) \
# NB: it's no good to include *.hs in the top-line wildcard, because the .hs files # NB: it's no good to include *.hs in the top-line wildcard, because the .hs files
# in parser/ may not have been created at that point. # in parser/ may not have been created at that point.
LOOPS = $(patsubst %.lhi, %.hi, $(wildcard */*.lhi))
HCS = $(patsubst %.lhs, %.hc, $(patsubst %.hs, %.hc, $(HS_SRCS)))
HCS = $(patsubst %.lhs, %.hc, $(patsubst %.hs, %.hc, $(HS_SRCS)))
#
# When booting using a ghc-2.xx compiler, the loop breakers are actually written in
# Haskell, source stubs just re-exporting info from the various .hi-boot files.
# (Reason: we don't want to fiddle with the imports in the sources). We give them
# the suffix .hs, since they're special and don't fall under the umbrella of $(HS_SRCS)
# always (only when $(Ghc2_0) is equal to YES)
ifeq "$(Ghc2_0)" "YES"
LOOPS_HS = $(wildcard */*Loop*.hs)
MKDEPENDHS_SRCS = $(HS_SRCS)
#HS_SRCS += $(LOOPS_HS)
else
LOOPS = $(patsubst %.lhi, %.hi, $(wildcard */*.lhi))
endif
HS_OBJS = \ HS_OBJS = \
$(patsubst %.hc, %.o, $(HCS)) \ $(patsubst %.hc, %.o, $(HCS)) \
parser/hsclink.o parser/hschooks.o libhsp.a parser/hsclink.o parser/hschooks.o libhsp.a
...@@ -105,21 +128,27 @@ SRC_DIST_FILES += rename/ParseIface.hs \ ...@@ -105,21 +128,27 @@ SRC_DIST_FILES += rename/ParseIface.hs \
HC=$(WithGhcHc) HC=$(WithGhcHc)
SRC_HC_OPTS += \ SRC_HC_OPTS += \
-cpp -fhaskell-1.3 -syslib ghc \ -cpp -fhaskell-1.3 \
-fglasgow-exts -DCOMPILING_GHC -Rghc-timing -I. -IcodeGen \ -fglasgow-exts -DCOMPILING_GHC -Rghc-timing -I. -IcodeGen \
-InativeGen -Iparser $(foreach dir,$(DIRS),-i$(dir)) -InativeGen -Iparser $(foreach dir,$(DIRS),-i$(dir))
# -syslib ghc just needed for utils/CharSeq.lhs use of PackedString.hPutPS # -syslib ghc just needed for use of PackedString.hPutPS
SRC_CC_OPTS += -Iparser -I. SRC_CC_OPTS += -Iparser -I.
ifneq ($(Ghc2_0),NO) ifeq "$(Ghc2_0)" "NO"
SRC_HC_OPTS += -fomit-derived-read -fomit-reexported-instances SRC_HC_OPTS += -fomit-derived-read -fomit-reexported-instances
else
# Recompilation checking - unconditionally so (ToDo: move to mk/config.mk.in)
SRC_HC_OPTS += -recomp
endif endif
ifeq ($(GhcWithDeforester),NO) ifeq ($(GhcWithDeforester),NO)
SRC_HC_OPTS += -DOMIT_DEFORESTER ifeq "$(Ghc2_0)" "NO"
SRC_MKDEPENDHS_OPTS += -DOMIT_DEFORESTER
endif
SRC_HC_OPTS += -DOMIT_DEFORESTER
endif endif
SRC_HC_OPTS += $(GhcHcOpts) SRC_HC_OPTS += $(GhcHcOpts)
...@@ -151,7 +180,10 @@ parser/U_qid_HC_OPTS = -fvia-C '-\#include"hspincl.h"' ...@@ -151,7 +180,10 @@ parser/U_qid_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
parser/U_tree_HC_OPTS = -fvia-C '-\#include"hspincl.h"' parser/U_tree_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
parser/U_ttype_HC_OPTS = -fvia-C '-\#include"hspincl.h"' parser/U_ttype_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
prelude/PrimOp_HC_OPTS = -K3m prelude/PrimOp_HC_OPTS = -K3m
reader/Lex_HC_OPTS = -K2m -H16m reader/Lex_HC_OPTS = -K2m -H16m -fvia-C
ifeq "$(Ghc2_0)" "NO"
reader/Lex_HC_OPTS += -fomit-derived-read
endif
reader/ReadPrefix_HC_OPTS = -fvia-C '-\#include"hspincl.h"' reader/ReadPrefix_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
rename/ParseIface_HC_OPTS = -Onot -H16m rename/ParseIface_HC_OPTS = -Onot -H16m
rename/ParseType_HC_OPTS = -Onot -H16m rename/ParseType_HC_OPTS = -Onot -H16m
...@@ -167,15 +199,15 @@ rename/RnIfaces_HC_OPTS = -H8m -fvia-C ...@@ -167,15 +199,15 @@ rename/RnIfaces_HC_OPTS = -H8m -fvia-C
rename/RnNames_HC_OPTS = -H12m rename/RnNames_HC_OPTS = -H12m
specialise/Specialise_HC_OPTS = -Onot -H12m specialise/Specialise_HC_OPTS = -Onot -H12m
stgSyn/StgSyn_HC_OPTS = -fno-omit-reexported-instances stgSyn/StgSyn_HC_OPTS = -fno-omit-reexported-instances
typecheck/TcMonad_HC_OPTS = -fvia-C
typecheck/TcGenDeriv_HC_OPTS = -H10m typecheck/TcGenDeriv_HC_OPTS = -H10m
typecheck/TcExpr_HC_OPTS = -H10m typecheck/TcExpr_HC_OPTS = -H10m
typecheck/TcEnv_HC_OPTS = -H10m
utils/Argv_HC_OPTS = -fvia-C utils/Argv_HC_OPTS = -fvia-C
utils/CharSeq_HC_OPTS = -fvia-C
utils/SST_HC_OPTS = -fvia-C utils/SST_HC_OPTS = -fvia-C
utils/PrimPacked_HC_OPTS = -fvia-C -monly-3-regs utils/PrimPacked_HC_OPTS = -fvia-C -monly-3-regs
utils/FastString_HC_OPTS = -fvia-C utils/FastString_HC_OPTS = -fvia-C
utils/StringBuffer_HC_OPTS = -fvia-C utils/StringBuffer_HC_OPTS = -fvia-C
utils/Digraph_HC_OPTS = -fglasgow-exts -fvia-C
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -193,7 +225,7 @@ SRC_YACC_OPTS += -d -v ...@@ -193,7 +225,7 @@ SRC_YACC_OPTS += -d -v
# #
# Want to keep the intermediate (included in src distribs). # Want to keep the intermediate (included in src distribs).
# #
.PRECIOUS: parser/%.tab.c parser/hslexer.c .PRECIOUS: %.tab.c %.tab.h parser/hslexer.c
parser/hschooks.o : parser/hschooks.c parser/hschooks.o : parser/hschooks.c
@$(RM) $@ @$(RM) $@
...@@ -235,20 +267,34 @@ CLEAN_FILES += hsp ...@@ -235,20 +267,34 @@ CLEAN_FILES += hsp
# inside it. (compilation is handled by the suffix rules). # inside it. (compilation is handled by the suffix rules).
# #
# Building the loop breakers from .lhi files # Building the loop breakers from .lhi (0.2x) or .hi-boot (2.xx) files
# #
ifeq ($(Ghc2_0),YES) ifeq ($(Ghc2_0),YES)
%.hi : %_1_3.lhi
$(RM) $@ BOOT_HI_STEMS = $(basename $(wildcard */*.hi-boot))
$(UNLIT) $< $@ || ( $(RM) $@ && exit 1 )
@chmod 444 $@ hi-boot ::
@for n in $(BOOT_HI_STEMS); \
do \
echo Creating $$n.hi ; \
$(RM) $$n.hi ; \
$(CP) $$n.hi-boot $$n.hi || ( $(RM) $$n.hi && exit 1 ) ; \
done
#
# Have the collector *Loop.hs interface files be generated just after having
# created the .hi's from the .hi-boot's.
hi-boot :: $(patsubst %.hs,%.hi,$(LOOPS_HS))
else else
%.hi : %.lhi %.hi : %.lhi
$(RM) $@ $(RM) $@
$(UNLIT) $< $@ || ( $(RM) $@ && exit 1 ) $(UNLIT) $< $@ || ( $(RM) $@ && exit 1 )
@chmod 444 $@ @chmod 444 $@
endif endif
boot :: hi-boot
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Linking # Linking
...@@ -284,16 +330,13 @@ endif ...@@ -284,16 +330,13 @@ endif
# #
depend :: $(LOOPS) $(SRCS_UGNHS) rename/ParseIface.hs rename/ParseUnfolding.hs rename/ParseType.hs depend :: $(LOOPS) $(SRCS_UGNHS) rename/ParseIface.hs rename/ParseUnfolding.hs rename/ParseType.hs
ifeq ($(GhcWithDeforester),NO)
SRC_MKDEPENDHS_OPTS += -DOMIT_DEFORESTER
endif
ifeq ($(Ghc2_0),YES)
SRC_MKDEPENDHS_OPTS += $(SRC_HC_OPTS)
endif
ifeq ($(GhcWithHscBuiltViaC),YES) ifeq "$(GhcWithHscBuiltViaC)" "YES"
SRC_MKDEPENDHS_OPTS += -o .hc SRC_MKDEPENDHS_OPTS += -o .hc
# When booting from .hc, (hackily) remove the suffix rule for
# .l?hs -> .o, so that the .hc -> .o is used instead.
%.$(way_)o : %.lhs
%.$(way_)o : %.hs
else else
SRCS_MKDEPENDHS = $(SRCS_HC) # should add $(LOOPS) ? SRCS_MKDEPENDHS = $(SRCS_HC) # should add $(LOOPS) ?
endif endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment