1 #-----------------------------------------------------------------------------
2 # $Id: Makefile.libHSrts,v 1.2 1996/11/21 16:48:19 simonm Exp $
4 # The is the makefile for libHSrts, invoked once for each different build.
6 # The variable $(suffix) defines the current build.
8 # To make libHSrts for a specific build, you can do
9 # make -f Makefile.libHSrts suffix=<build>
11 #-----------------------------------------------------------------------------
14 SuffixRules_WantStdOnes = NO
15 UnlitSuffixRules = YES_PLEASE
16 include $(TOP)/ghc/mk/ghc.mk
18 # If you use EXTRA_HC_OPTS on the command line (which you shouldn't,
19 # strictly speaking), it will probably work -- it is pinned onto
20 # GHC_OPTS, just for fun.
22 GHC_OPTS = $(EXTRA_HC_OPTS)
24 # per-build options: shared with libraries
26 include ../mk/buildflags.mk
28 #-----------------------------------------------------------------------------
29 # what it is we are compiling;
30 # these are long and tedious lists, but c'est la guerre
33 storage/SMmarkDefs.lh \
34 storage/SMcopying.lh \
35 storage/SMcompacting.lh \
40 c-as-asm/CallWrap_C.lc \
41 c-as-asm/HpOverflow.lc \
42 c-as-asm/StablePtr.lc \
43 c-as-asm/StablePtrOps.lc \
44 c-as-asm/StgDebug.lc \
45 c-as-asm/StgMiniInt.lc \
67 profiling/CostCentre.lc \
68 profiling/Hashing.lc \
69 profiling/HeapProfile.lc \
70 profiling/Indexing.lc \
76 storage/SMcompacting.lc \
77 storage/SMcopying.lc \
82 storage/SMmarking.lc \
90 # LATER?: storage/SMgen.lc
96 c-as-asm/PerformIO.lhc \
102 hooks/FreeForeignObj.lc \
106 hooks/NoRunnableThrds.lc \
107 hooks/PatErrorHdr.lc \
108 hooks/TraceHooks.lc \
110 hooks/InitEachPE.lc \
115 hooks/FreeForeignObj.lc \
119 hooks/NoRunnableThrds.lc \
120 hooks/PatErrorHdr.lc \
121 hooks/TraceHooks.lc \
123 hooks/InitEachPE.lc \
126 H_FILES = $(RTS_LH:.lh=.h)
127 C_FILES = $(RTS_LC:.lc=.c) $(RTS_LHC:.lhc=.hc) $(CLIB_LC:.lc=.c)
131 all depend :: $(H_FILES)
137 #-----------------------------------------------------------------------------
138 # Rules for building various types of objects from C files
140 RTS_GHC = $(GHC) -c -o $@ $(GHCFLAGS) $($*_flags)
148 $(RTS_GHC) $(GHC_OPTS_$(suffix)) $*.c
152 $(RTS_GHC) $(GHC_OPTS_$(suffix)) $*.hc
154 #-----------------------------------------------------------------------------
157 ifdef solaris2_TARGET_OS
158 __socket_libs = -lsocket -lnsl
165 gum/SysMan : gum/SysMan.mp_o gum/LLComms.mp_o main/Mallocs.o hooks/OutOfVM.o
167 $(CC) -o $@ gum/SysMan.mp_o gum/LLComms.mp_o main/Mallocs.o hooks/OutOfVM.o -L$$PVM_ROOT/lib/$$PVM_ARCH -lpvm3 -lgpvm3 $(__socket_libs)
170 $(RM) gum/SysMan.mp_o gum/SysMan
172 install :: gum/SysMan
173 $(INSTALL) -c $(INSTBINFLAGS) gum/SysMan $(INSTLIBDIR_GHC)/SysMan
176 #-----------------------------------------------------------------------------
177 # creating and installing libHSrts.a (in its many flavors)
179 ifeq ($(suffix), norm)
180 RTS_LIB = libHSrts.a # this one is special
182 RTS_LIB = libHSrts_$(suffix).a
185 RTS_OBJS = $(RTS_LC:.lc=.$(suffix)_o) $(RTS_LHC:.lhc=.$(suffix)_o)
189 install :: $(RTS_LIB)
190 $(INSTALL) $(INSTLIBFLAGS) $(RTS_LIB) $(INSTLIBDIR_GHC)/$(RTS_LIB)
191 $(RANLIB) $(INSTLIBDIR_GHC)/$(RTS_LIB)
197 $(RTS_LIB) :: $(H_FILES) $(RTS_OBJS)
202 c-as-asm/PerformIO_flags = -optc-DIN_GHC_RTS=1
203 gum/FetchMe_flags = -optc-DIN_GHC_RTS=1
204 main/StgStartup_flags = -optc-DIN_GHC_RTS=1
205 main/StgThreads_flags = -optc-DIN_GHC_RTS=1
206 main/StgUpdate_flags = -optc-DIN_GHC_RTS=1
207 storage/SMmark_flags = -optc-DIN_GHC_RTS=1 -optc-DMARK_REG_MAP
210 # /* this is not the way we should do this [WDP [lazy] 94/09] */
211 # CTagsTarget( $(RTS_LC) $($RTS_LHC) $(CLIB_LC) )
212 # CTagsTarget( gmp/[a-z]*.c )
214 #-----------------------------------------------------------------------------
217 MKDEPENDC_OPTS= -I$(GHC_INCLUDES)
219 C_DEP_SRCS = $(RTS_LC) $(RTS_LHC) $(CLIB_LC)
220 include $(TOP)/mk/cdepend.mk