aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-01-16 21:41:44 +0100
committerMattias Andrée <maandree@kth.se>2022-01-16 21:42:39 +0100
commitfcc5eb9f87a476115cc742bf45056ccbbc830057 (patch)
tree4180fc846779d3e7e90d36122392f48193b88659 /Makefile
parentFirst commit (diff)
downloadblakesum-fcc5eb9f87a476115cc742bf45056ccbbc830057.tar.gz
blakesum-fcc5eb9f87a476115cc742bf45056ccbbc830057.tar.bz2
blakesum-fcc5eb9f87a476115cc742bf45056ccbbc830057.tar.xz
m + add b2sum
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--Makefile30
1 files changed, 22 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 3f743a8..e09140b 100644
--- a/Makefile
+++ b/Makefile
@@ -3,31 +3,43 @@
CONFIGFILE = config.mk
include $(CONFIGFILE)
+BIN =\
+ bsum\
+ b2sum
+
OBJ =\
- bsum.o
+ $(BIN:=.o)\
+ common.o
HDR =\
arg.h\
common.h
-all: bsum
+all: $(BIN)
$(OBJ): $(HDR)
.c.o:
$(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
-bsum: $(OBJ)
- $(CC) -o $@ $(OBJ) $(LDFLAGS)
+bsum: bsum.o common.o
+ $(CC) -o $@ $@.o common.o $(LDFLAGS)
+
+b2sum: b2sum.o common.o
+ $(CC) -o $@ $@.o common.o $(LDFLAGS)
-install: bsum
+install: $(BIN)
mkdir -p -- "$(DESTDIR)$(PREFIX)/bin"
mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1/"
- cp -- bsum "$(DESTDIR)$(PREFIX)/bin/"
+ cp -- $(BIN) "$(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/"
+ cp -- $(BIN:=.1) "$(DESTDIR)$(MANPREFIX)/man1/"
+ cp -- b224sum.1 "$(DESTDIR)$(MANPREFIX)/man1/b224sum.1"
+ cp -- b256sum.1 "$(DESTDIR)$(MANPREFIX)/man1/b256sum.1"
+ cp -- b384sum.1 "$(DESTDIR)$(MANPREFIX)/man1/b384sum.1"
+ cp -- b512sum.1 "$(DESTDIR)$(MANPREFIX)/man1/b512sum.1"
uninstall:
-rm -f -- "$(DESTDIR)$(PREFIX)/bin/bsum"
@@ -35,15 +47,17 @@ uninstall:
-rm -f -- "$(DESTDIR)$(PREFIX)/bin/b256sum"
-rm -f -- "$(DESTDIR)$(PREFIX)/bin/b384sum"
-rm -f -- "$(DESTDIR)$(PREFIX)/bin/b512sum"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/bin/b2sum"
-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"
+ -rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/b2sum.1"
clean:
-rm -f -- *.o *.su *.gcov *.gcno *.gcda
- -rm -f -- bsum
+ -rm -f -- $(BIN)
.SUFFIXES:
.SUFFIXES: .o .c