Newer
Older
web-dumps / conditor-dumps / Makefile
# This ensures the next time you run Make, it’ll properly re-run the failed
# rule, and guards against broken files.
# See https://tech.davis-hansson.com/p/make/#change-some-make-defaults
.DELETE_ON_ERROR:

# To prevent deleting intermediate files (for controls)
#.PRECIOUS: 02-download/%.json 03-create-fields/%.json

SOURCE_FILES := $(wildcard 01-query/*.txt)
TARGET_FILES := $(patsubst 01-query/%.txt, 04-enrich/%.json, $(SOURCE_FILES))

watch: ## Automatically build files when they change
	while true; do \
		inotifywait -qr -e modify -e create -e delete -e move --exclude '/\.' 01-query; \
		make all; \
	done

# Rules
all: $(TARGET_FILES) ## Build all files
	echo $(TARGET_FILES)

# cible : dépendance
04-enrich/%.json: 03-create-fields/%.json
	npx ezs 04-enrich.ini < $< > $@

03-create-fields/%.json: 02-download/%.json
	npx ezs 03-create-fields.ini < $< > $@

02-download/%.json: 01-query/%.txt
	npx ezs 02-download.ini < $< > $@