2020-05-26 14:07:28 +03:00
|
|
|
ZEIMENA_TOLERANCES = 100 125 250 500 1000 2000 4000
|
2020-05-26 14:17:39 +03:00
|
|
|
SINEWAVE_TOLERANCES = 1 2 3 4
|
2020-05-25 15:12:48 +03:00
|
|
|
GEN = $(addsuffix .pdf, \
|
2020-05-26 14:07:28 +03:00
|
|
|
$(addprefix sinewave-douglas-,$(SINEWAVE_TOLERANCES)) \
|
2020-05-26 14:17:39 +03:00
|
|
|
$(addprefix sinewave-visvalingam-,$(SINEWAVE_TOLERANCES)) \
|
2020-05-26 14:07:28 +03:00
|
|
|
$(addprefix zeimena-douglas-,$(ZEIMENA_TOLERANCES)) \
|
|
|
|
$(addprefix zeimena-visvalingam-,$(ZEIMENA_TOLERANCES)))
|
2020-05-22 10:19:17 +03:00
|
|
|
|
2020-05-26 12:28:32 +03:00
|
|
|
mj-referatas.pdf: mj-referatas.tex version.tex bib.bib zeimena-pretty.pdf \
|
2020-05-26 14:17:39 +03:00
|
|
|
sinewave.pdf $(GEN)
|
2020-05-22 10:19:17 +03:00
|
|
|
latexmk -g -pdf $<
|
|
|
|
|
2020-05-25 13:47:55 +03:00
|
|
|
define algo2img
|
2020-05-26 14:00:37 +03:00
|
|
|
db/.faux_$(1)-$(2)-%: $(2).sql db/.faux_ready
|
|
|
|
./managedb -- --echo-all -v ON_ERROR_STOP=1 -v src=$(1) -v tolerance=$$* -v tbl=$(1)_$(2)_$$* -f $(2).sql
|
2020-05-26 12:11:41 +03:00
|
|
|
touch $$@
|
2020-05-25 13:04:39 +03:00
|
|
|
|
2020-05-26 14:00:37 +03:00
|
|
|
$(1)-$(2)-%.pdf: layer2img.py db/.faux_$(1)-$(2)-%
|
2020-05-26 14:17:39 +03:00
|
|
|
./layer2img.py --table=$(1)_$(2)_$$* --size=$(3) --outfile $(1)-$(2)-$$*.pdf
|
2020-05-25 13:04:39 +03:00
|
|
|
endef
|
|
|
|
|
2020-05-26 14:17:39 +03:00
|
|
|
$(eval $(call algo2img,sinewave,douglas,52x12))
|
|
|
|
$(eval $(call algo2img,sinewave,visvalingam,52x12))
|
|
|
|
$(eval $(call algo2img,zeimena,douglas,52x74))
|
|
|
|
$(eval $(call algo2img,zeimena,visvalingam,52x74))
|
2020-05-22 10:19:17 +03:00
|
|
|
|
2020-05-26 12:28:32 +03:00
|
|
|
sinewave.gpkg: sinewave.py
|
2020-05-26 12:11:41 +03:00
|
|
|
./sinewave.py
|
|
|
|
|
2020-05-26 13:56:26 +03:00
|
|
|
sinewave.pdf: sinewave.gpkg
|
|
|
|
./layer2img.py --size=52x15 --infile=$< --outfile=$@
|
|
|
|
|
2020-05-26 12:28:32 +03:00
|
|
|
db/.faux_ready: zeimena.gpkg sinewave.gpkg managedb
|
2020-05-22 10:19:17 +03:00
|
|
|
-./managedb stop; rm -fr db
|
|
|
|
./managedb init
|
2020-05-26 12:11:41 +03:00
|
|
|
ogr2ogr -f PostgreSQL "PG:host=127.0.0.1 user=osm dbname=osm" zeimena.gpkg
|
2020-05-26 12:28:32 +03:00
|
|
|
ogr2ogr -f PostgreSQL "PG:host=127.0.0.1 user=osm dbname=osm" sinewave.gpkg
|
2020-05-22 10:19:17 +03:00
|
|
|
touch $@
|
|
|
|
|
2020-05-22 22:20:47 +03:00
|
|
|
REF = $(shell git describe --tags)
|
2020-05-25 13:55:24 +03:00
|
|
|
DIRTY = $(shell git status --porcelain | awk '{print"-dirty";exit}')
|
2020-05-22 10:19:17 +03:00
|
|
|
GIT_DIR = $(shell git rev-parse --show-toplevel)/.git
|
|
|
|
version.tex: $(shell git ls-files .) $(GIT_DIR)
|
2020-05-22 22:20:47 +03:00
|
|
|
( \
|
|
|
|
date '+\gdef\GeneratedAt{%F %T %Z}%'; \
|
|
|
|
printf '\gdef\VCDescribe{%s%s}%%\n' $(REF) $(DIRTY); \
|
|
|
|
) > $@
|