aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-12-12 17:48:36 -0500
committerB. Watson <urchlay@slackware.uk>2024-12-12 17:48:36 -0500
commit2fa9a56df80620d3744df7e1ed72d24d96d658d4 (patch)
treeeede1946cdcad53d20b30b0b48d9485f4533b587 /Makefile
parent5a2fb7ba18c2c481f713543f88fb1314f49f3c52 (diff)
downloaduxd-2fa9a56df80620d3744df7e1ed72d24d96d658d4.tar.gz
add install target to Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 21 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 0c10d3a..4eae860 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,29 @@
CFLAGS=-O2 -fPIC -Wall
-.PHONY: all test man clean
+# these only affect the 'install' target (they don't get compiled
+# into the binary).
+PREFIX=/usr
+MANDIR=$(PREFIX)/man
+MAN1DIR=$(MANDIR)/man1
+BINDIR=$(PREFIX)/bin
+DESTDIR=
+INSTALL_DATA=install -m0644
+INSTALL_PROGRAM=install -s -m0755
+GZIP=gzip -9
+GZIP_MAN=yes
+
+.PHONY: all test man clean install
all: uxd man
+install: all
+ mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MAN1DIR)
+ $(INSTALL_DATA) uxd.1 $(DESTDIR)$(MAN1DIR)
+ifeq ($(GZIP_MAN),yes)
+ $(GZIP) $(DESTDIR)$(MAN1DIR)/uxd.1
+endif
+ $(INSTALL_PROGRAM) uxd $(DESTDIR)$(BINDIR)
+
test: uxd
./uxd