git.iko.soy/typeable/pandoc
on master help sign in
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

commit06e6107f535ae921f4b1fec2e7de7dd98b793435 authorroktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b> dateFri 5 Jan 2007, 10:16 (20 years ago) parent46f0c05
1 file changed+16−7
Makefile+16−7
Makefile+16−7
@@ -183,16 +183,21 @@ uninstall-lib-doc:
183183 -rm -rf $(LIBDOCPATH)/html
184184 -rmdir $(LIBDOCPATH)
185185
186−# Program only installation.
187−.PHONY: install-exec uninstall-exec
188−install-exec: build-exec
189− $(INSTALL) -d $(BINPATH); \
190− for f in $(PROGS); do \
186+# Helper to install the given files $(1) into the path $(2).
187+# It also has the ability to follow symlinks.
188+install-executable-files = \
189+ $(INSTALL) -d $(2); \
190+ for f in $(1); do \
191191 if [ -L $$f ]; then \
192192 f=$$(readlink $$f); \
193193 fi; \
194− $(INSTALL_PROGRAM) $$f $(BINPATH)/; \
194+ $(INSTALL_PROGRAM) $$f $(2)/; \
195195 done
196+
197+# Program only installation.
198+.PHONY: install-exec uninstall-exec
199+install-exec: build-exec
200+ $(call install-executable-files,$(PROGS),$(BINPATH))
196201uninstall-exec:
197202 -for f in $(notdir $(PROGS)); do rm -f $(BINPATH)/$$f; done ;
198203
@@ -203,7 +208,8 @@ uninstall-program: uninstall-exec uninstall-doc
203208
204209# Install everything.
205210.PHONY: install-all uninstall-all
206−install-all: install-doc install-lib-doc
211+install-all: build-exec install-doc install-lib-doc
212+ # Install the library (+ main executable) and register it.
207213 destdir=$(DESTDIR); \
208214 # Older Cabal versions have no '--destdir' option.
209215 if $(BUILDCMD) copy --help | grep -q '\-\-destdir'; then \
@@ -213,6 +219,9 @@ install-all: install-doc install-lib-doc
213219 fi; \
214220 $(BUILDCMD) copy $$opt; \
215221 $(BUILDCMD) register
222+ # Note that, we are in the position of having to install the wrappers
223+ # separately, as Cabal installs the main exec along with the library.
224+ $(call install-executable-files,$(WRAPPERS),$(BINPATH))
216225uninstall-all: uninstall-exec uninstall-doc uninstall-lib-doc
217226 -pkg_id="$(NAME)-$(VERSION)"; \
218227 libdir=$$($(GHC_PKG) field $$pkg_id library-dirs 2>/dev/null | \