From 5d103c0498233e35773fdd2714ba706094a632f6 Mon Sep 17 00:00:00 2001 From: Rick Altherr Date: Mon, 5 Feb 2018 17:51:35 -0800 Subject: [PATCH] Makefile rules for generating complete databases Signed-off-by: Rick Altherr --- Makefile | 6 +++++- database/Makefile | 10 ++++++++++ database/Makefile.database | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 database/Makefile create mode 100644 database/Makefile.database diff --git a/Makefile b/Makefile index acc911e2..2028b5d9 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,21 @@ CLANG_FORMAT ?= clang-format -.PHONY: format clean +.PHONY: database format clean build: git submodule update --init --recursive mkdir -p build cd build; cmake ..; $(MAKE) +database: build + $(MAKE) -C $@ + format: find . -name \*.cc -and -not -path './third_party/*' -and -not -path './.git/*' -exec $(CLANG_FORMAT) -style=file -i {} \; find . -name \*.h -and -not -path './third_party/*' -and -not -path './.git/*' -exec $(CLANG_FORMAT) -style=file -i {} \; find . -name \*.py -and -not -path './third_party/*' -and -not -path './.git/*' -exec yapf -p -i {} \; clean: + $(MAKE) -C database clean $(MAKE) -C fuzzers clean rm -rf build diff --git a/database/Makefile b/database/Makefile new file mode 100644 index 00000000..99fab407 --- /dev/null +++ b/database/Makefile @@ -0,0 +1,10 @@ +.NOTPARALLEL: + +SUBDIRS := $(patsubst %/,%, $(wildcard */)) + +.PHONY: $(SUBDIRS) + +$(MAKECMDGOALS): $(SUBDIRS) + +$(SUBDIRS): + $(MAKE) -C $@ -f ../Makefile.database $(MAKECMDGOALS) diff --git a/database/Makefile.database b/database/Makefile.database new file mode 100644 index 00000000..2e407968 --- /dev/null +++ b/database/Makefile.database @@ -0,0 +1,15 @@ +.PHONY: all clean + +all: tilegrid.json + +# Small dance to say that there is a single recipe that is run once to generate +# multiple files. +tileconn.json tilegrid.json: fuzzers +.INTERMEDIATE: fuzzers +fuzzers: SHELL:=/bin/bash +fuzzers: settings.sh + source settings.sh && $(MAKE) -C ../../fuzzers all + +clean: + rm -f *.db tileconn.json tilegrid.json *.yaml + rm -rf html