aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNathan Sketch <sketchn98@gmail.com>2021-03-08 10:24:49 +1300
committerMichael Homer <mwh@mwh.geek.nz>2021-03-08 10:30:24 +1300
commitb293b11fc8d9934a9251279c045608afd49400f1 (patch)
treeb81003d50521717102816f62e95c95dda10f28d4 /Makefile
parentList -i, --icon-only option in --help (diff)
downloaddragon-b293b11fc8d9934a9251279c045608afd49400f1.tar.gz
dragon-b293b11fc8d9934a9251279c045608afd49400f1.tar.bz2
dragon-b293b11fc8d9934a9251279c045608afd49400f1.zip
Update Makefile with PREFIX, DESTDIR and man page
This commit updates the Makefile to use PREFIX more conventionally, rather than directly as the path to the bin directory. It also adds the traditional DESTDIR override to move installation elsewhere. The man page will be installed inside share/man, or MANPREFIX if specified.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 11 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index fea0d36..547d19d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
-PREFIX = $(HOME)/.local/bin
+PREFIX = $(HOME)/.local
+MANPREFIX = $(PREFIX)/share/man
all: dragon
@@ -6,5 +7,12 @@ dragon: dragon.c
$(CC) --std=c99 -Wall $(DEFINES) dragon.c -o dragon `pkg-config --cflags gtk+-3.0` `pkg-config --libs gtk+-3.0`
install: dragon
- mkdir -p $(PREFIX)
- cp dragon $(PREFIX)
+ mkdir -p $(DESTDIR)$(PREFIX)/bin
+ cp -f dragon $(DESTDIR)$(PREFIX)/bin
+ chmod 755 $(DESTDIR)$(PREFIX)/bin/dragon
+ mkdir -p $(DESTDIR)$(MANPREFIX)/man1
+ cp -f dragon.1 $(DESTDIR)$(MANPREFIX)/man1/dragon.1
+ chmod 644 $(DESTDIR)$(MANPREFIX)/man1/dragon.1
+
+uninstall:
+ rm -f $(DESTDIR)$(PREFIX)/bin/dragon $(DESTDIR)$(MANPREFIX)/man1/dragon.1
bgstack15