- nHandle.so
- $(CC) -o $@ -rdynamic $(CC_OPTS) $^ $(GHC_LIBS_NEEDED) -lbfd -liberty -ldl -lm
-
-nHandle.so:
- gcc -O -fPIC -shared -o nHandle.so nHandle.c
-
-$(TOP)/ghc/rts/libHSrts.a:
- (cd $(TOP)/ghc/rts ; make clean ; make EXTRA_CC_OPTS=-I$(GHC_DIR)/interpreter)
+ ../rts/StgCRun.o ../rts/PrimOps.o ../rts/Prelude.o ../rts/Storage.o \
+ ../rts/Schedule.o ../rts/libHSrts.a
+ $(CC) -o $@ $(CC_OPTS) $^ $(GHC_LIBS_NEEDED) \
+ -lbfd -liberty $(LibsReadline) $(LIB_DL) \
+ $(LIB_GMP) -lm
+
+foobar:
+ rm -f ../rts/libHSrts.a ../rts/libHSrts_u.a
+ rm -f ../rts/StgCRun.o ../rts/StgCRun.u_o
+ make all
+
+nHandle$(DYN_EXT): nHandle.c
+ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
+ gcc -mno-cygwin -O -Wall -o nHandle.o -c nHandle.c
+ dllwrap -mno-cygwin --target=i386-mingw32 -o nHandle.dll \
+ -def nHandle.def nHandle.o
+else
+ gcc -O -Wall -shared -fPIC -o nHandle.so nHandle.c
+endif
+
+$(GHC_RUNTIME_DIR)/libHSrts.a:
+ (cd $(GHC_RUNTIME_DIR) ; make clean ; make EXTRA_CC_OPTS=-I$(GHC_INTERPRETER_DIR))