+# -----------------------------------------------------------------------------
+# Installation; need to install .hi files as well as libraries
+
+ifeq "$(DLLized)" "YES"
+INSTALL_PROGS += $(DLL_NAME)
+INSTALL_LIBS += $(patsubst %.a,%_imp.a, $(LIBRARY))
+endif
+
+# The interface files are put inside the $(libdir), since they
+# might (potentially) be platform specific..
+
+ifeq "$(HIERARCHICAL_LIB)" "YES"
+ifacedir = $(libdir)/imports
+else
+ifacedir = $(libdir)/hslibs-imports/$(PACKAGE)
+endif
+
+# If the lib consists of a hierachy of modules, we must retain the directory
+# structure when we install the interfaces.
+ifeq "$(HIERARCHICAL_LIB)" "YES"
+INSTALL_IFACES_WITH_DIRS += $(HS_IFACES)
+ifneq "$(ALL_DIRS)" ""
+install ::
+ @for i in $(ALL_DIRS); do \
+ $(INSTALL_DIR) $(ifacedir)/$$i; \
+ done
+endif
+else
+INSTALL_IFACES += $(HS_IFACES)
+endif
+
+# -----------------------------------------------------------------------------
+# Dependencies
+
+ifeq "$(STANDALONE_PACKAGE)" "NO"
+MKDEPENDHS = $(GHC_INPLACE)
+endif
+
+SRC_MKDEPENDC_OPTS += $(addprefix -I,$(ALL_DIRS))
+
+ifeq "$(STANDALONE_PACKAGE)" "NO"
+SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
+endif
+
+endif # $(PACKAGE) /= ""
+
+# install library (could be implicitly specified or explicitly, like libHS*_cbits.a)
+INSTALL_LIBS += $(LIBRARY)
+