summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2015-08-15 14:18:07 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2015-08-21 19:20:51 +0200
commit47493e60fa2f8f520297969472dde01931530707 (patch)
tree75695993b4d953131a1f580fa4cb362e4f1ab70a
parent2f29ebbb6f8c914f2bba624f3edcc259274df8af (diff)
downloadhaskell-47493e60fa2f8f520297969472dde01931530707.tar.gz
Build system: simplify install.mk.in
This will allow fixing #1851 more easily ("make install-strip" should work). This reverts 57e2a81c589103b50da80a9e378b1a11285bd521: "On Cygwin, use a Cygwin-style path for /bin/install's destination" Update submodule haddock and hsc2hs.
-rw-r--r--docs/man/ghc.mk6
-rw-r--r--driver/ghci/ghc.mk4
-rw-r--r--ghc.mk50
-rw-r--r--includes/ghc.mk8
-rw-r--r--mk/install.mk.in24
-rw-r--r--rts/ghc.mk4
-rw-r--r--rules/shell-wrapper.mk2
-rw-r--r--utils/ghc-pkg/ghc.mk2
m---------utils/haddock0
m---------utils/hsc2hs0
10 files changed, 47 insertions, 53 deletions
diff --git a/docs/man/ghc.mk b/docs/man/ghc.mk
index 0c1014b452..470bd9ad34 100644
--- a/docs/man/ghc.mk
+++ b/docs/man/ghc.mk
@@ -49,9 +49,9 @@ install: install_man
.PHONY: install_man
install_man: $(MAN_PATH)
- $(call INSTALL_DIR,"$(DESTDIR)$(mandir)")
- $(call INSTALL_DIR,"$(DESTDIR)$(mandir)/man$(MAN_SECTION)")
- $(call INSTALL_MAN,$(INSTALL_OPTS),$(MAN_PATH),"$(DESTDIR)$(mandir)/man$(MAN_SECTION)")
+ $(INSTALL_DIR) "$(DESTDIR)$(mandir)"
+ $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man$(MAN_SECTION)"
+ $(INSTALL_MAN) $(INSTALL_OPTS) $(MAN_PATH) "$(DESTDIR)$(mandir)/man$(MAN_SECTION)"
endif
$(eval $(call clean-target,docs/man,,$(MAN_PATH) docs/man/flags.xsl docs/man/flags.xml))
diff --git a/driver/ghci/ghc.mk b/driver/ghci/ghc.mk
index ba6984c37a..240e16ff71 100644
--- a/driver/ghci/ghc.mk
+++ b/driver/ghci/ghc.mk
@@ -18,7 +18,7 @@ install: install_driver_ghci
.PHONY: install_driver_ghci
install_driver_ghci: WRAPPER=$(DESTDIR)$(bindir)/ghci-$(ProjectVersion)
install_driver_ghci:
- $(call INSTALL_DIR,"$(DESTDIR)$(bindir)")
+ $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
$(call removeFiles, "$(WRAPPER)")
$(CREATE_SCRIPT) "$(WRAPPER)"
echo '#!$(SHELL)' >> "$(WRAPPER)"
@@ -54,7 +54,7 @@ install : install_driver_ghcii
install_driver_ghcii: GHCII_SCRIPT=$(DESTDIR)$(bindir)/ghcii.sh
install_driver_ghcii: GHCII_SCRIPT_VERSIONED = $(DESTDIR)$(bindir)/ghcii-$(ProjectVersion).sh
install_driver_ghcii:
- $(call INSTALL_DIR,$(DESTDIR)$(bindir))
+ $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
$(call removeFiles,"$(GHCII_SCRIPT)")
echo "#!$(SHELL)" >> $(GHCII_SCRIPT)
echo 'exec "$$(dirname "$$0")"/ghc --interactive "$$@"' >> $(GHCII_SCRIPT)
diff --git a/ghc.mk b/ghc.mk
index 2a0adb9c53..e51eb948bd 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -807,29 +807,29 @@ endif
define installLibsTo
# $1 = libraries to install
# $2 = directory to install to
- $(call INSTALL_DIR,$2)
+ $(INSTALL_DIR) $2
for i in $1; do \
case $$i in \
*.a) \
- $(call INSTALL_DATA,$(INSTALL_OPTS),$$i,$2); \
+ $(INSTALL_DATA) $(INSTALL_OPTS) $$i $2; \
$(RANLIB_CMD) $2/`basename $$i` ;; \
*.dll) \
- $(call INSTALL_PROGRAM,$(INSTALL_OPTS),$$i,$2) ; \
+ $(INSTALL_PROGRAM) $(INSTALL_OPTS) $$i $2 ; \
$(STRIP_CMD) $2/`basename $$i` ;; \
*.so) \
- $(call INSTALL_SHLIB,$(INSTALL_OPTS),$$i,$2) ;; \
+ $(INSTALL_SHLIB) $(INSTALL_OPTS) $$i $2 ;; \
*.dylib) \
- $(call INSTALL_SHLIB,$(INSTALL_OPTS),$$i,$2);; \
+ $(INSTALL_SHLIB) $(INSTALL_OPTS) $$i $2;; \
*) \
- $(call INSTALL_DATA,$(INSTALL_OPTS),$$i,$2); \
+ $(INSTALL_DATA) $(INSTALL_OPTS) $$i $2; \
esac; \
done
endef
install_bins: $(INSTALL_BINS)
- $(call INSTALL_DIR,"$(DESTDIR)$(bindir)")
+ $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
for i in $(INSTALL_BINS); do \
- $(call INSTALL_PROGRAM,$(INSTALL_BIN_OPTS),$$i,"$(DESTDIR)$(bindir)") ; \
+ $(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $$i "$(DESTDIR)$(bindir)" ; \
done
install_libs: $(INSTALL_LIBS)
@@ -839,9 +839,9 @@ install_libexecs: $(INSTALL_LIBEXECS)
ifeq "$(INSTALL_LIBEXECS)" ""
@:
else
- $(call INSTALL_DIR,"$(DESTDIR)$(ghclibexecdir)/bin")
+ $(INSTALL_DIR) "$(DESTDIR)$(ghclibexecdir)/bin"
for i in $(INSTALL_LIBEXECS); do \
- $(call INSTALL_PROGRAM,$(INSTALL_BIN_OPTS),$$i,"$(DESTDIR)$(ghclibexecdir)/bin"); \
+ $(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $$i "$(DESTDIR)$(ghclibexecdir)/bin"; \
done
# We rename ghc-stage2, so that the right program name is used in error
# messages etc.
@@ -849,32 +849,32 @@ else
endif
install_topdirs: $(INSTALL_TOPDIRS)
- $(call INSTALL_DIR,"$(DESTDIR)$(topdir)")
+ $(INSTALL_DIR) "$(DESTDIR)$(topdir)"
for i in $(INSTALL_TOPDIRS); do \
- $(call INSTALL_PROGRAM,$(INSTALL_BIN_OPTS),$$i,"$(DESTDIR)$(topdir)"); \
+ $(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $$i "$(DESTDIR)$(topdir)"; \
done
install_docs: $(INSTALL_DOCS)
- $(call INSTALL_DIR,"$(DESTDIR)$(docdir)")
+ $(INSTALL_DIR) "$(DESTDIR)$(docdir)"
ifneq "$(INSTALL_DOCS)" ""
for i in $(INSTALL_DOCS); do \
- $(call INSTALL_DOC,$(INSTALL_OPTS),$$i,"$(DESTDIR)$(docdir)"); \
+ $(INSTALL_DOC) $(INSTALL_OPTS) $$i "$(DESTDIR)$(docdir)"; \
done
endif
- $(call INSTALL_DIR,"$(DESTDIR)$(docdir)/html")
- $(call INSTALL_DOC,$(INSTALL_OPTS),docs/index.html,"$(DESTDIR)$(docdir)/html")
+ $(INSTALL_DIR) "$(DESTDIR)$(docdir)/html"
+ $(INSTALL_DOC) $(INSTALL_OPTS) docs/index.html "$(DESTDIR)$(docdir)/html"
ifneq "$(INSTALL_LIBRARY_DOCS)" ""
- $(call INSTALL_DIR,"$(DESTDIR)$(docdir)/html/libraries")
+ $(INSTALL_DIR) "$(DESTDIR)$(docdir)/html/libraries"
for i in $(INSTALL_LIBRARY_DOCS); do \
- $(call INSTALL_DOC,$(INSTALL_OPTS),$$i,"$(DESTDIR)$(docdir)/html/libraries/"); \
+ $(INSTALL_DOC) $(INSTALL_OPTS) $$i "$(DESTDIR)$(docdir)/html/libraries/"; \
done
- $(call INSTALL_DATA,$(INSTALL_OPTS),libraries/prologue.txt,"$(DESTDIR)$(docdir)/html/libraries/")
- $(call INSTALL_SCRIPT,$(INSTALL_OPTS),libraries/gen_contents_index,"$(DESTDIR)$(docdir)/html/libraries/")
+ $(INSTALL_DATA) $(INSTALL_OPTS) libraries/prologue.txt "$(DESTDIR)$(docdir)/html/libraries/"
+ $(INSTALL_SCRIPT) $(INSTALL_OPTS) libraries/gen_contents_index "$(DESTDIR)$(docdir)/html/libraries/"
endif
ifneq "$(INSTALL_HTML_DOC_DIRS)" ""
for i in $(INSTALL_HTML_DOC_DIRS); do \
- $(call INSTALL_DIR,"$(DESTDIR)$(docdir)/html/`basename $$i`"); \
- $(call INSTALL_DOC,$(INSTALL_OPTS),$$i/*,"$(DESTDIR)$(docdir)/html/`basename $$i`"); \
+ $(INSTALL_DIR) "$(DESTDIR)$(docdir)/html/`basename $$i`"; \
+ $(INSTALL_DOC) $(INSTALL_OPTS) $$i/* "$(DESTDIR)$(docdir)/html/`basename $$i`"; \
done
endif
@@ -898,10 +898,10 @@ INSTALL_DISTDIR_compiler = stage2
# Now we can do the installation
install_packages: install_libexecs
install_packages: rts/dist/package.conf.install
- $(call INSTALL_DIR,"$(DESTDIR)$(topdir)")
+ $(INSTALL_DIR) "$(DESTDIR)$(topdir)"
$(call removeTrees,"$(INSTALLED_PACKAGE_CONF)")
- $(call INSTALL_DIR,"$(INSTALLED_PACKAGE_CONF)")
- $(call INSTALL_DIR,"$(DESTDIR)$(topdir)/rts")
+ $(INSTALL_DIR) "$(INSTALLED_PACKAGE_CONF)"
+ $(INSTALL_DIR) "$(DESTDIR)$(topdir)/rts"
$(call installLibsTo, $(RTS_INSTALL_LIBS), "$(DESTDIR)$(topdir)/rts")
$(foreach p, $(INSTALL_PACKAGES), \
$(call make-command, \
diff --git a/includes/ghc.mk b/includes/ghc.mk
index 7a255db601..06f4912cf4 100644
--- a/includes/ghc.mk
+++ b/includes/ghc.mk
@@ -226,10 +226,10 @@ install: install_includes
.PHONY: install_includes
install_includes :
- $(call INSTALL_DIR,"$(DESTDIR)$(ghcheaderdir)")
+ $(INSTALL_DIR) "$(DESTDIR)$(ghcheaderdir)"
$(foreach d,$(includes_H_SUBDIRS), \
- $(call INSTALL_DIR,"$(DESTDIR)$(ghcheaderdir)/$d") && \
- $(call INSTALL_HEADER,$(INSTALL_OPTS),includes/$d/*.h,"$(DESTDIR)$(ghcheaderdir)/$d/") && \
+ $(INSTALL_DIR) "$(DESTDIR)$(ghcheaderdir)/$d" && \
+ $(INSTALL_HEADER) $(INSTALL_OPTS) includes/$d/*.h "$(DESTDIR)$(ghcheaderdir)/$d/" && \
) true
- $(call INSTALL_HEADER,$(INSTALL_OPTS),$(includes_H_CONFIG) $(includes_H_PLATFORM) $(includes_H_VERSION) $(includes_DERIVEDCONSTANTS),"$(DESTDIR)$(ghcheaderdir)/")
+ $(INSTALL_HEADER) $(INSTALL_OPTS) $(includes_H_CONFIG) $(includes_H_PLATFORM) $(includes_H_VERSION) $(includes_DERIVEDCONSTANTS) "$(DESTDIR)$(ghcheaderdir)/"
diff --git a/mk/install.mk.in b/mk/install.mk.in
index da6680d6b6..38e6459466 100644
--- a/mk/install.mk.in
+++ b/mk/install.mk.in
@@ -132,21 +132,15 @@ INSTALL_GROUP =
#
CREATE_SCRIPT = create () { touch "$$1" && chmod 755 "$$1" ; } && create
CREATE_DATA = create () { touch "$$1" && chmod 644 "$$1" ; } && create
-# These takes 3 arguments:
-# $1 = flags
-# $2 = files
-# $3 = dest
-INSTALL_PROGRAM = $(INSTALL) -m 755 $1 $2 $(call MK_INSTALL_DEST,$3)
-INSTALL_SCRIPT = $(INSTALL) -m 755 $1 $2 $(call MK_INSTALL_DEST,$3)
-INSTALL_SHLIB = $(INSTALL) -m 755 $1 $2 $(call MK_INSTALL_DEST,$3)
-INSTALL_DATA = $(INSTALL) -m 644 $1 $2 $(call MK_INSTALL_DEST,$3)
-INSTALL_HEADER = $(INSTALL) -m 644 $1 $2 $(call MK_INSTALL_DEST,$3)
-INSTALL_MAN = $(INSTALL) -m 644 $1 $2 $(call MK_INSTALL_DEST,$3)
-INSTALL_DOC = $(INSTALL) -m 644 $1 $2 $(call MK_INSTALL_DEST,$3)
-# Only 1 argument, the directory to create:
-INSTALL_DIR = $(INSTALL) -m 755 -d $(call MK_INSTALL_DEST,$1)
-
-MK_INSTALL_DEST = $1
+
+INSTALL_PROGRAM = $(INSTALL) -m 755
+INSTALL_SCRIPT = $(INSTALL) -m 755
+INSTALL_SHLIB = $(INSTALL) -m 755
+INSTALL_DATA = $(INSTALL) -m 644
+INSTALL_HEADER = $(INSTALL) -m 644
+INSTALL_MAN = $(INSTALL) -m 644
+INSTALL_DOC = $(INSTALL) -m 644
+INSTALL_DIR = $(INSTALL) -m 755 -d
# runhaskell and hsc2hs are special, in that other compilers besides
# GHC might provide them. Systems with a package manager often come
diff --git a/rts/ghc.mk b/rts/ghc.mk
index 797e76ba16..84f1b761b9 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -578,8 +578,8 @@ endif
.PHONY: install_libffi_headers
install_libffi_headers :
- $(call INSTALL_DIR,"$(DESTDIR)$(ghcheaderdir)")
- $(call INSTALL_HEADER,$(INSTALL_OPTS),$(libffi_HEADERS),"$(DESTDIR)$(ghcheaderdir)/")
+ $(INSTALL_DIR) "$(DESTDIR)$(ghcheaderdir)"
+ $(INSTALL_HEADER) $(INSTALL_OPTS) $(libffi_HEADERS) "$(DESTDIR)$(ghcheaderdir)/"
# -----------------------------------------------------------------------------
# cleaning
diff --git a/rules/shell-wrapper.mk b/rules/shell-wrapper.mk
index f5d91e35b7..11eef67a83 100644
--- a/rules/shell-wrapper.mk
+++ b/rules/shell-wrapper.mk
@@ -77,7 +77,7 @@ install: install_$1_$2_wrapper
.PHONY: install_$1_$2_wrapper
install_$1_$2_wrapper: WRAPPER=$$(DESTDIR)$$(bindir)/$(CrossCompilePrefix)$$($1_$2_INSTALL_SHELL_WRAPPER_NAME)
install_$1_$2_wrapper:
- $$(call INSTALL_DIR,"$$(DESTDIR)$$(bindir)")
+ $$(INSTALL_DIR) "$$(DESTDIR)$$(bindir)"
$$(call removeFiles, "$$(WRAPPER)")
$$(CREATE_SCRIPT) "$$(WRAPPER)"
echo '#!$$(SHELL)' >> "$$(WRAPPER)"
diff --git a/utils/ghc-pkg/ghc.mk b/utils/ghc-pkg/ghc.mk
index 487109e7aa..1bd44c9f12 100644
--- a/utils/ghc-pkg/ghc.mk
+++ b/utils/ghc-pkg/ghc.mk
@@ -78,7 +78,7 @@ install: install_utils/ghc-pkg_link
.PHONY: install_utils/ghc-pkg_link
install_utils/ghc-pkg_link:
- $(call INSTALL_DIR,"$(DESTDIR)$(bindir)")
+ $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
$(call removeFiles,"$(DESTDIR)$(bindir)/$(CrossCompilePrefix)ghc-pkg")
$(LN_S) $(CrossCompilePrefix)ghc-pkg-$(ProjectVersion) "$(DESTDIR)$(bindir)/$(CrossCompilePrefix)ghc-pkg"
endif
diff --git a/utils/haddock b/utils/haddock
-Subproject 62f3a12863121fa5b6c2787185e62cfa3f44bdd
+Subproject 6a1d4a65010932a660ceacda93c8c20fb5e1399
diff --git a/utils/hsc2hs b/utils/hsc2hs
-Subproject a281856375beaf9082010c445599446faad6beb
+Subproject 293f41c78e956b78363ede463e7ff52eb6bc997