2 # --------------------------------------------------------------------------- #
3 # $Id: Makefile,v 1.30 2000/04/03 17:27:10 sewardj Exp $ #
4 # --------------------------------------------------------------------------- #
7 include $(TOP)/mk/boilerplate.mk
10 # --------------------------------------------------------------------- #
11 # interpreter and relevant .a/.so files #
12 # --------------------------------------------------------------------- #
14 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
22 ifeq "$(HaveLibReadline)$" "YES"
23 LIB_READLINE=-lreadline -ltermcap
28 ifeq "$(HaveLibGmp)$" "YES"
31 LIB_GMP=../rts/gmp/libgmp.a
43 C_SRCS = link.c type.c static.c storage.c derive.c input.c compiler.c subst.c \
44 translate.c codegen.c lift.c free.c stgSubst.c output.c \
45 hugs.c dynamic.c stg.c sainteger.c object.c interface.c
47 SRC_CC_OPTS = -g -I$(GHC_INTERPRETER_DIR) -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR) -D__HUGS__ -DCOMPILING_RTS -Wall -Wstrict-prototypes -Wno-unused -DDEBUG -Winline
49 GHC_LIBS_NEEDED = $(GHC_RUNTIME_DIR)/libHSrts.a
51 all :: parser.c $(GHC_LIBS_NEEDED) nHandle$(DYN_EXT) hugs
54 hugs: $(C_OBJS) ../rts/Sanity.o ../rts/Assembler.o ../rts/Disassembler.o \
55 ../rts/Evaluator.o ../rts/ForeignCall.o ../rts/GC.o ../rts/Printer.o \
56 ../rts/StgCRun.o ../rts/PrimOps.o ../rts/Prelude.o ../rts/libHSrts.a
57 $(CC) -o $@ $(CC_OPTS) $^ $(GHC_LIBS_NEEDED) \
58 -lbfd -liberty $(LIB_READLINE) $(LIB_DL) \
62 rm -f ../rts/libHSrts.a ../rts/libHSrts_u.a
63 rm -f ../rts/StgCRun.o ../rts/StgCRun.u_o
66 nHandle$(DYN_EXT): nHandle.c
67 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
68 gcc -mno-cygwin -O -Wall -o nHandle.o -c nHandle.c
69 dllwrap -mno-cygwin --target=i386-mingw32 -o nHandle.dll \
70 -def nHandle.def nHandle.o
72 gcc -O -Wall -shared -fPIC -o nHandle.so nHandle.c
75 $(GHC_RUNTIME_DIR)/libHSrts.a:
76 (cd $(GHC_RUNTIME_DIR) ; make clean ; make EXTRA_CC_OPTS=-I$(GHC_INTERPRETER_DIR))
81 (cd $(GHC_RUNTIME_DIR) ; make clean)
84 tar cvzf stghugs.tar.gz hugs$(exeext) nHandle$(DYN_EXT) lib/*lhs lib/Prelude.hs
87 /bin/rm -f snapshot.tar
88 tar cvf snapshot.tar Makefile *.[chy] \
89 ../rts/Assembler.c ../rts/Evaluator.c ../rts/Disassembler.c \
90 ../rts/ForeignCall.c ../rts/Printer.c ../rts/QueueTemplate.h \
91 ../includes/options.h ../includes/Assembler.h nHandle.c \
92 ../includes/Assembler.h ../rts/Bytecodes.h ../includes/ClosureMacros.h \
93 lib/*.hs runnofib runallnofib
96 # --------------------------------------------------------------------- #
98 # --------------------------------------------------------------------- #
101 ./test/runtests test/static/*.hs
102 ./test/runtests test/typechecker/*.hs
103 ./test/runtests test/runtime/*.hs
104 ./test/runtests test/std/*.hs
105 ./test/runtests test/exts/*.hs
108 ./test/runtests test/runtime/*.hs
109 ./test/runtests test/std/*.hs
110 ./test/runtests test/exts/*.hs
112 # --------------------------------------------------------------------- #
114 # --------------------------------------------------------------------- #
116 CLEAN_FILES += hugs nHandle.dll
117 CLEAN_FILES += $(TOP)/ghc/rts/libHSrts.a $(TOP)/ghc/rts/*.o
118 CLEAN_FILES += parser.c
120 INSTALL_LIBEXECS = hugs
122 depend :: $(LOOPS) $(SRCS_UGNHS)
125 include $(TOP)/mk/target.mk