mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-20 06:14:23 +01:00
Makefile: add dependency on external header versions.
There were a few reports that upgrading Ubuntu recently caused issues because we assert that the sqlite3 library version matches the one we were built with. 'make' doesn't fix this, because it doesn't know the external libraries have changed. Fix this harder, with a helper which updates a file every binary depends on, which gets relinked every time so we detect link changes. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
12
Makefile
12
Makefile
@@ -334,8 +334,16 @@ gen_version.h: FORCE
|
||||
@(echo "#define VERSION \"$(VERSION)\"" && echo "#define BUILD_FEATURES \"$(FEATURES)\"") > $@.new
|
||||
@if cmp $@.new $@ >/dev/null 2>&2; then rm -f $@.new; else mv $@.new $@; echo Version updated; fi
|
||||
|
||||
# All binaries require the external libs, ccan
|
||||
$(ALL_PROGRAMS) $(ALL_TEST_PROGRAMS): $(EXTERNAL_LIBS) $(CCAN_OBJS)
|
||||
# We force make to relink this every time, to detect version changes.
|
||||
tools/headerversions: FORCE tools/headerversions.o $(CCAN_OBJS)
|
||||
@$(LINK.o) tools/headerversions.o $(CCAN_OBJS) $(LOADLIBES) $(LDLIBS) -o $@
|
||||
|
||||
# That forces this rule to be run every time, too.
|
||||
gen_header_versions.h: tools/headerversions
|
||||
@tools/headerversions $@
|
||||
|
||||
# All binaries require the external libs, ccan and external library versions.
|
||||
$(ALL_PROGRAMS) $(ALL_TEST_PROGRAMS): $(EXTERNAL_LIBS) $(CCAN_OBJS) gen_header_versions.h
|
||||
|
||||
# Each test program depends on its own object.
|
||||
$(ALL_TEST_PROGRAMS): %: %.o
|
||||
|
||||
Reference in New Issue
Block a user