From 06e6107f535ae921f4b1fec2e7de7dd98b793435 Mon Sep 17 00:00:00 2001 From: roktas Date: Fri, 5 Jan 2007 10:16:15 +0000 Subject: Fix the bug in 'install-all' target which does not install the wrappers. (This target is somewhat special as it should handle installing and _registering_ the library in generic installations.) We can't rely on 'install-exec' to fix this bug (but we should depend on 'build-exec' nevertheless), since the 'install-all' target already installs pandoc along with the library files. Therefore we should install wrappers separately by using a helper function which was specifically created to avoid code duplication ('install-exec' target was also updated so as to use this function). git-svn-id: https://pandoc.googlecode.com/svn/trunk@426 788f1e2b-df1e-0410-8736-df70ead52e1b --- Makefile | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 52319b685..396f19ea3 100644 --- a/Makefile +++ b/Makefile @@ -183,16 +183,21 @@ uninstall-lib-doc: -rm -rf $(LIBDOCPATH)/html -rmdir $(LIBDOCPATH) -# Program only installation. -.PHONY: install-exec uninstall-exec -install-exec: build-exec - $(INSTALL) -d $(BINPATH); \ - for f in $(PROGS); do \ +# Helper to install the given files $(1) into the path $(2). +# It also has the ability to follow symlinks. +install-executable-files = \ + $(INSTALL) -d $(2); \ + for f in $(1); do \ if [ -L $$f ]; then \ f=$$(readlink $$f); \ fi; \ - $(INSTALL_PROGRAM) $$f $(BINPATH)/; \ + $(INSTALL_PROGRAM) $$f $(2)/; \ done + +# Program only installation. +.PHONY: install-exec uninstall-exec +install-exec: build-exec + $(call install-executable-files,$(PROGS),$(BINPATH)) uninstall-exec: -for f in $(notdir $(PROGS)); do rm -f $(BINPATH)/$$f; done ; @@ -203,7 +208,8 @@ uninstall-program: uninstall-exec uninstall-doc # Install everything. .PHONY: install-all uninstall-all -install-all: install-doc install-lib-doc +install-all: build-exec install-doc install-lib-doc + # Install the library (+ main executable) and register it. destdir=$(DESTDIR); \ # Older Cabal versions have no '--destdir' option. if $(BUILDCMD) copy --help | grep -q '\-\-destdir'; then \ @@ -213,6 +219,9 @@ install-all: install-doc install-lib-doc fi; \ $(BUILDCMD) copy $$opt; \ $(BUILDCMD) register + # Note that, we are in the position of having to install the wrappers + # separately, as Cabal installs the main exec along with the library. + $(call install-executable-files,$(WRAPPERS),$(BINPATH)) uninstall-all: uninstall-exec uninstall-doc uninstall-lib-doc -pkg_id="$(NAME)-$(VERSION)"; \ libdir=$$($(GHC_PKG) field $$pkg_id library-dirs 2>/dev/null | \ -- cgit v1.2.3