[project @ 2002-02-14 15:14:00 by simonmar]
authorsimonmar <unknown>
Thu, 14 Feb 2002 15:14:02 +0000 (15:14 +0000)
committersimonmar <unknown>
Thu, 14 Feb 2002 15:14:02 +0000 (15:14 +0000)
Fixes to 'make install' in fptools/libraries.  We have to maintain the
directory structure when installing the .hi files, rather than just
dumping them in a single directory as we do for packages in
fptools/hslibs.

mk/package.mk
mk/target.mk

index c7ed72f..4ba7746 100644 (file)
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# $Id: package.mk,v 1.4 2002/02/13 15:48:03 simonmar Exp $
+# $Id: package.mk,v 1.5 2002/02/14 15:14:00 simonmar Exp $
 
 ifneq "$(PACKAGE)" ""
 
@@ -60,16 +60,33 @@ all :: $(LIBRARY)
 
 # -----------------------------------------------------------------------------
 # Installation; need to install .hi files as well as libraries
-#
+
+INSTALL_LIBS  += $(LIBRARY)
+
+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..
 #
 # override is used here because for binary distributions, datadir is
 # set on the command line. sigh.
-#
-
 override datadir:=$(libdir)/imports/$(PACKAGE)
 
+# 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_DATAS_WITH_DIRS += $(HS_IFACES)
+install ::
+       @for i in $(ALL_DIRS); do \
+               $(INSTALL_DIR) $(datadir)/$$i; \
+       done
+else
+INSTALL_DATAS += $(HS_IFACES)
+endif
+
 # -----------------------------------------------------------------------------
 # Dependencies
 
index d361d39..353bdd0 100644 (file)
@@ -671,17 +671,6 @@ install-dirs ::
 # within the various install targets instead.
 #install:: install-dirs
 
-# Install libraries automatically
-# ToDo: this is a bit magical, maybe do this for packages only? --SDM
-ifneq "$(LIBRARY)" ""
-INSTALL_LIBS  += $(LIBRARY)
-ifeq "$(DLLized)" "YES"
-INSTALL_PROGS += $(DLL_NAME)
-INSTALL_LIBS += $(patsubst %.a,%_imp.a, $(LIBRARY))
-endif
-INSTALL_DATAS += $(HS_IFACES)
-endif
-
 ifneq "$(INSTALL_PROGS)" ""
 
 #
@@ -771,6 +760,14 @@ install:: $(INSTALL_DATAS)
        done
 endif
 
+ifneq "$(INSTALL_DATAS_WITH_DIRS)" ""
+install:: $(INSTALL_DATAS_WITH_DIRS)
+       @$(INSTALL_DIR) $(datadir)
+       for i in $(INSTALL_DATAS_WITH_DIRS); do \
+               $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/`dirname $$i`; \
+       done
+endif
+
 ifneq "$(INSTALL_INCLUDES)" ""
 install:: $(INSTALL_INCLUDES)
        @$(INSTALL_DIR) $(includedir)