1 # This Makefile builds the GHC binary for stage2. In stage2, the GHC binary
2 # is built as a single Main module that links to the GHC package. It
3 # is easier to do this with a separate Makefile, because we don't want most
4 # of the options normally dumped into SRC_HC_OPTS by the main GHC Makefile.
5 # In particular, we don't want the .hi files picked up along the home package
6 # search path when compiling Main, we need the compiler to find them in
10 include $(TOP)/mk/boilerplate.mk
20 EXCLUDED_C_SRCS += ghc-inplace.c
23 SRC_HC_OPTS += -package ghc
24 SRC_HC_OPTS += -Istage$(stage)
26 -cpp -fglasgow-exts -XNoGenerics -Rghc-timing \
27 -I. -IcodeGen -InativeGen -Iparser
28 SRC_HC_OPTS += $(GhcHcOpts) $(GhcStage$(stage)HcOpts)
29 ifeq "$(TargetOS_CPP)" "openbsd"
30 SRC_HC_OPTS += -optl-Xlinker -optl-E
33 ifeq "$(GhcWithInterpreter)" "YES"
36 # Should the debugger commands be enabled?
37 ifeq "$(GhciWithDebugger)" "YES"
38 SRC_HC_OPTS += -DDEBUGGER
43 ifeq "$(GhcThreaded)" "YES"
44 SRC_HC_OPTS += -threaded
46 ifeq "$(GhcProfiled)" "YES"
49 ifeq "$(GhcDebugged)" "YES"
55 HS_SRCS = main/Main.hs
56 HS_OBJS = $(patsubst %, $(odir)/%, $(addsuffix .$(way_)o,$(basename $(HS_SRCS))))
57 $(odir)/main/Main.o : libHSghc$(_way).a
59 WAYS=$(GhcCompilerWays)
61 include $(TOP)/mk/target.mk