SRC_HC_OPTS += -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing $(GhcLibHcOpts)
+ifneq "$(way)" "dll"
+SRC_HC_OPTS += -static
+endif
+
#
# Profiling options
WAY_p_HC_OPTS += -GPrelude
SRC_HC_OPTS += -hisuf $(way_)hi
endif
-Int_HC_OPTS += -H8m -fno-prune-tydecls
-Word_HC_OPTS += -H8m -fno-prune-tydecls
+Int_HC_OPTS += -H20m -fno-prune-tydecls -monly-3-regs
+Word_HC_OPTS += -H20m -monly-3-regs
Foreign_HC_OPTS += -fno-prune-tydecls
NativeInfo_HC_OPTS += -fno-prune-tydecls
Dynamic_HC_OPTS += $(MAGIC_HSCPP_OPTS)
SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR) -optdep--include-prelude -optdep-w $(MAGIC_HSCPP_OPTS)
#-----------------------------------------------------------------------------
+# Win32 DLL setup
+
+DLL_NAME = HSexts.dll
+DLL_IMPLIB_NAME = libHSexts_imp.a
+SRC_BLD_DLL_OPTS += --export-all --output-def=HSexts.def
+SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHScbits_imp -lHS_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits
+
+#-----------------------------------------------------------------------------
# Installation; need to install .hi files as well as libraries
#
# The interface files are put inside the $(libdir), since they
INSTALL_LIBS += $(LIBRARY)
INSTALL_DATAS += $(HS_IFACES)
+ifeq "$(EnableWin32DLLs)" "YES"
+INSTALL_PROGS += $(DLL_NAME)
+INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY))
+INSTALL_DATAS += dLL_ifs.hi
+endif
+
include $(TOP)/mk/target.mk