diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..89ea424 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +OBJS = crypto/rsa.o crypto/encoding/asn1.o crypto/encoding/base58.o crypto/encoding/base64.o \ + crypto/encoding/x509.o thirdparty/mbedtls/*.o + + +all: + cd crypto; make all; + cd thirdparty; make all; + ar rcs libp2p.a $(OBJS) + +clean: + cd crypto; make clean; + cd thirdparty; make clean + rm -rf libp2p.a + \ No newline at end of file diff --git a/crypto/Makefile b/crypto/Makefile new file mode 100644 index 0000000..7a53625 --- /dev/null +++ b/crypto/Makefile @@ -0,0 +1,16 @@ +CC = gcc +CFLAGS = -O0 -I../include +LFLAGS = +DEPS = +OBJS = rsa.o + +%.o: %.c $(DEPS) + $(CC) -c -o $@ $< $(CFLAGS) + + +all: $(OBJS) + cd encoding; make all; + +clean: + rm -f *.o + cd encoding; make clean; diff --git a/crypto/encoding/Makefile b/crypto/encoding/Makefile new file mode 100644 index 0000000..b492ef3 --- /dev/null +++ b/crypto/encoding/Makefile @@ -0,0 +1,14 @@ +CC = gcc +CFLAGS = -O0 -I../../include +LFLAGS = +DEPS = +OBJS = asn1.o base58.o base64.o x509.o + +%.o: %.c $(DEPS) + $(CC) -c -o $@ $< $(CFLAGS) + + +all: $(OBJS) + +clean: + rm -f *.o diff --git a/crypto/encoding/base58.c b/crypto/encoding/base58.c index 73f4a26..1b17041 100644 --- a/crypto/encoding/base58.c +++ b/crypto/encoding/base58.c @@ -7,6 +7,8 @@ #include #include +#include +#include static const char b58digits_ordered[] = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; diff --git a/thirdparty/Makefile b/thirdparty/Makefile new file mode 100644 index 0000000..3b9398e --- /dev/null +++ b/thirdparty/Makefile @@ -0,0 +1,5 @@ +all: + cd mbedtls; make all; + +clean: + cd mbedtls; make clean; \ No newline at end of file diff --git a/thirdparty/mbedtls/Makefile b/thirdparty/mbedtls/Makefile index 28f9231..7891654 100644 --- a/thirdparty/mbedtls/Makefile +++ b/thirdparty/mbedtls/Makefile @@ -1,7 +1,7 @@ # Also see "include/mbedtls/config.h" -CFLAGS ?= -O2 +CFLAGS ?= -O2 -I../../include WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement LDFLAGS ?=