1 #-----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.3 1997/03/14 07:59:40 simonpj Exp $
6 include $(TOP)/mk/boilerplate.mk
9 # The ways setup doesn't apply to the driver
28 # The driver needs to know the options and names for
29 # all possible ways, so we magically generate the
30 # the make variable names for them here.
33 WAY_NAMES = $(foreach way,$(ALL_WAYS),WAY_$(way)_NAME)
34 WAY_OPTS = $(foreach way,$(ALL_WAYS),WAY_$(way)_HC_OPTS)
36 ifeq "$(INSTALLING)" "1"
39 TOP_PWD := $(FPTOOLS_TOP_ABS)
42 SCRIPT_SUBST_VARS := \
44 PROJECTNAME PROJECTVERSION PROJECTPATCHLEVEL \
45 CURRENT_DIR TMPDIR HOSTPLATFORM TARGETPLATFORM \
46 GHC_LIB_DIR GHC_RUNTIME_DIR GHC_UTILS_DIR GHC_INCLUDE_DIR \
47 GHC_OPT_HILEV_ASM GhcWithNativeCodeGen LeadingUnderscore\
48 GHC_UNLIT GHC_HSCPP GHC_HSC GHC_SYSMAN \
49 CP RM PERL CONTEXT_DIFF \
50 $(WAY_NAMES) $(WAY_OPTS)
53 # When creating a binary distribution, we prefix the driver script
54 # with a short msg about what variables need to be set to get the
58 ifeq "$(BIN_DIST)" "1"
59 SCRIPT_PREFIX_FILES=prefix.txt
61 SCRIPT_SUBST_VARS += TOP_PWD INSTLIBDIR_GHC INSTDATADIR_GHC PERL
64 all :: $(DYN_LOADABLE_BITS)
68 # the driver goes in $(bindir), the perl script helpers
71 # ToDo: allow different install name for driver?
73 INSTALL_PROGS += $(SCRIPT_PROG)
74 INSTALL_LIBS += $(DYN_LOADABLE_BITS)
77 # Before really installing the driver, we have to
78 # reconfigure it such that the paths it refers to,
79 # point to the installed utils.
83 @$(MAKE) $(MFLAGS) INSTALLING=1 $(SCRIPT_PROG)
86 # depend setup: other directories need the driver script to compute
87 # their dependencies, so `depend' is simply an alias for `all' here.
93 CLEAN_FILES += $(SCRIPT_OBJS) $(DYN_LOADABLE_BITS)
98 SRC_DEST_FILES=$(patsubst %.prl,%.lprl,$(DYN_LOADABLE_BITS)) ghc.lprl ordering-passes test_mangler
100 include $(TOP)/mk/target.mk
102 # Hack to re-create the in-situ build tree driver script after
103 # having installed it.
106 @$(RM) $(SCRIPT_PROG)
107 @$(MAKE) $(MFLAGS) BIN_DIST=0 $(SCRIPT_PROG)
111 # Option vars for the special ways
116 WAY_p_HC_OPTS+=-fscc-profiling -DPROFILING -optc-DPROFILING
119 WAY_t_NAME+=ticky-ticky profiling
120 WAY_t_HC_OPTS=-fticky-ticky -DTICKY_TICKY -optc-DTICKY_TICKY
123 WAY_u_NAME=unregisterized (using portable C only)
126 # Way `mc': concurrent
127 WAY_mc_NAME=concurrent
128 WAY_mc_HC_OPTS+=-fstack-check -fconcurrent -D__CONCURRENT_HASKELL__ -DCONCURRENT -optcpp-D__CONCURRENT_HASKELL__ -optcpp-DCONCURRENT
131 WAY_mr_NAME=profiled concurrent
132 WAY_mr_HC_OPTS+=-fstack-check -fconcurrent -fscc-profiling -D__CONCURRENT_HASKELL__ -DCONCURRENT -DPROFILING -optcpp-D__CONCURRENT_HASKELL__ -optcpp-DCONCURRENT -optcpp-DPROFILING
135 WAY_mt_NAME=ticky-ticky concurrent
136 WAY_mt_HC_OPTS+=-fstack-check -fconcurrent -fticky-ticky -D__CONCURRENT_HASKELL__ -DCONCURRENT -DTICKY-TICKY -optc-D__CONCURRENT_HASKELL__ -optc-DCONCURRENT -optc-DTICKY_TICKY
140 WAY_mp_HC_OPTS+=-fstack-check -fconcurrent -D__PARALLEL_HASKELL__ -DPAR -optcpp-D__PARALLEL_HASKELL__ -optc-DPAR -optc-DCONCURRENT
144 # Q: is passing -D__GRANSIM__ and -DGRAN to hscpp needed?
146 WAY_mg_HC_OPTS+=-fstack-check -fconcurrent -fgransim -D__GRANSIM__ -DGRAN -optcpp-D__GRANSIM__ -optc-DGRAN -optc-D__CONCURRENT_HASKELL__ -optc-DCONCURRENT
149 # Ways for different garbage collectors
151 WAY_2s_NAME=2-space GC
152 WAY_2s_HC_OPTS+=-optc-DGC2s
154 WAY_1s_NAME=1-space GC
155 WAY_1s_HC_OPTS+=-optc-DGC1s
157 WAY_du_NAME=dual-mode GC
158 WAY_du_HC_OPTS+=-optc-DGCdu