2 # --------------------------------------------------------------------------- #
3 # $Id: Makefile,v 1.37 2000/05/26 10:14:33 sewardj Exp $ #
4 # --------------------------------------------------------------------------- #
7 include $(TOP)/mk/boilerplate.mk
10 # --------------------------------------------------------------------- #
11 # interpreter and relevant .a/.so files #
12 # --------------------------------------------------------------------- #
14 ifneq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
15 ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
17 LIB_BFD=-lbfd -liberty
26 M_NO_CYGWIN=-mno-cygwin
30 LIB_BFD=-lbfd -liberty
36 ifeq "$(HaveLibGmp)$" "YES"
39 LIB_GMP=../rts/gmp/libgmp.a
51 C_SRCS = link.c type.c static.c storage.c derive.c input.c compiler.c subst.c \
52 translate.c codegen.c lift.c free.c stgSubst.c output.c \
53 hugs.c dynamic.c stg.c sainteger.c object.c interface.c
55 SRC_CC_OPTS = -I$(GHC_INTERPRETER_DIR) -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR) -D__HUGS__ -DCOMPILING_RTS -DNO_REGS -Wall -Wstrict-prototypes -Wno-unused -DDEBUG -Winline $(M_NO_CYGWIN) -g -O
57 GHC_LIBS_NEEDED = $(GHC_RUNTIME_DIR)/libHSrts.a
59 all :: parser.c $(GHC_LIBS_NEEDED) nHandle$(DYN_EXT) hugs
62 hugs: $(C_OBJS) ../rts/Sanity.o ../rts/Assembler.o ../rts/Disassembler.o \
63 ../rts/Evaluator.o ../rts/ForeignCall.o ../rts/GC.o ../rts/Printer.o \
64 ../rts/StgCRun.o ../rts/PrimOps.o ../rts/Prelude.o ../rts/Storage.o \
65 ../rts/Schedule.o ../rts/libHSrts.a
66 $(CC) -o $@ $(CC_OPTS) $^ $(GHC_LIBS_NEEDED) \
67 $(LIB_BFD) $(LibsReadline) $(LIB_DL) \
71 rm -f ../rts/libHSrts.a ../rts/libHSrts_u.a
72 rm -f ../rts/StgCRun.o ../rts/StgCRun.u_o
75 nHandle$(DYN_EXT): nHandle.c
76 ifeq "$(DYN_EXT)" ".dll"
77 gcc -mno-cygwin -O -Wall -o nHandle.o -c nHandle.c
78 dllwrap -mno-cygwin --target=i386-mingw32 -o nHandle.dll \
79 -def nHandle.def nHandle.o
81 gcc -O -Wall -shared -fPIC -o nHandle.so nHandle.c
84 $(GHC_RUNTIME_DIR)/libHSrts.a:
85 (cd $(GHC_RUNTIME_DIR) ; make clean ; make EXTRA_CC_OPTS=-I$(GHC_INTERPRETER_DIR))
90 (cd $(GHC_RUNTIME_DIR) ; make clean)
93 tar cvzf stghugs.tar.gz hugs$(exeext) nHandle$(DYN_EXT) lib/*lhs lib/Prelude.hs
96 /bin/rm -f snapshot.tar
97 tar cvf snapshot.tar Makefile *.[chy] \
98 ../rts/Assembler.c ../rts/Evaluator.c ../rts/Disassembler.c \
99 ../rts/ForeignCall.c ../rts/Printer.c ../rts/QueueTemplate.h \
100 ../includes/options.h ../includes/Assembler.h nHandle.c \
101 ../includes/Assembler.h ../rts/Bytecodes.h ../includes/ClosureMacros.h \
102 lib/*.hs runnofib runallnofib
105 # --------------------------------------------------------------------- #
107 # --------------------------------------------------------------------- #
110 ./test/runtests test/static/*.hs
111 ./test/runtests test/typechecker/*.hs
112 ./test/runtests test/runtime/*.hs
113 ./test/runtests test/std/*.hs
114 ./test/runtests test/exts/*.hs
117 ./test/runtests test/runtime/*.hs
118 ./test/runtests test/std/*.hs
119 ./test/runtests test/exts/*.hs
121 # --------------------------------------------------------------------- #
123 # --------------------------------------------------------------------- #
125 CLEAN_FILES += hugs nHandle.dll
126 CLEAN_FILES += $(TOP)/ghc/rts/libHSrts.a $(TOP)/ghc/rts/*.o
127 CLEAN_FILES += parser.c
129 INSTALL_LIBEXECS = hugs
131 depend :: parser.c $(LOOPS) $(SRCS_UGNHS)
134 include $(TOP)/mk/target.mk