Browse Source

gen_pkt_names, gen_state_names: move into daemon/

That's where they're used.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
ec072b5d68
  1. 11
      Makefile
  2. 11
      daemon/Makefile
  3. 4
      names.c

11
Makefile

@ -162,9 +162,7 @@ CORE_HEADERS := close_tx.h \
utils.h \
version.h
GEN_HEADERS := gen_pkt_names.h \
gen_state_names.h \
gen_version.h \
GEN_HEADERS := gen_version.h \
lightning.pb-c.h
CDUMP_OBJS := ccan-cdump.o ccan-strmap.o
@ -249,13 +247,6 @@ FORCE::
ccan/ccan/cdump/tools/cdump-enumstr: ccan/ccan/cdump/tools/cdump-enumstr.o $(CDUMP_OBJS) $(CCAN_OBJS)
gen_state_names.h: state_types.h ccan/ccan/cdump/tools/cdump-enumstr
ccan/ccan/cdump/tools/cdump-enumstr state_types.h > $@
# lightning.pb-c.h doesn't create a named enum, just a typedef. Hack it.
gen_pkt_names.h: lightning.pb-c.h ccan/ccan/cdump/tools/cdump-enumstr
(echo 'enum PktCase {'; grep '^ PKT__' lightning.pb-c.h; echo '};') | ccan/ccan/cdump/tools/cdump-enumstr - | sed 's/enum PktCase/Pkt__PktCase/' > $@
# We build a static libsecpk1, since we need ecdh
# (and it's not API stable yet!).
libsecp256k1.a: secp256k1/libsecp256k1.la

11
daemon/Makefile

@ -54,7 +54,9 @@ DAEMON_JSMN_HEADERS := daemon/jsmn/jsmn.h
DAEMON_GEN_HEADERS := \
daemon/gen_feechange_state_names.h \
daemon/gen_htlc_state_names.h
daemon/gen_htlc_state_names.h \
daemon/gen_pkt_names.h \
daemon/gen_state_names.h
DAEMON_HEADERS := \
daemon/bitcoind.h \
@ -97,6 +99,13 @@ daemon/gen_htlc_state_names.h: daemon/htlc_state.h ccan/ccan/cdump/tools/cdump-e
daemon/gen_feechange_state_names.h: daemon/feechange_state.h ccan/ccan/cdump/tools/cdump-enumstr
ccan/ccan/cdump/tools/cdump-enumstr daemon/feechange_state.h > $@
daemon/gen_state_names.h: state_types.h ccan/ccan/cdump/tools/cdump-enumstr
ccan/ccan/cdump/tools/cdump-enumstr state_types.h > $@
# lightning.pb-c.h doesn't create a named enum, just a typedef. Hack it.
daemon/gen_pkt_names.h: lightning.pb-c.h ccan/ccan/cdump/tools/cdump-enumstr
(echo 'enum PktCase {'; grep '^ PKT__' lightning.pb-c.h; echo '};') | ccan/ccan/cdump/tools/cdump-enumstr - | sed 's/enum PktCase/Pkt__PktCase/' > $@
$(DAEMON_OBJS) $(DAEMON_LIB_OBJS) $(DAEMON_CLI_OBJS): $(DAEMON_HEADERS) $(DAEMON_JSMN_HEADERS) $(BITCOIN_HEADERS) $(CORE_HEADERS) $(GEN_HEADERS) $(DAEMON_GEN_HEADERS) $(CCAN_HEADERS)
$(DAEMON_JSMN_OBJS): $(DAEMON_JSMN_HEADERS)

4
names.c

@ -1,8 +1,8 @@
#include "names.h"
#include <ccan/str/str.h>
/* Indented for 'check-source' because it has to be included after names.h */
#include "gen_state_names.h"
#include "gen_pkt_names.h"
#include "daemon/gen_state_names.h"
#include "daemon/gen_pkt_names.h"
const char *state_name(enum state s)
{

Loading…
Cancel
Save