From 4f0e92bcf620776077d167598e93159e14c41276 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 14 Feb 2002 15:14:02 +0000 Subject: [PATCH] [project @ 2002-02-14 15:14:00 by simonmar] 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 | 25 +++++++++++++++++++++---- mk/target.mk | 19 ++++++++----------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/mk/package.mk b/mk/package.mk index c7ed72f..4ba7746 100644 --- a/mk/package.mk +++ b/mk/package.mk @@ -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 diff --git a/mk/target.mk b/mk/target.mk index d361d39..353bdd0 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -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) -- 1.7.10.4