summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog15
-rw-r--r--Makefile21
-rwxr-xr-xconfigure17
3 files changed, 40 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 704c5c79..bc430026 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2009-11-27 Kaz Kylheku <kkylheku@gmail.com>
+
+ Switching to DESTDIR convention for install.
+ Make install step does some things more correctly now,
+ without relying on the install program.
+
+ * configure: Help text doesn't refer to ``Makefile variables''
+ but ``make variables'', or ``variables in config.make''.
+ The install_prefix variable becomes DESTDIR now in
+ config.make.
+
+ * Make (INSTALL): New rule body macro.
+ (install): Uses of mkdir -p and cp switched to a call
+ to the INSTALL macro.
+
2009-11-26 Kaz Kylheku <kkylheku@gmail.com>
Version 026.
diff --git a/Makefile b/Makefile
index e25df5db..62bc835f 100644
--- a/Makefile
+++ b/Makefile
@@ -91,13 +91,24 @@ tests/002/%: TXR_SCRIPT_ON_CMDLINE := y
%.expected: %.txr
$(PROG) $(TXR_OPTS) $^ $(TXR_ARGS) > $@
+#
+# Installation macro.
+#
+# $1 - chmod perms
+# $2 - source file
+# $3 - dest directory
+#
+define INSTALL
+ mkdir -p $(3)
+ cp -f $(2) $(3)
+ chmod $(1) $(3)/$(notdir $(2))
+ touch -r $(2) $(3)/$(notdir $(2))
+endef
+
.PHONY: install
install: $(PROG)
- mkdir -p $(install_prefix)$(bindir)
- mkdir -p $(install_prefix)$(datadir)
- mkdir -p $(install_prefix)$(mandir)/man1
- cp txr $(install_prefix)$(bindir)
- cp $(top_srcdir)/txr.1 $(install_prefix)$(mandir)/man1
+ $(call INSTALL,0755,txr,$(DESTDIR)$(bindir))
+ $(call INSTALL,0444,$(top_srcdir)/txr.1,$(DESTDIR)$(mandir)/man1)
config.make config.h:
@echo "$@ missing: you didn't run ./configure"
diff --git a/configure b/configure
index 9f82630e..2f336dbc 100755
--- a/configure
+++ b/configure
@@ -137,7 +137,7 @@ cat <<!
usage: $0 { variable=value }*
The configure script prepares txr program for compilation and installation.
-To configure a program means to establish the values of Makefile variables
+To configure a program means to establish the values of make variables
which influence how the software is built, where it is installed.
These variables can also influence what features are present in the
software, and can determine various defaults for those behaviors which are
@@ -169,7 +169,7 @@ on the command line.
After running $0, check that the config.make contents are sane.
-The following variables are supported. Note that Makefile variable syntax may
+The following variables are supported. Note that make variable syntax may
be used in paths. Default values are shown in [square brackets].
prefix [$prefix]
@@ -180,8 +180,9 @@ prefix [$prefix]
install_prefix [$install_prefix]
Specifies an extra path prefix that will be prepended to all paths during
- installation. This allows the software to be installed in a temporary
- directory for packaging.
+ installation, which allows the software to be installed in a temporary
+ directory for packaging. This variable becomes the \$(DESTDIR)
+ variable in the config.make makefile.
bindir [$bindir]
@@ -198,8 +199,8 @@ mandir [$mandir]
cross [$cross]
Specifies the root of a cross-compiling toolchain.
- This becomes the \$(cross) variable in the Makefile, and by default
- will be added as a prefix to all of the toolchain commands.
+ This becomes the \$(cross) variable in the config.make makefile, and by
+ default will be added as a prefix to all of the toolchain commands.
It should include the trailing slash, unless the \$compiler_prefix
and \$tool_prefix variables take care of this by providing a leading slash.
@@ -221,7 +222,7 @@ cc [$cc]
Specifies the name of the toolchain front-end driver command to use for
compiling C sources to object files, and for linking object files to
- executables. This becomes the CC variable in the Makefile.
+ executables. This becomes the CC variable in config.make.
intptr [$intptr]
@@ -474,7 +475,7 @@ prefix := $prefix
# application may be temporarily installed
# for creating pre-compiled packages,
# e.g. for an operating system distro.
-install_prefix := $install_prefix
+DESTDIR := $install_prefix
# executable directory
bindir := $bindir