2 # ----------------------------------------------------------------------------- #
3 # $Id: Makefile,v 1.6 1999/03/09 14:51:03 sewardj Exp $ #
4 # ----------------------------------------------------------------------------- #
7 include $(TOP)/mk/boilerplate.mk
10 RTS_DIR = $(TOP)/ghc/rts
12 # --------------------------------------------------------------------- #
13 # interpreter and relevant .a/.so files #
14 # --------------------------------------------------------------------- #
25 C_SRCS = link.c type.c static.c storage.c derive.c input.c compiler.c subst.c \
26 translate.c codegen.c lift.c free.c stgSubst.c optimise.c output.c \
27 hugs.c dynamic.c stg.c
29 SRC_CC_OPTS = -O2 -Winline -g -I$(GHC_DIR)/includes -I$(GHC_DIR)/rts -D__HUGS__ -Wall -Wstrict-prototypes
31 GHC_LIBS_NEEDED = $(TOP)/ghc/rts/libHSrts.a $(TOP)/ghc/rts/gmp/libgmp.a
32 GHC_DYN_CBITS_DIR = $(TOP)/ghc/lib/std/cbits
33 GHC_DYN_CBITS = $(GHC_DYN_CBITS_DIR)/libHS_cbits.so
35 all :: parser.c $(GHC_LIBS_NEEDED) $(GHC_DYN_CBITS) hugs
38 hugs: $(C_OBJS) ../rts/Sanity.o ../rts/Assembler.o ../rts/Disassembler.o ../rts/Evaluator.o ../rts/ForeignCall.o ../rts/GC.o \
40 $(CC) -o $@ $(CC_OPTS) $^ $(GHC_LIBS_NEEDED) -lbfd -liberty -ldl -lm
43 ### (cd $(GHC_DYN_CBITS_DIR); make EXTRA_CC_OPTS="-fpic -optc-g" ; gcc -shared -o libHS_cbits.so *.o)
44 (cd $(GHC_DYN_CBITS_DIR); rm -f *.o ; gcc -I../../../includes -fPIC -g -Wall -c *.c ; gcc -shared -o libHS_cbits.so *.o)
45 cp -f $(GHC_DYN_CBITS) .
47 $(TOP)/ghc/rts/libHSrts.a:
48 (cd $(TOP)/ghc/rts ; make clean ; make)
49 $(TOP)/ghc/rts/gmp/libgmp.a:
50 (cd $(TOP)/ghc/rts/gmp ; make clean ; make)
56 /bin/rm -f snapshot.tar
57 tar cvf snapshot.tar Makefile *.[chy] *-ORIG-* \
58 ../rts/Assembler.c ../rts/Evaluator.c ../rts/Disassembler.c \
59 ../rts/ForeignCall.c ../rts/Printer.c \
60 ../includes/options.h ../includes/Assembler.h nHandle.c \
61 ../includes/Assembler.h ../rts/Bytecodes.h \
65 # --------------------------------------------------------------------- #
67 # --------------------------------------------------------------------- #
70 ./test/runtests test/static/*.hs
71 ./test/runtests test/typechecker/*.hs
72 ./test/runtests test/runtime/*.hs
73 ./test/runtests test/std/*.hs
74 ./test/runtests test/exts/*.hs
77 ./test/runtests test/runtime/*.hs
78 ./test/runtests test/std/*.hs
79 ./test/runtests test/exts/*.hs
81 # --------------------------------------------------------------------- #
83 # --------------------------------------------------------------------- #
85 CLEAN_FILES += hugs libHS_cbits.so $(GHC_DYN_CBITS) $(GHC_DYN_CBITS_DIR)/*.o
86 CLEAN_FILES += $(TOP)/ghc/rts/libHSrts.a $(TOP)/ghc/rts/*.o
87 CLEAN_FILES += $(TOP)/ghc/rts/gmp/libgmp.a $(TOP)/ghc/rts/gmp/*.o $(TOP)/ghc/rts/gmp/*/*.o
88 CLEAN_FILES += parser.c
90 INSTALL_LIBEXECS = hugs
92 depend :: $(LOOPS) $(SRCS_UGNHS)
95 include $(TOP)/mk/target.mk