# -----------------------------------------------------------------------------
-# $Id: package.mk,v 1.3 2002/02/13 10:45:28 simonmar Exp $
+# $Id: package.mk,v 1.4 2002/02/13 15:48:03 simonmar Exp $
ifneq "$(PACKAGE)" ""
# %.o : %.lhs
# $(GHC_INPLACE) $(HC_OPTS) --make $<
+# -----------------------------------------------------------------------------
+# Installation; need to install .hi files as well as libraries
+#
+# The interface files are put inside the $(libdir), since they
+# might (potentially) be platform specific..
+#
+# override is used here because for binary distributions, datadir is
+# set on the command line. sigh.
+#
+
+override datadir:=$(libdir)/imports/$(PACKAGE)
+
+# -----------------------------------------------------------------------------
+# Dependencies
+
+MKDEPENDHS = $(GHC_INPLACE)
+SRC_MKDEPENDC_OPTS += $(patsubst %,-I%,$(ALL_DIRS)) -I$(GHC_INCLUDE_DIR)
+
+endif # $(PACKAGE) /= ""
+
#--------------------------------------------------------------
# Building dynamically-linkable libraries for GHCi
#
-# Build $(GHCI_LIBRARY) from $(OBJS)
+# Build $(GHCI_LIBRARY) whenever we build $(LIBRARY)
#
# Why? GHCi can only link .o files (at the moment), not .a files
# so we have to build libFoo.o as well as libFoo.a
#
# Furthermore, GHCi currently never loads
# profiling libraries (or other non-std ways)
-#
-# Inputs:
-# $(GHCI_LIBRARY)
-#
-# Outputs:
-# Rule to build $(GHCI_LIBRARY)
+
+ifneq "$(LIBRARY)" ""
ifeq "$(way)" ""
ifeq "$(GhcWithInterpreter)" "YES"
-GHCI_LIBRARY = HS$(PACKAGE)$(_cbits)$(_way).o
+GHCI_LIBRARY = $(patsubst lib%.a,%.o,$(LIBRARY))
INSTALL_LIBS += $(GHCI_LIBRARY)
CLEAN_FILES += $(GHCI_LIBRARY)
endif # GhcWithInterpreter
endif # way
-# -----------------------------------------------------------------------------
-# Installation; need to install .hi files as well as libraries
-#
-# The interface files are put inside the $(libdir), since they
-# might (potentially) be platform specific..
-#
-# override is used here because for binary distributions, datadir is
-# set on the command line. sigh.
-#
-
-override datadir:=$(libdir)/imports/$(PACKAGE)
-
-# -----------------------------------------------------------------------------
-# Dependencies
-
-MKDEPENDHS = $(GHC_INPLACE)
-SRC_MKDEPENDC_OPTS += $(patsubst %,-I%,$(ALL_DIRS)) -I$(GHC_INCLUDE_DIR)
-
-endif # $(PACKAGE) /= ""
-
+endif # $(LIBRARY) /= ""