aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-01-31 14:04:54 +0100
committerMattias Andrée <maandree@kth.se>2021-01-31 14:05:23 +0100
commit2a189d522c0c22c77a8a95ab16f3bf46cdab8926 (patch)
treec3330eb02ced21c3da8d4d83df9515d204693cd4 /Makefile
downloadasroot-2a189d522c0c22c77a8a95ab16f3bf46cdab8926.tar.gz
asroot-2a189d522c0c22c77a8a95ab16f3bf46cdab8926.tar.bz2
asroot-2a189d522c0c22c77a8a95ab16f3bf46cdab8926.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..9bbde8c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,29 @@
+.POSIX:
+
+CONFIGFILE = config.mk
+include $(CONFIGFILE)
+
+all: asroot
+asroot.o: asroot.c arg.h
+
+asroot: asroot.o
+ $(CC) -o $@ asroot.o $(LDFLAGS)
+
+install: asroot
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/bin/"
+ mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man8/"
+ cp -- asroot "$(DESTDIR)$(PREFIX)/bin/asroot"
+ cp -- asroot.8 "$(DESTDIR)$(MANPREFIX)/man8/asroot.8"
+
+post-install:
+ chown -- 'root:wheel' "$(DESTDIR)$(PREFIX)/bin/asroot"
+ chmod -- 4750 "$(DESTDIR)$(PREFIX)/bin/asroot"
+
+uninstall:
+ -rm -f -- "$(DESTDIR)$(PREFIX)/bin/asroot"
+ -rm -f -- "$(DESTDIR)$(MANPREFIX)/man8/asroot.8"
+
+clean:
+ -rm -f -- asroot.o asroot
+
+.PHONY: all install post-install uninstall clean