summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-27 14:00:06 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-27 14:00:06 -0800
commit3b5d32b9ae295a8ca1881e2ea989c3e3075275fd (patch)
treef94d7df2c88df01d0a9433be93da5c30761dab64 /Makefile
parent4caa11cb81fd758dc378ea3537252f7886bb5e22 (diff)
downloadtxr-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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 16 insertions, 5 deletions
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"