2015-05-26 06:38:12 +02:00
|
|
|
#! /usr/bin/make
|
|
|
|
|
|
|
|
# Needs to have oneof support: Ubuntu vivid's is too old :(
|
|
|
|
PROTOCC:=protoc-c
|
|
|
|
|
2015-05-26 06:44:19 +02:00
|
|
|
PROGRAMS := open-channel
|
2015-05-26 06:38:12 +02:00
|
|
|
|
|
|
|
HELPER_OBJS := base58.o lightning.pb-c.o shadouble.o pkt.o
|
|
|
|
CCAN_OBJS := ccan-crypto-sha256.o ccan-crypto-shachain.o ccan-err.o ccan-tal.o ccan-tal-str.o ccan-take.o ccan-list.o ccan-str.o ccan-opt-helpers.o ccan-opt.o ccan-opt-parse.o ccan-opt-usage.o ccan-read_write_all.o ccan-str-hex.o
|
|
|
|
|
2015-05-26 06:44:19 +02:00
|
|
|
OPEN_CHANNEL_OBJS := open-channel.o $(HELPER_OBJS) $(CCAN_OBJS)
|
2015-05-26 06:38:12 +02:00
|
|
|
|
|
|
|
HEADERS := base58.h lightning.pb-c.h pd_channel.h pkt.h shadouble.h
|
|
|
|
|
|
|
|
CCANDIR := ../ccan/
|
|
|
|
CFLAGS := -g -Wall -I $(CCANDIR) #-I $(PROTO_INCLUDE_DIR)
|
|
|
|
LDLIBS := -lcrypto -lprotobuf-c
|
|
|
|
|
2015-05-26 06:44:19 +02:00
|
|
|
default: open-channel
|
2015-05-26 06:38:12 +02:00
|
|
|
|
|
|
|
lightning.pb-c.c lightning.pb-c.h: lightning.proto
|
|
|
|
$(PROTOCC) lightning.proto --c_out=.
|
|
|
|
|
2015-05-26 06:44:19 +02:00
|
|
|
open-channel: $(OPEN_CHANNEL_OBJS)
|
|
|
|
$(OPEN_CHANNEL_OBJS): $(HEADERS)
|
2015-05-26 06:38:12 +02:00
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
$(RM) lightning.pb-c.c lightning.pb-c.h
|
|
|
|
|
|
|
|
clean:
|
2015-05-26 06:44:19 +02:00
|
|
|
$(RM) $(OPEN_CHANNEL_OBJS)
|
2015-05-26 06:38:12 +02:00
|
|
|
|
|
|
|
ccan-tal.o: $(CCANDIR)/ccan/tal/tal.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-tal-str.o: $(CCANDIR)/ccan/tal/str/str.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-take.o: $(CCANDIR)/ccan/take/take.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-list.o: $(CCANDIR)/ccan/list/list.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-read_write_all.o: $(CCANDIR)/ccan/read_write_all/read_write_all.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-str.o: $(CCANDIR)/ccan/str/str.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-opt.o: $(CCANDIR)/ccan/opt/opt.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-opt-helpers.o: $(CCANDIR)/ccan/opt/helpers.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-opt-parse.o: $(CCANDIR)/ccan/opt/parse.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-opt-usage.o: $(CCANDIR)/ccan/opt/usage.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-err.o: $(CCANDIR)/ccan/err/err.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-str-hex.o: $(CCANDIR)/ccan/str/hex/hex.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-crypto-shachain.o: $(CCANDIR)/ccan/crypto/shachain/shachain.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-crypto-sha256.o: $(CCANDIR)/ccan/crypto/sha256/sha256.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|