#----------------------------------------------------------------------------- # $Id: Makefile.libHSrts,v 1.2 1996/11/21 16:48:19 simonm Exp $ # The is the makefile for libHSrts, invoked once for each different build. # The variable $(suffix) defines the current build. # To make libHSrts for a specific build, you can do # make -f Makefile.libHSrts suffix= #----------------------------------------------------------------------------- TOP=../.. SuffixRules_WantStdOnes = NO UnlitSuffixRules = YES_PLEASE include $(TOP)/ghc/mk/ghc.mk # If you use EXTRA_HC_OPTS on the command line (which you shouldn't, # strictly speaking), it will probably work -- it is pinned onto # GHC_OPTS, just for fun. GHC_OPTS = $(EXTRA_HC_OPTS) # per-build options: shared with libraries DoingRTS = YES include ../mk/buildflags.mk #----------------------------------------------------------------------------- # what it is we are compiling; # these are long and tedious lists, but c'est la guerre RTS_LH = \ storage/SMmarkDefs.lh \ storage/SMcopying.lh \ storage/SMcompacting.lh \ storage/SMextn.lh \ storage/SMinternal.lh RTS_LC = \ c-as-asm/CallWrap_C.lc \ c-as-asm/HpOverflow.lc \ c-as-asm/StablePtr.lc \ c-as-asm/StablePtrOps.lc \ c-as-asm/StgDebug.lc \ c-as-asm/StgMiniInt.lc \ gum/GlobAddr.lc \ gum/HLComms.lc \ gum/Hash.lc \ gum/LLComms.lc \ gum/Pack.lc \ gum/ParInit.lc \ gum/RBH.lc \ gum/Sparks.lc \ gum/Unpack.lc \ main/GranSim.lc \ main/Itimer.lc \ main/Ticky.lc \ main/SMRep.lc \ main/Select.lc \ main/Signals.lc \ main/StgOverflow.lc \ main/Threads.lc \ main/RtsFlags.lc \ main/main.lc \ prims/PrimArith.lc \ prims/PrimMisc.lc \ profiling/CostCentre.lc \ profiling/Hashing.lc \ profiling/HeapProfile.lc \ profiling/Indexing.lc \ profiling/Timer.lc \ storage/SM1s.lc \ storage/SM2s.lc \ storage/SMap.lc \ storage/SMcheck.lc \ storage/SMcompacting.lc \ storage/SMcopying.lc \ storage/SMdu.lc \ storage/SMevac.lc \ storage/SMextn.lc \ storage/SMinit.lc \ storage/SMmarking.lc \ storage/SMscan.lc \ storage/SMscav.lc \ storage/SMstacks.lc \ storage/SMstatic.lc \ storage/SMstats.lc \ storage/mprotect.lc # LATER?: storage/SMgen.lc RTS_LHC = \ main/StgStartup.lhc \ main/StgUpdate.lhc \ main/StgThreads.lhc \ c-as-asm/PerformIO.lhc \ storage/SMmark.lhc \ gum/FetchMe.lhc CLIB_LC = \ hooks/ErrorHdr.lc \ hooks/FreeForeignObj.lc \ hooks/OutOfHeap.lc \ hooks/OutOfStk.lc \ hooks/OutOfVM.lc \ hooks/NoRunnableThrds.lc \ hooks/PatErrorHdr.lc \ hooks/TraceHooks.lc \ hooks/SizeHooks.lc \ hooks/InitEachPE.lc \ main/Mallocs.lc CLIB_LC = \ hooks/ErrorHdr.lc \ hooks/FreeForeignObj.lc \ hooks/OutOfHeap.lc \ hooks/OutOfStk.lc \ hooks/OutOfVM.lc \ hooks/NoRunnableThrds.lc \ hooks/PatErrorHdr.lc \ hooks/TraceHooks.lc \ hooks/SizeHooks.lc \ hooks/InitEachPE.lc \ main/Mallocs.lc H_FILES = $(RTS_LH:.lh=.h) C_FILES = $(RTS_LC:.lc=.c) $(RTS_LHC:.lhc=.hc) $(CLIB_LC:.lc=.c) # Header files all depend :: $(H_FILES) clean :: $(RM) $(H_FILES) $(RM) $(C_FILES) #----------------------------------------------------------------------------- # Rules for building various types of objects from C files RTS_GHC = $(GHC) -c -o $@ $(GHCFLAGS) $($*_flags) %.o : %.c @$(RM) $@ $(RTS_GHC) $*.c %.$(suffix)_o : %.c @$(RM) $@ $(RTS_GHC) $(GHC_OPTS_$(suffix)) $*.c %.$(suffix)_o : %.hc @$(RM) $@ $(RTS_GHC) $(GHC_OPTS_$(suffix)) $*.hc #----------------------------------------------------------------------------- ifeq ($(suffix), mp) ifdef solaris2_TARGET_OS __socket_libs = -lsocket -lnsl else __socket_libs = endif all :: gum/SysMan gum/SysMan : gum/SysMan.mp_o gum/LLComms.mp_o main/Mallocs.o hooks/OutOfVM.o $(RM) $@ $(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) clean :: $(RM) gum/SysMan.mp_o gum/SysMan install :: gum/SysMan $(INSTALL) -c $(INSTBINFLAGS) gum/SysMan $(INSTLIBDIR_GHC)/SysMan endif #----------------------------------------------------------------------------- # creating and installing libHSrts.a (in its many flavors) ifeq ($(suffix), norm) RTS_LIB = libHSrts.a # this one is special else RTS_LIB = libHSrts_$(suffix).a endif RTS_OBJS = $(RTS_LC:.lc=.$(suffix)_o) $(RTS_LHC:.lhc=.$(suffix)_o) all :: $(RTS_LIB) install :: $(RTS_LIB) $(INSTALL) $(INSTLIBFLAGS) $(RTS_LIB) $(INSTLIBDIR_GHC)/$(RTS_LIB) $(RANLIB) $(INSTLIBDIR_GHC)/$(RTS_LIB) cleanobj :: $(RM) $(RTS_OBJS) $(RM) $(RTS_LIB) $(RTS_LIB) :: $(H_FILES) $(RTS_OBJS) $(RM) $@ $(AR) $@ $(RTS_OBJS) $(RANLIB) $@ c-as-asm/PerformIO_flags = -optc-DIN_GHC_RTS=1 gum/FetchMe_flags = -optc-DIN_GHC_RTS=1 main/StgStartup_flags = -optc-DIN_GHC_RTS=1 main/StgThreads_flags = -optc-DIN_GHC_RTS=1 main/StgUpdate_flags = -optc-DIN_GHC_RTS=1 storage/SMmark_flags = -optc-DIN_GHC_RTS=1 -optc-DMARK_REG_MAP # ToDo: # /* this is not the way we should do this [WDP [lazy] 94/09] */ # CTagsTarget( $(RTS_LC) $($RTS_LHC) $(CLIB_LC) ) # CTagsTarget( gmp/[a-z]*.c ) #----------------------------------------------------------------------------- # Do dependencies MKDEPENDC_OPTS= -I$(GHC_INCLUDES) C_DEP_SRCS = $(RTS_LC) $(RTS_LHC) $(CLIB_LC) include $(TOP)/mk/cdepend.mk