aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-02-09 18:20:57 +0100
committerMattias Andrée <maandree@kth.se>2019-02-09 18:20:57 +0100
commit242430d5e52cf8ee49dcd1701cf134e7454910c6 (patch)
treee3238ce604ffb0d80a4e122cd40d5807372f187f /Makefile
parentMerge pull request #2 from maaku/no-trailing-comma (diff)
downloadlibsha2-242430d5e52cf8ee49dcd1701cf134e7454910c6.tar.gz
libsha2-242430d5e52cf8ee49dcd1701cf134e7454910c6.tar.bz2
libsha2-242430d5e52cf8ee49dcd1701cf134e7454910c6.tar.xz
Change license to ISC and reorganise
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--Makefile55
1 files changed, 55 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..566907e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,55 @@
+.NONPOSIX:
+
+CONFIGFILE = config.mk
+
+LIB_MAJOR = 1
+LIB_MINOR = 0
+LIB_VERSION = $(LIB_MAJOR).$(LIB_MINOR)
+
+LIBEXT = so
+LIBFLAGS = -shared -Wl,-soname,libsha2.$(LIBEXT).$(LIB_MAJOR)
+
+include $(CONFIGFILE)
+
+
+HDR =\
+ libsha2.h\
+ common.h
+
+OBJ =\
+ algorithm_output_size.o\
+ behex_lower.o\
+ behex_upper.o\
+ digest.o\
+ state_initialise.o\
+ state_output_size.o\
+ sum_fd.o\
+ unhex.o\
+ update.o\
+
+
+all: libsha2.a libsha2.$(LIBEXT)
+$(OBJ): $(@:.o=.c) $(HDR)
+$(OBJ:.o=.lo): $(@:.lo=.c) $(HDR)
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS)
+
+.c.lo:
+ $(CC) -fPIC -c -o $@ $< $(CFLAGS)
+
+libsha2.$(LIBEXT): $(OBJ)
+ $(CC) $(LIBFLAGS) -o $@ $(OBJ) $(LDFLAGS)
+
+libsha2.a: $(OBJ)
+ -rm -f -- $@
+ $(AR) rc $@ $?
+ $(AR) -s $@
+
+clean:
+ -rm -f -- *.o *.lo *.su *.a *.so
+
+.SUFFIXES:
+.SUFFIXES: .lo .o .c
+
+.PHONY: all check install uninstall clean