aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-06-23 09:11:42 +0200
committerMattias Andrée <maandree@kth.se>2023-06-23 09:11:42 +0200
commitebc0fb022c48ced5e690567b3fb4186a3dfbd937 (patch)
tree82f32fb8b13d64a9a11257526e4b3413c6ae4022 /Makefile
downloadkey2root-ebc0fb022c48ced5e690567b3fb4186a3dfbd937.tar.gz
key2root-ebc0fb022c48ced5e690567b3fb4186a3dfbd937.tar.bz2
key2root-ebc0fb022c48ced5e690567b3fb4186a3dfbd937.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--Makefile43
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ceafda7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,43 @@
+.POSIX:
+
+CONFIGFILE = config.mk
+include $(CONFIGFILE)
+
+BIN = key2root key2root-lskeys key2root-addkey key2root-rmkey
+
+HDR = arg.h
+
+MAN8 = $(BIN:=.8)
+OBJ = $(BIN:=.o)
+
+all: $(BIN)
+$(OBJ): $(HDR)
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
+.o:
+ $(CC) -o $@ $< $(LDFLAGS)
+
+.c:
+ $(CC) -o $@ $< $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
+
+install: $(BIN)
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/bin"
+ mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man8/"
+ cp -- $(BIN) "$(DESTDIR)$(PREFIX)/bin/"
+ cd -- "$(DESTDIR)$(PREFIX)/bin/" && chmod -- 4755 key2root
+ cp -- $(MAN8) "$(DESTDIR)$(MANPREFIX)/man8/"
+
+uninstall:
+ -cd -- "$(DESTDIR)$(PREFIX)/bin/" && rm -f -- $(BIND)
+ -cd -- "$(DESTDIR)$(MANPREFIX)/man8/" && rm -f -- $(MAN8)
+
+clean:
+ -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.gch *.gcov *.gcno *.gcda
+ -rm -f -- $(BIN)
+
+.SUFFIXES:
+.SUFFIXES: .o .c
+
+.PHONY: all install uninstall clean