ef55c320a0c61e4a3acc2eb5b607143cc92f67fc
[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 # We have two version: the inplace version compiled by the bootstrap compiler
14 #   and the install version compiled by the stage 1 compiler
15 ifeq "$(stage)" "2"
16 HS_PROG           = runghc$(exeext)
17 else
18 HS_PROG           = runghc-inplace$(exeext)
19 endif
20 INSTALL_PROGS   += $(HS_PROG)
21
22 UseGhcForCc = YES
23 SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
24
25 SRC_HC_OPTS += -Wall
26
27 RUNHASKELL_PROG = runhaskell$(exeext)
28 all :: $(RUNHASKELL_PROG)
29
30 $(RUNHASKELL_PROG) : $(HS_PROG)
31         $(CP) $< $(RUNHASKELL_PROG)
32
33 CLEAN_FILES += $(RUNHASKELL_PROG)
34
35 ifneq "$(NO_INSTALL_RUNHASKELL)" "YES"
36 INSTALL_PROGS += $(RUNHASKELL_PROG)
37 endif
38
39 binary-dist::
40         $(INSTALL_DIR)                $(BIN_DIST_DIR)/utils/runghc
41         $(INSTALL_DATA)    Makefile   $(BIN_DIST_DIR)/utils/runghc/
42         $(INSTALL_PROGRAM) $(HS_PROG) $(BIN_DIST_DIR)/utils/runghc/
43         $(INSTALL_PROGRAM) $(RUNHASKELL_PROG) $(BIN_DIST_DIR)/utils/runghc/
44
45 include $(TOP)/mk/target.mk