fix: adjust makefile

This commit is contained in:
dancingCycle 2023-05-09 10:40:04 +02:00
parent c941c6c229
commit d35dafdf5c
1 changed files with 8 additions and 0 deletions

View File

@ -1,9 +1,17 @@
SHELL := /bin/bash
TABLES = stops
SCHEMA = zhv
psql = $(strip psql -v schema=$(SCHEMA))
# $(addprefix prefix,names…): The argument names is regarded as a series of names, separated by whitespace; prefix is used as a unit. The value of prefix is prepended to the front of each individual name and the resulting larger names are concatenated with single spaces between them.
#
# FORMAT(format_string [, format_arg [, ...] ])
load: $(addprefix load-,$(TABLES))
@$(psql) -t -A -c "SELECT FORMAT('* loaded %s', feed_file) WHERE feed_file = '$(GTFS)';"
# -v: variable assignment, like the /set meta-command
# $<: name of the firest prerequisite
init: sql/schema.sql