[project @ 1999-10-15 11:02:06 by sewardj]
[ghc-hetmet.git] / ghc / interpreter / Makefile
1
2 # ----------------------------------------------------------------------------- #
3 # $Id: Makefile,v 1.11 1999/10/15 11:02:09 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         rm -f input.o
21
22
23 HS_SRCS =
24
25 Y_SRCS = parser.y
26 C_SRCS = link.c type.c static.c storage.c derive.c input.c compiler.c subst.c \
27      translate.c codegen.c lift.c free.c stgSubst.c optimise.c output.c   \
28      hugs.c dynamic.c stg.c sainteger.c interface.c
29
30 SRC_CC_OPTS = -g -O -I$(GHC_DIR)/interpreter -I$(GHC_DIR)/includes -I$(GHC_DIR)/rts -D__HUGS__ -DCOMPILING_RTS -Wall -Wstrict-prototypes -Wno-unused -DDEBUG -DDEBUG_EXTRA -Winline
31
32 GHC_LIBS_NEEDED = $(TOP)/ghc/rts/libHSrts.a
33
34 all :: parser.c $(GHC_LIBS_NEEDED) nHandle.so hugs
35
36 ### EXTREMELY hacky
37 hugs: $(C_OBJS) ../rts/Sanity.o ../rts/Assembler.o ../rts/Disassembler.o \
38       ../rts/Evaluator.o ../rts/ForeignCall.o ../rts/GC.o ../rts/Printer.o \
39       ../rts/StgCRun.o nHandle.so
40         $(CC) -o $@ -rdynamic $(CC_OPTS) $^ $(GHC_LIBS_NEEDED) -lbfd -liberty -ldl -lm
41
42 nHandle.so: nHandle.c
43         gcc -O -fPIC -shared -o nHandle.so nHandle.c
44
45 $(TOP)/ghc/rts/libHSrts.a:
46         (cd $(TOP)/ghc/rts ; make clean ; make EXTRA_CC_OPTS=-I$(GHC_DIR)/interpreter)
47
48 cleanish:
49         /bin/rm *.o
50
51 snapshot:
52         /bin/rm -f snapshot.tar
53         tar cvf snapshot.tar Makefile *.[chy] \
54              ../rts/Assembler.c ../rts/Evaluator.c ../rts/Disassembler.c \
55              ../rts/ForeignCall.c ../rts/Printer.c ../rts/QueueTemplate.h \
56              ../includes/options.h ../includes/Assembler.h nHandle.c \
57              ../includes/Assembler.h ../rts/Bytecodes.h ../includes/ClosureMacros.h \
58              lib/*.hs runnofib runallnofib
59
60
61 # --------------------------------------------------------------------- #
62 # Testing                                                               #
63 # --------------------------------------------------------------------- #
64
65 check :: all
66         ./test/runtests test/static/*.hs
67         ./test/runtests test/typechecker/*.hs
68         ./test/runtests test/runtime/*.hs
69         ./test/runtests test/std/*.hs
70         ./test/runtests test/exts/*.hs
71
72 checkrun: all
73         ./test/runtests test/runtime/*.hs
74         ./test/runtests test/std/*.hs
75         ./test/runtests test/exts/*.hs
76
77 # --------------------------------------------------------------------- #
78 # Cleanery & misc                                                       #
79 # --------------------------------------------------------------------- #
80
81 CLEAN_FILES += hugs nHandle.so
82 CLEAN_FILES += $(TOP)/ghc/rts/libHSrts.a $(TOP)/ghc/rts/*.o
83 CLEAN_FILES += parser.c
84
85 INSTALL_LIBEXECS = hugs
86
87 depend :: $(LOOPS) $(SRCS_UGNHS)
88
89
90 include $(TOP)/mk/target.mk
91
92