Fix the build with GHC 6.4
[ghc-hetmet.git] / utils / runghc / Makefile
1 TOP=../..
2 include $(TOP)/mk/boilerplate.mk
3
4 # Beyond stage 1, honour any Mac OS X depolyment target options.  If we use 
5 # these options in stage 1 we get a linker error if the bootstrap compiler is
6 #  for a more recent OS version
7 ifeq "$(stage)" "2"
8 SRC_CC_OPTS += $(MACOSX_DEPLOYMENT_CC_OPTS)
9 SRC_HC_OPTS += $(addprefix -optc, $(MACOSX_DEPLOYMENT_CC_OPTS))
10 SRC_LD_OPTS += $(addprefix -optl, $(MACOSX_DEPLOYMENT_LD_OPTS))
11 endif
12
13 ifeq "$(ghc_ge_605)" "NO"
14 SRC_HC_OPTS += -cpp
15 endif
16
17 # We have two version: the inplace version compiled by the bootstrap compiler
18 #   and the install version compiled by the stage 1 compiler
19 ifeq "$(stage)" "2"
20 HS_PROG           = runghc$(exeext)
21 else
22 HS_PROG           = runghc-inplace$(exeext)
23 endif
24 INSTALL_PROGS   += $(HS_PROG)
25
26 UseGhcForCc = YES
27 SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
28
29 SRC_HC_OPTS += -Wall
30
31 RUNHASKELL_PROG = runhaskell$(exeext)
32 all :: $(RUNHASKELL_PROG)
33
34 $(RUNHASKELL_PROG) : $(HS_PROG)
35         $(CP) $< $(RUNHASKELL_PROG)
36
37 MOSTLY_CLEAN_FILES += $(RUNHASKELL_PROG)
38
39 ifneq "$(NO_INSTALL_RUNHASKELL)" "YES"
40 INSTALL_PROGS += $(RUNHASKELL_PROG)
41 endif
42
43 binary-dist::
44         $(INSTALL_DIR)                $(BIN_DIST_DIR)/utils/runghc
45         $(INSTALL_DATA)    Makefile   $(BIN_DIST_DIR)/utils/runghc/
46         $(INSTALL_PROGRAM) $(HS_PROG) $(BIN_DIST_DIR)/utils/runghc/
47         $(INSTALL_PROGRAM) $(RUNHASKELL_PROG) $(BIN_DIST_DIR)/utils/runghc/
48
49 include $(TOP)/mk/target.mk