+CLEAN_FILES += package.conf.installed package.conf.inplace
+
+else # $(STANDALONE_PACKAGE) == "YES"
+
+PACKAGE_CPP_OPTS += -DPACKAGE=\"${PACKAGE}\"
+PACKAGE_CPP_OPTS += -DPACKAGE_DEPS='$(patsubst %,"%"$(comma),$(PACKAGE_DEPS))'
+PACKAGE_CPP_OPTS += -DLIBRARY=\"HS$(PACKAGE)\"
+PACKAGE_CPP_OPTS += -DLIBDIR=\"$(libdir)\"
+
+# Let the package configuration file refer to $(libdir) as
+# ${pkglibdir}. Note we can't use ${libdir} because ghc-pkg already
+# redefines it to point to GHC's libdir (bug or feature?).
+#
+install :: package.conf.in
+ $(CPP) $(RAWCPP_FLAGS) $(PKGCONF_CPP_EXTRA_OPTS) -DINSTALLING -x c $(PACKAGE_CPP_OPTS) $< \
+ | sed -e 's/^#.*$$//g' -e 's/""//g' -e 's/, ]/ ]/g' \
+ | $(GHC_PKG) --force --update-package
+
+endif # $(STANDALONE_PACKAGE)