[project @ 2001-09-08 21:42:07 by sof]
[ghc-hetmet.git] / mk / target.mk
index 4d216fc..dd2ddcb 100644 (file)
@@ -350,8 +350,12 @@ C_SRCS += $(wildcard ../*_hsc.c)
 SRC_CC_OPTS += -I.. -I.
 endif
 
+ifneq "$(way)" "i"
 LIBRARY      = libHS$(PACKAGE)$(_cbits)$(_way).a
 GHCI_LIBRARY = HS$(PACKAGE)$(_cbits)$(_way).o
+else
+LIBRARY      = $(PACKAGE).dll
+endif
 
 ifneq "$(IS_CBITS_LIB)" "YES"
 WAYS=$(GhcLibWays)
@@ -389,11 +393,18 @@ endif # PACKAGE
 ifneq "$(LIBRARY)" ""
 all :: $(LIBRARY)
 
+ifneq "$(way)" "i"
 define BUILD_LIB
 $(RM) $@
 $(AR) $(AR_OPTS) $@ $(STUBOBJS) $(LIBOBJS)
 $(RANLIB) $@
 endef
+else
+define BUILD_LIB
+$(RM) $@
+al -out:$@ $(STUBOBJS) $(LIBOBJS)
+endef
+endif
 
 #
 # For Haskell object files, we might have chosen to split
@@ -504,21 +515,18 @@ CLEAN_FILES += $(GHCI_LIBRARY)
 
 all :: $(GHCI_LIBRARY)
 
-ifneq "$(GHCI_LIBRARY)" "HSstd.o"
-# An annoying gotcha is that the Prelude is a bit special,
-# for reasons described in ghc/lib/std/Makefile.
-# So we only put in this standard rule for packages other than std
-# The rule for the Prelude is in ghc/lib/std/Makefile
-# We check for GHCI_LIBRARY being HSstd.o rather than
-# PACKAGE being std, because we want to still use the boilerplate rule 
-# for cbits.
+ifneq "$(DONT_WANT_STD_GHCI_LIB_RULE)" "YES"
+# If you don't want to build GHCI_LIBRARY the 'standard' way,
+# set DONT_WANT_STD_GHCI_LIB_RULE to YES. The Prelude and
+# hslibs/Win32 uses this 'feature'.
+#
 $(GHCI_LIBRARY) :: $(LIBOBJS)
        ld -r -x -o $@ $(LIBOBJS) $(STUBOBJS)
-endif
 
+endif # DONT_WANT_STD_GHCI_LIB_RULE
 endif # GhcWithInterpreter
 endif # way
-endif # GHCI_LIBRARY
+endif # GHCI_LIBRARY != ""
 
 
 #----------------------------------------