[project @ 1999-04-27 10:59:29 by sewardj]
[ghc-hetmet.git] / ghc / interpreter / Makefile
1
2 # ----------------------------------------------------------------------------- #
3 # $Id: Makefile,v 1.8 1999/04/27 10:59:29 sewardj Exp $                         #
4 # ----------------------------------------------------------------------------- #
5
6 TOP = ../..
7 include $(TOP)/mk/boilerplate.mk
8
9 GHC_DIR = $(TOP)/ghc
10 RTS_DIR = $(TOP)/ghc/rts
11
12 # --------------------------------------------------------------------- #
13 # interpreter and relevant .a/.so files                                 #
14 # --------------------------------------------------------------------- #
15
16 YACC = bison -y
17 %.c: %.y
18         -$(YACC) $<
19         mv y.tab.c $@
20
21
22 HS_SRCS =
23
24 Y_SRCS = parser.y
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 sainteger.c
28
29 SRC_CC_OPTS = -O2 -g -I$(GHC_DIR)/interpreter -I$(GHC_DIR)/includes -I$(GHC_DIR)/rts -D__HUGS__ -DCOMPILING_RTS -Wall -Wstrict-prototypes -Wno-unused
30
31 GHC_LIBS_NEEDED = $(TOP)/ghc/rts/libHSrts.a
32
33 all :: parser.c $(GHC_LIBS_NEEDED) nHandle.so hugs
34
35 ### EXTREMELY hacky
36 hugs: $(C_OBJS) ../rts/Sanity.o ../rts/Assembler.o ../rts/Disassembler.o \
37       ../rts/Evaluator.o ../rts/ForeignCall.o ../rts/GC.o ../rts/Printer.o \
38       nHandle.so
39         $(CC) -o $@ -rdynamic $(CC_OPTS) $^ $(GHC_LIBS_NEEDED) -lbfd -liberty -ldl -lm
40
41 nHandle.so:
42         gcc -O -fPIC -shared -o nHandle.so nHandle.c
43
44 $(TOP)/ghc/rts/libHSrts.a:
45         (cd $(TOP)/ghc/rts ; make clean ; make EXTRA_CC_OPTS=-I$(GHC_DIR)/interpreter)
46
47 cleanish:
48         /bin/rm *.o
49
50 snapshot:
51         /bin/rm -f snapshot.tar
52         tar cvf snapshot.tar Makefile *.[chy] *-ORIG-* \
53              ../rts/Assembler.c ../rts/Evaluator.c ../rts/Disassembler.c \
54              ../rts/ForeignCall.c ../rts/Printer.c ../rts/QueueTemplate.h \
55              ../includes/options.h ../includes/Assembler.h nHandle.c \
56              ../includes/Assembler.h ../rts/Bytecodes.h ../includes/ClosureMacros.h \
57              lib/*.hs runnofib runallnofib
58
59
60 # --------------------------------------------------------------------- #
61 # Testing                                                               #
62 # --------------------------------------------------------------------- #
63
64 check :: all
65         ./test/runtests test/static/*.hs
66         ./test/runtests test/typechecker/*.hs
67         ./test/runtests test/runtime/*.hs
68         ./test/runtests test/std/*.hs
69         ./test/runtests test/exts/*.hs
70
71 checkrun: all
72         ./test/runtests test/runtime/*.hs
73         ./test/runtests test/std/*.hs
74         ./test/runtests test/exts/*.hs
75
76 # --------------------------------------------------------------------- #
77 # Cleanery & misc                                                       #
78 # --------------------------------------------------------------------- #
79
80 CLEAN_FILES += hugs nHandle.so
81 CLEAN_FILES += $(TOP)/ghc/rts/libHSrts.a $(TOP)/ghc/rts/*.o
82 CLEAN_FILES += parser.c
83
84 INSTALL_LIBEXECS = hugs
85
86 depend :: $(LOOPS) $(SRCS_UGNHS)
87
88
89 include $(TOP)/mk/target.mk
90
91