diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2009-11-27 14:00:06 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2009-11-27 14:00:06 -0800 |
commit | 3b5d32b9ae295a8ca1881e2ea989c3e3075275fd (patch) | |
tree | f94d7df2c88df01d0a9433be93da5c30761dab64 | |
parent | 4caa11cb81fd758dc378ea3537252f7886bb5e22 (diff) | |
download | txr-3b5d32b9ae295a8ca1881e2ea989c3e3075275fd.tar.gz txr-3b5d32b9ae295a8ca1881e2ea989c3e3075275fd.tar.bz2 txr-3b5d32b9ae295a8ca1881e2ea989c3e3075275fd.zip |
Switching to DESTDIR convention for install.
Make install step does some things more correctly now,
without relying on the install program.
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | Makefile | 21 | ||||
-rwxr-xr-x | configure | 17 |
3 files changed, 40 insertions, 13 deletions
@@ -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. @@ -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" @@ -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 |