2 # --------------------------------------------------------------------------- #
3 # $Id: Makefile-DietHEP,v 1.2 2000/05/26 10:14:34 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
45 C_SRCS = link.c type.c static.c storage.c derive.c input.c compiler.c subst.c \
46 translate.c codegen.c lift.c free.c stgSubst.c output.c \
47 hugs.c dynamic.c stg.c sainteger.c object.c interface.c
49 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 -g -DDIET_HEP -DBUILDING_DLL
51 GHC_LIBS_NEEDED = $(GHC_RUNTIME_DIR)/libHSrts.a \
52 $(GHC_RUNTIME_DIR)/gmp/libgmp.a
54 all :: parser.c $(GHC_LIBS_NEEDED) nHandle$(DYN_EXT) dh_demo.exe
56 dhtarfile: DietHEP.dll
58 ln -s ../includes/DietHEP.h .
59 tar cvf dhtarfile.tar --dereference DietHEP.h DietHEP.dll DietHEP_dll.a \
60 Dh_Demo.hs dh_demo.c dh_demo.exe \
61 lib library nHandle.dll Makefile-DietHEP
63 bzip2 -v dhtarfile.tar
65 dh_demo.exe: DietHEP.dll dh_demo.c
66 gcc -Wall -g -o dh_demo.exe dh_demo.c -L./ -lDietHEP
69 DietHEP.dll: $(C_OBJS) $(GHC_LIBS_NEEDED)
70 dllwrap -o DietHEP.dll --def DietHEP.def --implib libDietHEP.a \
71 $(OBJS) $(GHC_LIBS_NEEDED)
74 rm -f ../rts/libHSrts.a ../rts/libHSrts_u.a
75 rm -f ../rts/StgCRun.o ../rts/StgCRun.u_o
78 nHandle$(DYN_EXT): nHandle.c
79 ifeq "$(DYN_EXT)" ".dll"
80 gcc -mno-cygwin -O -Wall -o nHandle.o -c nHandle.c
81 dllwrap -mno-cygwin --target=i386-mingw32 -o nHandle.dll \
82 -def nHandle.def nHandle.o
84 gcc -O -Wall -shared -fPIC -o nHandle.so nHandle.c
87 $(GHC_RUNTIME_DIR)/libHSrts.a:
88 (cd $(GHC_RUNTIME_DIR) ; make clean ; make EXTRA_CC_OPTS=-I$(GHC_INTERPRETER_DIR))
93 (cd $(GHC_RUNTIME_DIR) ; make clean)
96 tar cvzf stghugs.tar.gz hugs$(exeext) nHandle$(DYN_EXT) lib/*lhs lib/Prelude.hs
99 /bin/rm -f snapshot.tar
100 tar cvf snapshot.tar Makefile *.[chy] \
101 ../rts/Assembler.c ../rts/Evaluator.c ../rts/Disassembler.c \
102 ../rts/ForeignCall.c ../rts/Printer.c ../rts/QueueTemplate.h \
103 ../includes/options.h ../includes/Assembler.h nHandle.c \
104 ../includes/Assembler.h ../rts/Bytecodes.h ../includes/ClosureMacros.h \
105 lib/*.hs runnofib runallnofib
108 # --------------------------------------------------------------------- #
110 # --------------------------------------------------------------------- #
113 ./test/runtests test/static/*.hs
114 ./test/runtests test/typechecker/*.hs
115 ./test/runtests test/runtime/*.hs
116 ./test/runtests test/std/*.hs
117 ./test/runtests test/exts/*.hs
120 ./test/runtests test/runtime/*.hs
121 ./test/runtests test/std/*.hs
122 ./test/runtests test/exts/*.hs
124 # --------------------------------------------------------------------- #
126 # --------------------------------------------------------------------- #
128 CLEAN_FILES += hugs nHandle.dll DietHEP.dll
129 CLEAN_FILES += $(TOP)/ghc/rts/libHSrts.a $(TOP)/ghc/rts/*.o
130 CLEAN_FILES += parser.c
132 INSTALL_LIBEXECS = hugs
134 depend :: parser.c $(LOOPS) $(SRCS_UGNHS)
137 include $(TOP)/mk/target.mk