kopia lustrzana https://github.com/openmaptiles/openmaptiles
Fix Makefile duplicate runs (#923)
Make sure that core targets (i.e. part of the `all` target like build-sql and build yaml files) do not run multiple times if they already exist. Makefile for some reason does not like it when a real target depends on a PHONY target, and re-runs it. I added an `if` statement to skip building targets if their result already exists.pull/920/head^2
rodzic
6457419e0d
commit
60a3e1ea70
13
Makefile
13
Makefile
|
@ -192,24 +192,31 @@ help:
|
|||
|
||||
.PHONY: init-dirs
|
||||
init-dirs:
|
||||
@mkdir -p build/sql
|
||||
@mkdir -p build/sql/parallel
|
||||
@mkdir -p build/openmaptiles.tm2source
|
||||
@mkdir -p data/borders
|
||||
@mkdir -p cache
|
||||
|
||||
build/openmaptiles.tm2source/data.yml: init-dirs
|
||||
mkdir -p build/openmaptiles.tm2source
|
||||
ifeq (,$(wildcard build/openmaptiles.tm2source/data.yml))
|
||||
$(DOCKER_COMPOSE) run $(DC_OPTS) openmaptiles-tools generate-tm2source openmaptiles.yaml --host="postgres" --port=5432 --database="openmaptiles" --user="openmaptiles" --password="openmaptiles" > $@
|
||||
endif
|
||||
|
||||
build/mapping.yaml: init-dirs
|
||||
ifeq (,$(wildcard build/mapping.yaml))
|
||||
$(DOCKER_COMPOSE) run $(DC_OPTS) openmaptiles-tools generate-imposm3 openmaptiles.yaml > $@
|
||||
endif
|
||||
|
||||
.PHONY: build-sql
|
||||
build-sql: init-dirs
|
||||
ifeq (,$(wildcard build/sql/run_last.sql))
|
||||
@mkdir -p build/sql/parallel
|
||||
$(DOCKER_COMPOSE) run $(DC_OPTS) openmaptiles-tools bash -c \
|
||||
'generate-sql openmaptiles.yaml --dir ./build/sql \
|
||||
&& generate-sqltomvt openmaptiles.yaml \
|
||||
--key --gzip --postgis-ver 3.0.1 \
|
||||
--function --fname=getmvt >> "./build/sql/run_last.sql"'
|
||||
--function --fname=getmvt >> ./build/sql/run_last.sql'
|
||||
endif
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
|
Ładowanie…
Reference in New Issue