1 #-----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.2 1996/11/21 16:48:17 simonm Exp $
4 # This is the Makefile for the runtime-system stuff.
5 # This stuff is written in C (and cannot be written in Haskell).
7 # Things are organised into exactly one level of subdirs.
9 # At the moment, there are a few such subdirs:
10 # c-as-asm -- mini-interpreter & register hackery
11 # gum -- GUM-specific stuff
12 # main -- "main", associated startup stuff, & MISC things
13 # prims -- code for primitives that must be written in C
14 # profiling -- cost-centre profiling
15 # storage -- the storage manager(s)
17 # We create two libraries. One, libHSrts<tag>.a, is built separately
18 # for each "build". The other, libHSclib.a is built once: it is just
19 # .lc files that end up the same no matter what, i.e. completely
22 # Other sorta independent, compile-once subdirs are:
24 # gmp -- GNU multi-precision library (for Integer)
26 #-----------------------------------------------------------------------------
29 SuffixRules_WantStdOnes = NO
30 UnlitSuffixRules = YES_PLEASE
31 include $(TOP)/ghc/mk/ghc.mk
34 include $(TOP)/mk/subdir.mk
36 # If you use EXTRA_HC_OPTS on the command line (which you shouldn't,
37 # strictly speaking), it will probably work -- it is pinned onto
38 # GHC_OPTS, just for fun.
40 GHC_OPTS = $(EXTRA_HC_OPTS)
42 # per-build options: shared with libraries
44 include ../mk/buildflags.mk
46 #-----------------------------------------------------------------------------
47 # knock the "clib" (completely ordinary C, compiled once)
48 # stuff over the head first...
52 hooks/FreeForeignObj.lc \
56 hooks/NoRunnableThrds.lc \
57 hooks/PatErrorHdr.lc \
64 LIBOBJS = $(CLIB_LC:.lc=.o)
65 DESTDIR = $(INSTLIBDIR_GHC)
67 include $(TOP)/mk/lib.mk
69 #-----------------------------------------------------------------------------
70 # Rules for building various types of objects from C files
72 RTS_GHC = $(GHC) -c -o $@ $(GHCFLAGS) $($*_flags)
78 #-----------------------------------------------------------------------------
81 all :: main/TopClosure.o
84 $(RM) main/TopClosure.o
86 install :: main/TopClosure.o
87 $(INSTALL) $(INSTLIBFLAGS) main/TopClosure.o $(INSTLIBDIR_GHC)/TopClosure.o
89 #-----------------------------------------------------------------------------
90 # libHSrts.a, in several different 'ways'
93 @for i in $(WAY_SUFFIXES); do \
95 echo =========== Making runtime system for way $$i; \
97 $(MAKE) -f Makefile.libHSrts suffix=$$i; \
101 @for i in $(WAY_SUFFIXES); do \
102 $(MAKE) -f Makefile.libHSrts suffix=$$i install; \
106 @$(MAKE) -f Makefile.libHSrts clean
107 @for i in $(WAY_SUFFIXES); do \
108 $(MAKE) -f Makefile.libHSrts suffix=$$i cleanobj; \
111 # Dependencies are done by Makefile.libHSrts
114 @$(MAKE) -f Makefile.libHSrts depend