+DLL_NAME = HSstd.dll
+DLL_DESCRIPTION="GHC-compiled Haskell Prelude"
+DLL_IMPLIB_NAME = libHSstd_imp.a
+SRC_BLD_DLL_OPTS += --export-all --output-def=HSstd.def DllVersionInfo.o
+SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHSstd_cbits_imp -lgmp -L. -L../../rts/gmp -L../../rts -Lcbits
+
+ifeq "$(way)" "dll"
+HS_SRCS := $(filter-out PrelMain.lhs PrelHugs.lhs, $(HS_SRCS))
+endif
+
+# PrelMain.dll_o isn't to be included in the final .a,
+# but it needs to be generated
+ifeq "$(way)" "dll"
+all :: PrelMain.dll_o DllVersionInfo.o
+
+endif
+
+CLEAN_FILES += PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
+
+#
+# If we're building the unregisterised way, it may well be for Hugs.
+# In that case, remember to bind the cbits objects into a single file
+# which hugs can load as an auxiliary object file when loading the Prelude.
+#
+ifeq "$(way)" "u"
+all :: libHSstd_cbits.u_o
+CLEAN_FILES += libHSstd_cbits.u_o
+libHSstd_cbits.u_o:
+ $(RM) libHSstd_cbits.u_o
+ ld -r -o libHSstd_cbits.u_o cbits/*.o
+endif
+