Skip to content

Commit

Permalink
Add libbase58 as git submodule
Browse files Browse the repository at this point in the history
Pointing to the latest release (0.1.4)
  • Loading branch information
lclc authored and rustyrussell committed Jan 5, 2017
1 parent bdc4972 commit 3e6bb95
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "daemon/jsmn"]
path = daemon/jsmn
url = https://github.com/zserge/jsmn
[submodule "bitcoin/libbase58"]
path = bitcoin/libbase58
url = https://github.com/bitcoin/libbase58.git
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ BITCOIN_SRC := \

BITCOIN_OBJS := $(BITCOIN_SRC:.c=.o)

LIBBASE58_SRC := bitcoin/libbase58/base58.c

LIBBASE58_OBJS := $(LIBBASE58_SRC:.c=.o)

CORE_SRC := \
close_tx.c \
find_p2sh_out.c \
Expand Down Expand Up @@ -163,6 +167,8 @@ BITCOIN_HEADERS := bitcoin/address.h \
bitcoin/tx.h \
bitcoin/varint.h

LIBBASE58_HEADERS := bitcoin/libbase58/libbase58.h

CORE_HEADERS := close_tx.h \
find_p2sh_out.h \
irc.h \
Expand Down Expand Up @@ -196,7 +202,7 @@ CWARNFLAGS := -Werror -Wall -Wundef -Wmissing-prototypes -Wmissing-declarations
CDEBUGFLAGS := -g -fstack-protector
CFLAGS := $(CWARNFLAGS) $(CDEBUGFLAGS) -I $(CCANDIR) -I secp256k1/include/ -I . $(FEATURES)

LDLIBS := -lprotobuf-c -lgmp -lsodium -lbase58 -lsqlite3
LDLIBS := -lprotobuf-c -lgmp -lsodium -lsqlite3
$(PROGRAMS): CFLAGS+=-I.

default: $(PROGRAMS) $(MANPAGES) daemon-all
Expand All @@ -208,10 +214,10 @@ $(MANPAGES): doc/%: doc/%.txt
@if $(CHANGED_FROM_GIT); then echo a2x --format=manpage $<; a2x --format=manpage $<; else touch $@; fi

# Everything depends on the CCAN headers.
$(CCAN_OBJS) $(CDUMP_OBJS) $(HELPER_OBJS) $(BITCOIN_OBJS) $(TEST_PROGRAMS:=.o) ccan/ccan/cdump/tools/cdump-enumstr.o: $(CCAN_HEADERS)
$(CCAN_OBJS) $(CDUMP_OBJS) $(HELPER_OBJS) $(BITCOIN_OBJS) $(LIBBASE58_OBJS) $(TEST_PROGRAMS:=.o) ccan/ccan/cdump/tools/cdump-enumstr.o: $(CCAN_HEADERS)

# Except for CCAN, everything depends on bitcoin/ and core headers.
$(HELPER_OBJS) $(CORE_OBJS) $(BITCOIN_OBJS) $(TEST_PROGRAMS:=.o): $(BITCOIN_HEADERS) $(CORE_HEADERS) $(CCAN_HEADERS) $(GEN_HEADERS)
$(HELPER_OBJS) $(CORE_OBJS) $(BITCOIN_OBJS) $(LIBBASE58_OBJS) $(TEST_PROGRAMS:=.o): $(BITCOIN_HEADERS) $(CORE_HEADERS) $(CCAN_HEADERS) $(GEN_HEADERS)

test-protocol: test/test_protocol
set -e; TMP=`mktemp`; for f in test/commits/*.script; do if ! $(VALGRIND) test/test_protocol < $$f > $$TMP; then echo "test/test_protocol < $$f FAILED" >&2; exit 1; fi; diff -u $$TMP $$f.expected; done; rm $$TMP
Expand Down Expand Up @@ -285,7 +291,7 @@ secp256k1/libsecp256k1.la:
lightning.pb-c.c lightning.pb-c.h: lightning.proto
@if $(CHANGED_FROM_GIT); then echo $(PROTOCC) lightning.proto --c_out=.; $(PROTOCC) lightning.proto --c_out=.; else touch $@; fi

$(TEST_PROGRAMS): % : %.o $(BITCOIN_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) utils.o version.o libsecp256k1.a
$(TEST_PROGRAMS): % : %.o $(BITCOIN_OBJS) $(LIBBASE58_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) utils.o version.o libsecp256k1.a

ccan/config.h: ccan/tools/configurator/configurator
if $< > $@.new; then mv $@.new $@; else rm $@.new; exit 1; fi
Expand Down
2 changes: 1 addition & 1 deletion bitcoin/base58.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "pubkey.h"
#include "shadouble.h"
#include "utils.h"
#include "libbase58/libbase58.h"
#include <assert.h>
#include <ccan/build_assert/build_assert.h>
#include <ccan/tal/str/str.h>
#include <libbase58.h>
#include <secp256k1.h>
#include <string.h>

Expand Down
1 change: 1 addition & 0 deletions bitcoin/libbase58
Submodule libbase58 added at 16c252
4 changes: 2 additions & 2 deletions daemon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ daemon/jsmn/jsmn.c: daemon/jsmn/jsmn.h
daemon/jsmn.o: daemon/jsmn/jsmn.c
$(COMPILE.c) -DJSMN_STRICT=1 $(OUTPUT_OPTION) $<

daemon/lightningd: $(DAEMON_OBJS) $(DAEMON_LIB_OBJS) $(DAEMON_JSMN_OBJS) $(CORE_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) libsecp256k1.a
daemon/lightningd: $(DAEMON_OBJS) $(DAEMON_LIB_OBJS) $(DAEMON_JSMN_OBJS) $(CORE_OBJS) $(BITCOIN_OBJS) $(LIBBASE58_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) libsecp256k1.a

daemon/lightning-cli: $(DAEMON_CLI_OBJS) $(DAEMON_LIB_OBJS) $(DAEMON_JSMN_OBJS) $(CORE_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) libsecp256k1.a
daemon/lightning-cli: $(DAEMON_CLI_OBJS) $(DAEMON_LIB_OBJS) $(DAEMON_JSMN_OBJS) $(CORE_OBJS) $(BITCOIN_OBJS) $(LIBBASE58_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) libsecp256k1.a

daemon-clean:
$(RM) $(DAEMON_OBJS) $(DAEMON_LIB_OBJS) $(DAEMON_CLI_OBJS) $(DAEMON_JSMN_OBJS) $(DAEMON_GEN_HEADERS)
Expand Down

0 comments on commit 3e6bb95

Please sign in to comment.