aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-01-07 11:42:40 +0100
committerMattias Andrée <maandree@kth.se>2022-01-07 11:42:40 +0100
commit222f009731176e3d54d2e45e1c7fd9ccf0f97dd2 (patch)
tree14145dfbd589c05c46a7c6a0902339960ddb6d04 /Makefile
downloadblakesum-222f009731176e3d54d2e45e1c7fd9ccf0f97dd2.tar.gz
blakesum-222f009731176e3d54d2e45e1c7fd9ccf0f97dd2.tar.bz2
blakesum-222f009731176e3d54d2e45e1c7fd9ccf0f97dd2.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--Makefile51
1 files changed, 51 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3f743a8
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,51 @@
+.POSIX:
+
+CONFIGFILE = config.mk
+include $(CONFIGFILE)
+
+OBJ =\
+ bsum.o
+
+HDR =\
+ arg.h\
+ common.h
+
+all: bsum
+$(OBJ): $(HDR)
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
+bsum: $(OBJ)
+ $(CC) -o $@ $(OBJ) $(LDFLAGS)
+
+install: bsum
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/bin"
+ mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1/"
+ cp -- bsum "$(DESTDIR)$(PREFIX)/bin/"
+ ln -sf -- bsum "$(DESTDIR)$(PREFIX)/bin/b224sum"
+ ln -sf -- bsum "$(DESTDIR)$(PREFIX)/bin/b256sum"
+ ln -sf -- bsum "$(DESTDIR)$(PREFIX)/bin/b384sum"
+ ln -sf -- bsum "$(DESTDIR)$(PREFIX)/bin/b512sum"
+ cp -- bsum.1 "$(DESTDIR)$(MANPREFIX)/man1/"
+
+uninstall:
+ -rm -f -- "$(DESTDIR)$(PREFIX)/bin/bsum"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/bin/b224sum"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/bin/b256sum"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/bin/b384sum"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/bin/b512sum"
+ -rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/bsum.1"
+ -rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/b224sum.1"
+ -rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/b256sum.1"
+ -rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/b384sum.1"
+ -rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/b512sum.1"
+
+clean:
+ -rm -f -- *.o *.su *.gcov *.gcno *.gcda
+ -rm -f -- bsum
+
+.SUFFIXES:
+.SUFFIXES: .o .c
+
+.PHONY: all install uninstall clean