[project @ 2001-09-04 18:29:20 by ken]
[ghc-hetmet.git] / mk / target.mk
index 69f48c8..448b077 100644 (file)
@@ -344,13 +344,18 @@ ifeq "$(IS_CBITS_LIB)" "YES"
 _cbits := _cbits
 STUBOBJS += $(HSC_C_OBJS)
 # Add _hsc.c files to the cbits library
-SRCS       += $(wildcard ../*_hsc.c)
+C_SRCS += $(wildcard ../*_hsc.c)
 # Make .hsc.h include files from the directory above visible
-SRC_CC_OPTS += -I..
+# (and the cbits/ library too).
+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)
@@ -364,8 +369,6 @@ ifeq "$(LIBOBJS)" ""
   endif
 endif
 
-SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR)
-
 ifeq "$(IS_CBITS_LIB)" "YES"
 override datadir:=$(libdir)/include
 INSTALL_DATAS += Hs$(shell perl -e 'print ucfirst "$(PACKAGE)"').h
@@ -378,7 +381,7 @@ endif # PACKAGE
 #----------------------------------------
 #      Libraries/archives
 #
-# Build $(LIBRARY) from $(LIBOJBS)+$(STUBOBJS)
+# Build $(LIBRARY) from $(LIBOBJS)+$(STUBOBJS)
 #
 # Inputs:
 #   $(LIBOBJS)
@@ -390,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
@@ -505,7 +515,9 @@ CLEAN_FILES += $(GHCI_LIBRARY)
 
 all :: $(GHCI_LIBRARY)
 
+# How come GNU make doesn't support ands and ors?  Duh.
 ifneq "$(GHCI_LIBRARY)" "HSstd.o"
+ifneq "$(GHCI_LIBRARY)" "HSwin32.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
@@ -513,13 +525,15 @@ ifneq "$(GHCI_LIBRARY)" "HSstd.o"
 # We check for GHCI_LIBRARY being HSstd.o rather than
 # PACKAGE being std, because we want to still use the boilerplate rule 
 # for cbits.
+# JRS 04 Sept 01: The exact same deal applies to hslibs/HSwin32.o.
 $(GHCI_LIBRARY) :: $(LIBOBJS)
        ld -r -x -o $@ $(LIBOBJS) $(STUBOBJS)
-endif
 
+endif # GHCI_LIBRARY != "HSwin32.o"
+endif # GHCI_LIBRARY != "HSstd.o"
 endif # GhcWithInterpreter
 endif # way
-endif # GHCI_LIBRARY
+endif # GHCI_LIBRARY != ""
 
 
 #----------------------------------------