From 3b5d32b9ae295a8ca1881e2ea989c3e3075275fd Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 27 Nov 2009 14:00:06 -0800 Subject: Switching to DESTDIR convention for install. Make install step does some things more correctly now, without relying on the install program. --- ChangeLog | 15 +++++++++++++++ Makefile | 21 ++++++++++++++++----- configure | 17 +++++++++-------- 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 + + 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 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 <