aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-02-10 11:28:30 +0100
committerMattias Andrée <maandree@kth.se>2019-02-10 11:28:30 +0100
commitd84edd9500e6e22ba49c76dc93a7c0731755d008 (patch)
tree5238a0362e0f70ea44fa40906c86102d5a50a4eb /Makefile
parentFix warnings (diff)
downloadlibsha2-d84edd9500e6e22ba49c76dc93a7c0731755d008.tar.gz
libsha2-d84edd9500e6e22ba49c76dc93a7c0731755d008.tar.bz2
libsha2-d84edd9500e6e22ba49c76dc93a7c0731755d008.tar.xz
Fix libsha2_digest + minor improvements
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 4f672f7..838e391 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,7 @@ OBJ =\
digest.o\
init.o\
marshal.o\
+ process.o\
state_output_size.o\
sum_fd.o\
unhex.o\
@@ -43,7 +44,7 @@ MAN3 =\
libsha2_update.3
-all: libsha2.a libsha2.$(LIBEXT)
+all: libsha2.a libsha2.$(LIBEXT) test
$(OBJ): $(@:.o=.c) $(HDR)
$(OBJ:.o=.lo): $(@:.lo=.c) $(HDR)
@@ -53,14 +54,20 @@ $(OBJ:.o=.lo): $(@:.lo=.c) $(HDR)
.c.lo:
$(CC) -fPIC -c -o $@ $< $(CFLAGS)
+test: test.o libsha2.a
+ $(CC) -o $@ test.o libsha2.a $(LDFLAGS)
+
libsha2.$(LIBEXT): $(OBJ:.o=.lo)
$(CC) $(LIBFLAGS) -o $@ $(OBJ) $(LDFLAGS)
libsha2.a: $(OBJ)
-rm -f -- $@
- $(AR) rc $@ $?
+ $(AR) rc $@ $(OBJ)
$(AR) -s $@
+check: test
+ ./test
+
install:
mkdir -p -- "$(DESTDIR)$(PREFIX)/lib"
mkdir -p -- "$(DESTDIR)$(PREFIX)/include"