From 9dfc854d943e06a1b775aa086d7bf456a393dd29 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 21 Aug 2019 12:30:27 +0930 Subject: [PATCH] tools/Makefile: put all tools/ stuff here. Generally a Makefile should control make within that directory. Signed-off-by: Rusty Russell --- Makefile | 13 +------------ tools/Makefile | 13 +++++++++++++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 941a7a05e..5760a7e2e 100644 --- a/Makefile +++ b/Makefile @@ -289,10 +289,6 @@ bolt-precheck: check-source-bolt: $(ALL_TEST_PROGRAMS:%=bolt-check/%.c) -tools/check-bolt: tools/check-bolt.o $(CCAN_OBJS) common/utils.o - -tools/check-bolt.o: $(CCAN_HEADERS) - check-whitespace/%: % @if grep -Hn '[ ]$$' $<; then echo Extraneous whitespace found >&2; exit 1; fi @@ -373,11 +369,6 @@ 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 -# We force make to relink this every time, to detect version changes. -# Do it atomically, otherwise parallel builds can get upset! -tools/headerversions: FORCE tools/headerversions.o $(CCAN_OBJS) - @trap "rm -f $@.tmp.$$$$" EXIT; $(LINK.o) tools/headerversions.o $(CCAN_OBJS) $(LOADLIBES) $(LDLIBS) -o $@.tmp.$$$$ && mv $@.tmp.$$$$ $@ - # That forces this rule to be run every time, too. gen_header_versions.h: tools/headerversions @tools/headerversions $@ @@ -429,14 +420,12 @@ maintainer-clean: distclean @echo 'This command is intended for maintainers to use; it' @echo 'deletes files that may need special tools to rebuild.' -clean: wire-clean +clean: $(RM) $(CCAN_OBJS) $(CDUMP_OBJS) $(ALL_OBJS) $(RM) $(ALL_PROGRAMS) $(ALL_PROGRAMS:=.o) $(RM) $(ALL_TEST_PROGRAMS) $(ALL_TEST_PROGRAMS:=.o) $(RM) gen_*.h ccan/tools/configurator/configurator $(RM) ccan/ccan/cdump/tools/cdump-enumstr.o - $(RM) check-bolt tools/check-bolt tools/*.o - $(RM) tools/headerversions find . -name '*gcda' -delete find . -name '*gcno' -delete find . -name '*.nccout' -delete diff --git a/tools/Makefile b/tools/Makefile index c4e8afa67..6766586c3 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,2 +1,15 @@ #! /usr/bin/make + +# We force make to relink this every time, to detect version changes. +# Do it atomically, otherwise parallel builds can get upset! +tools/headerversions: FORCE tools/headerversions.o $(CCAN_OBJS) + @trap "rm -f $@.tmp.$$$$" EXIT; $(LINK.o) tools/headerversions.o $(CCAN_OBJS) $(LOADLIBES) $(LDLIBS) -o $@.tmp.$$$$ && mv $@.tmp.$$$$ $@ + +tools/check-bolt: tools/check-bolt.o $(CCAN_OBJS) common/utils.o +tools/check-bolt.o: $(CCAN_HEADERS) + +clean: + $(RM) tools/check-bolt tools/*.o + $(RM) tools/headerversions + include tools/test/Makefile