summaryrefslogtreecommitdiff
path: root/mk/package.mk
diff options
context:
space:
mode:
authorreid <unknown>2003-06-04 12:37:09 +0000
committerreid <unknown>2003-06-04 12:37:09 +0000
commit3a41699a18783fc9e6194cf0736fea3ad558eec3 (patch)
tree98ea0432a619e3027feeda1e65c0df42dc1870e3 /mk/package.mk
parent2c4554c35c6b987b71ef281fd1867da5f5b8ed82 (diff)
downloadhaskell-3a41699a18783fc9e6194cf0736fea3ad558eec3.tar.gz
[project @ 2003-06-04 12:37:09 by reid]
All changes in this commit are standalone changes only but could usefully be used inplace as well: Don't store package.conf.installed; use a pipe to avoid problems from using stale package.confs. Also, use PACKAGE, PACKAGE_DEPS, LIBRARY and LIBDIR settings from Makefile when installing pkg. This requires some ugly sed hackery to overcome ghc-pkg not allowing trailing commas in a list: [a,b,c,]
Diffstat (limited to 'mk/package.mk')
-rw-r--r--mk/package.mk16
1 files changed, 12 insertions, 4 deletions
diff --git a/mk/package.mk b/mk/package.mk
index 4d3d257344..00c4840f42 100644
--- a/mk/package.mk
+++ b/mk/package.mk
@@ -1,5 +1,5 @@
# -----------------------------------------------------------------------------
-# $Id: package.mk,v 1.29 2003/05/29 14:47:05 reid Exp $
+# $Id: package.mk,v 1.30 2003/06/04 12:37:09 reid Exp $
ifneq "$(PACKAGE)" ""
@@ -24,12 +24,13 @@ ifeq "$(STANDALONE_PACKAGE)" "NO"
package.conf.inplace : package.conf.in
$(CPP) $(RAWCPP_FLAGS) $(PKGCONF_CPP_EXTRA_OPTS) -x c $(PACKAGE_CPP_OPTS) $< \
| sed 's/^#.*$$//g' >$@
-endif
package.conf.installed : package.conf.in
$(CPP) $(RAWCPP_FLAGS) $(PKGCONF_CPP_EXTRA_OPTS) -DINSTALLING -x c $(PACKAGE_CPP_OPTS) $< \
| sed 's/^#.*$$//g' >$@
+endif
+
# we could be more accurate here and add a dependency on
# ghc/driver/package.conf, but that doesn't work too well because of
# make's limited accuracy with modification times: when doing 'make
@@ -59,12 +60,19 @@ 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.installed
- pkglibdir=$(libdir) $(GHC_PKG) --force --update-package <package.conf.installed
+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)