27 lines
532 B
Makefile
27 lines
532 B
Makefile
src:=sql/rowing.sql
|
|
db:=db/rowing.sqlite3
|
|
|
|
# the default recipe will work
|
|
# as long as PHONYs are followed
|
|
# by a comment
|
|
|
|
.PHONY: default
|
|
# List all recipes
|
|
default:
|
|
@sed -n '/^\.PHONY:/{ s/^\.PHONY: \(.*\)$$/\1/; N; s/\n/ /; s/ # /::/; p; }' \
|
|
< Makefile \
|
|
| awk -F '::' 'BEGIN { print "Usage:" } { printf "%10s: %s\n",$$1,$$2 }' \
|
|
|
|
.PHONY: db
|
|
# Build the database
|
|
db: ${db}
|
|
|
|
${db}: ${src}
|
|
@mkdir -p $(@D) \
|
|
&& sqlite3 $@ ".read $<" && echo "Created database."
|
|
|
|
.PHONY: clean
|
|
# Destroy generated files
|
|
clean:
|
|
@rm -f ${db}
|