2 # ----------------------------------------------------------------------------- #
3 # $Id: Makefile,v 1.15 1999/11/01 02:41:04 andy Exp $ #
4 # ----------------------------------------------------------------------------- #
7 include $(TOP)/mk/boilerplate.mk
10 RTS_DIR = $(TOP)/ghc/rts
12 # --------------------------------------------------------------------- #
13 # interpreter and relevant .a/.so files #
14 # --------------------------------------------------------------------- #
16 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
33 C_SRCS = link.c type.c static.c storage.c derive.c input.c compiler.c subst.c \
34 translate.c codegen.c lift.c free.c stgSubst.c optimise.c output.c \
35 hugs.c dynamic.c stg.c sainteger.c interface.c
37 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
39 GHC_LIBS_NEEDED = $(TOP)/ghc/rts/libHSrts.a
41 all :: parser.c $(GHC_LIBS_NEEDED) nHandle.$(DYN_EXT) hugs
44 hugs: $(C_OBJS) ../rts/Sanity.o ../rts/Assembler.o ../rts/Disassembler.o \
45 ../rts/Evaluator.o ../rts/ForeignCall.o ../rts/GC.o ../rts/Printer.o \
47 $(CC) -o $@ $(CC_OPTS) $^ $(GHC_LIBS_NEEDED) -lbfd -liberty $(LIB_DL) -lm
49 nHandle.$(DYN_EXT): nHandle.c
50 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
51 gcc -mno-cygwin -O -Wall -o nHandle.o -c nHandle.c
52 dllwrap -mno-cygwin --target=i386-mingw32 -o nHandle.dll \
53 -def nHandle.def nHandle.o
55 gcc -O -Wall -shared -fPIC -o nHandle.so nHandle.c
58 $(TOP)/ghc/rts/libHSrts.a:
59 (cd $(TOP)/ghc/rts ; make clean ; make EXTRA_CC_OPTS=-I$(GHC_DIR)/interpreter)
65 /bin/rm -f snapshot.tar
66 tar cvf snapshot.tar Makefile *.[chy] \
67 ../rts/Assembler.c ../rts/Evaluator.c ../rts/Disassembler.c \
68 ../rts/ForeignCall.c ../rts/Printer.c ../rts/QueueTemplate.h \
69 ../includes/options.h ../includes/Assembler.h nHandle.c \
70 ../includes/Assembler.h ../rts/Bytecodes.h ../includes/ClosureMacros.h \
71 lib/*.hs runnofib runallnofib
74 # --------------------------------------------------------------------- #
76 # --------------------------------------------------------------------- #
79 ./test/runtests test/static/*.hs
80 ./test/runtests test/typechecker/*.hs
81 ./test/runtests test/runtime/*.hs
82 ./test/runtests test/std/*.hs
83 ./test/runtests test/exts/*.hs
86 ./test/runtests test/runtime/*.hs
87 ./test/runtests test/std/*.hs
88 ./test/runtests test/exts/*.hs
90 # --------------------------------------------------------------------- #
92 # --------------------------------------------------------------------- #
94 CLEAN_FILES += hugs nHandle.dll
95 CLEAN_FILES += $(TOP)/ghc/rts/libHSrts.a $(TOP)/ghc/rts/*.o
96 CLEAN_FILES += parser.c
98 INSTALL_LIBEXECS = hugs
100 depend :: $(LOOPS) $(SRCS_UGNHS)
103 include $(TOP)/mk/target.mk
105 HUGSCPP = ../utils/hscpp/hscpp -D__HUGS__ -DUSE_REPORT_PRELUDE
108 $(HUGSCPP) ../lib/std/List.lhs > lib/List.lhs
109 $(HUGSCPP) ../lib/std/Ix.lhs > lib/Ix.lhs
110 $(HUGSCPP) ../lib/std/Complex.lhs > lib/Complex.lhs
111 $(HUGSCPP) ../lib/std/Char.lhs > lib/Char.lhs
112 $(HUGSCPP) ../lib/std/Ratio.lhs > lib/Ratio.lhs
113 $(HUGSCPP) ../lib/std/Random.lhs > lib/Random.lhs
114 $(HUGSCPP) ../lib/std/Array.lhs > lib/Array.lhs
115 $(HUGSCPP) ../lib/std/Maybe.lhs > lib/Maybe.lhs
116 $(HUGSCPP) ../lib/std/Monad.lhs > lib/Monad.lhs
117 $(HUGSCPP) ../lib/std/Numeric.lhs > lib/Numeric.lhs
118 $(HUGSCPP) ../lib/std/Directory.lhs > lib/Directory.lhs
119 $(HUGSCPP) ../lib/std/System.lhs > lib/System.lhs
120 $(HUGSCPP) ../lib/std/Locale.lhs > lib/Locale.lhs
121 $(HUGSCPP) ../lib/std/CPUTime.lhs > lib/CPUTime.lhs
122 $(HUGSCPP) ../lib/std/IO.lhs > lib/IO.lhs