1 #-----------------------------------------------------------------------------
2 # $Id: Makefile.libHSrts,v 1.4 1997/01/21 09:15:23 sof 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
156 $(RTS_GHC) $(GHC_OPTS_$(suffix)) $*.hc
158 #-----------------------------------------------------------------------------
161 ifdef solaris2_TARGET_OS
162 __socket_libs = -lsocket -lnsl
169 gum/SysMan : gum/SysMan.mp_o gum/LLComms.mp_o main/Mallocs.o hooks/OutOfVM.o
171 $(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)
174 $(RM) gum/SysMan.mp_o gum/SysMan
176 install :: gum/SysMan
177 $(INSTALL) -c $(INSTBINFLAGS) gum/SysMan $(INSTLIBDIR_GHC)/SysMan
180 #-----------------------------------------------------------------------------
181 # creating and installing libHSrts.a (in its many flavors)
183 # Special pleading for way `norm', archive does not have _way appended, nor
184 # do the object files. -- SOF 1/97
186 ifeq ($(suffix), norm)
187 ARCHIVE = libHSrts.a # this one is special
189 ARCHIVE = libHSrts_$(suffix).a
192 ifeq ($(suffix), norm)
193 RTS_OBJS = $(RTS_LC:.lc=.o) $(RTS_LHC:.lhc=.o)
195 RTS_OBJS = $(RTS_LC:.lc=.$(suffix)_o) $(RTS_LHC:.lhc=.$(suffix)_o)
200 install :: $(RTS_LIB)
201 $(INSTALL) $(INSTLIBFLAGS) $(RTS_LIB) $(INSTLIBDIR_GHC)/$(RTS_LIB)
202 $(RANLIB) $(INSTLIBDIR_GHC)/$(RTS_LIB)
204 LIBOBJS = $(RTS_LC:.lc=.$(suffix)_o) $(RTS_LHC:.lhc=.$(suffix)_o)
205 DESTDIR = $(INSTLIBDIR_GHC)
207 MKDEPENDC_OPTS= -I$(GHC_INCLUDES)
208 C_DEP_SRCS = $(RTS_LC) $(RTS_LHC) $(CLIB_LC)
210 include $(TOP)/mk/lib.mk
212 #-----------------------------------------------------------------------------
214 c-as-asm/PerformIO_flags = -optc-DIN_GHC_RTS=1
215 gum/FetchMe_flags = -optc-DIN_GHC_RTS=1
216 main/StgStartup_flags = -optc-DIN_GHC_RTS=1
217 main/StgThreads_flags = -optc-DIN_GHC_RTS=1
218 main/StgUpdate_flags = -optc-DIN_GHC_RTS=1
219 storage/SMmark_flags = -optc-DIN_GHC_RTS=1 -optc-DMARK_REG_MAP
222 # /* this is not the way we should do this [WDP [lazy] 94/09] */
223 # CTagsTarget( $(RTS_LC) $($RTS_LHC) $(CLIB_LC) )
224 # CTagsTarget( gmp/[a-z]*.c )