Fix CodingStyle#Warnings URLs
[ghc-hetmet.git] / compiler / Makefile.ghcbin
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
7 # the GHC package.
8
9 TOP = ..
10 include $(TOP)/mk/boilerplate.mk
11
12 ifeq "$(stage)" "2"
13 HC=$(GHC_STAGE1)
14 endif
15
16 ifeq "$(stage)" "3"
17 HC=$(GHC_STAGE2)
18 endif
19
20 EXCLUDED_C_SRCS += ghc-inplace.c
21
22 SRC_HC_OPTS += -package ghc
23 SRC_HC_OPTS += -Istage$(stage)
24 SRC_HC_OPTS += \
25   -cpp -fglasgow-exts -fno-generics -Rghc-timing \
26   -I. -IcodeGen -InativeGen -Iparser
27 SRC_HC_OPTS += $(GhcHcOpts) $(GhcStage$(stage)HcOpts)
28 ifeq "$(TargetOS_CPP)" "openbsd"
29 SRC_HC_OPTS += -optl-Xlinker -optl-E
30 endif
31
32 ifeq "$(GhcWithInterpreter)" "YES"
33 SRC_HC_OPTS += -DGHCI
34
35 # Should the debugger commands be enabled?
36 ifeq "$(GhciWithDebugger)" "YES"
37 SRC_HC_OPTS += -DDEBUGGER
38 endif
39
40 endif
41
42 ifeq "$(GhcThreaded)" "YES"
43 SRC_HC_OPTS += -threaded
44 endif
45 ifeq "$(GhcProfiled)" "YES"
46 SRC_HC_OPTS += -prof
47 endif
48 ifeq "$(GhcDebugged)" "YES"
49 SRC_LD_OPTS += -debug
50 endif
51
52 odir=stage$(stage)
53
54 HS_SRCS = main/Main.hs
55 HS_OBJS = $(patsubst %, $(odir)/%, $(addsuffix .$(way_)o,$(basename $(HS_SRCS))))
56 $(odir)/main/Main.o : libHSghc$(_way).a
57 SRC_HC_OPTS += -fforce-recomp
58 # can't rely on GHC's recompilation checking here, because it won't spot 
59 # changes in the ghc package.
60
61 include $(TOP)/mk/target.mk