core-lightning/cli/Makefile
Rusty Russell 8375857116 common: absorb remaining files from daemon/
Also, we split the more sophisticated json_add helpers to avoid pulling in
everything into lightning-cli, and unify the routines to print struct
short_channel_id (it's ':',  not '/' too).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-08-29 17:54:14 +02:00

38 lines
1004 B
Makefile

LIGHTNING_CLI_SRC := cli/lightning-cli.c
LIGHTNING_CLI_OBJS := $(LIGHTNING_CLI_SRC:.c=.o)
JSMN_OBJS := daemon/jsmn.o
JSMN_HEADERS := daemon/jsmn/jsmn.h
LIGHTNING_CLI_COMMON_OBJS := \
common/configdir.o \
common/json.o \
common/version.o
lightning-cli-all: cli/lightning-cli
$(LIGHTNINGD_OPENING_OBJS): $(LIGHTNINGD_HEADERS)
# Git submodules are seriously broken.
daemon/jsmn/jsmn.h:
git submodule update daemon/jsmn/
[ -f $@ ] || git submodule update --init daemon/jsmn/
# If we tell Make that the above builds both, it runs it twice in
# parallel. So we lie :(
daemon/jsmn/jsmn.c: daemon/jsmn/jsmn.h
[ -f $@ ]
daemon/jsmn.o: daemon/jsmn/jsmn.c
$(COMPILE.c) -DJSMN_STRICT=1 $(OUTPUT_OPTION) $<
$(LIGHTNING_CLI_OBJS) $(JSMN_OBJS): $(JSMN_HEADERS) $(COMMON_HEADERS) $(CCAN_HEADERS)
cli/lightning-cli: $(LIGHTNING_CLI_OBJS) $(LIGHTNING_CLI_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS)
clean: lightning-cli-clean
lightning-cli-clean:
$(RM) $(LIGHTNING-CLI_LIB_OBJS) $(DAEMON_JSMN_OBJS)