summaryrefslogtreecommitdiff
path: root/planner/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'planner/Makefile')
-rw-r--r--planner/Makefile67
1 files changed, 60 insertions, 7 deletions
diff --git a/planner/Makefile b/planner/Makefile
index fbfbac8..3f47ae4 100644
--- a/planner/Makefile
+++ b/planner/Makefile
@@ -1,20 +1,73 @@
DESTDIR = dest
-LANG_NAME := $(if $(LANG_NAME),$(LANG_NAME),en)
+LANG_NAME := $(shell echo $(LANG) | cut -c 1-2 )
+
+LATITUDE ?= "45.81478"
+LONGITUDE ?= "9.07522"
+TIMEZONE ?= "Europe/Rome"
PDF_TARGETS = $(patsubst templates/%-v.svg,$(DESTDIR)/%-$(LANG_NAME).pdf,$(wildcard templates/*-v.svg))
NUP2_TARGETS = $(patsubst templates/%-v.svg,$(DESTDIR)/%-$(LANG_NAME)-book.pdf,$(wildcard templates/*-A5*-v.svg))
NUP4_TARGETS = $(patsubst templates/%-v.svg,$(DESTDIR)/%-$(LANG_NAME)-book.pdf,$(wildcard templates/*-A6*-v.svg))
-.PHONY: all pdf nup clean
+.PHONY: all pdf nup clean distclean
all: pdf nup
pdf: $(PDF_TARGETS)
nup: $(NUP4_TARGETS) $(NUP2_TARGETS)
-$(DESTDIR)/%-$(LANG_NAME).pdf: TEMPLATE_NAME = $(subst -$(LANG_NAME),,$(basename $(notdir $@)))
-$(DESTDIR)/%-$(LANG_NAME).pdf: templates/%-r.svg templates/%-v.svg templates/cover*.svg
- echo ./planner_generator.py --template $(TEMPLATE_NAME) `echo $(TEMPLATE_NAME) | awk -F "i[-_]" '{print $1}'`
+debug:
+ echo $(LANG_NAME)
+
+# Individual designs
+
+$(DESTDIR)/daily-95×186-$(LANG_NAME).pdf: templates/daily-95×186-r.svg templates/daily-95×186-v.svg templates/cover-95×186-r.svg planner_generator.py
+ mkdir -p $(DESTDIR)
+ ./planner_generator.py --template daily-95×186 --cover-template cover-95×186-r.svg daily --outdir $(DESTDIR)
+
+$(DESTDIR)/daily-graph-A5-$(LANG_NAME).pdf: templates/daily-graph-A5-r.svg templates/daily-graph-A5-v.svg templates/cover-A5-r.svg planner_generator.py
+ ./planner_generator.py --template daily-graph-A5 --outdir $(DESTDIR) daily
+
+$(DESTDIR)/daily-points4mm-A5-$(LANG_NAME).pdf: templates/daily-points4mm-A5-r.svg templates/daily-points4mm-A5-v.svg templates/cover-A5-r.svg planner_generator.py
+ ./planner_generator.py --template daily-points4mm-A5 --outdir $(DESTDIR) daily
+
+$(DESTDIR)/daily-ruled-A5-$(LANG_NAME).pdf: planner_generator.py templates/daily-ruled-A5-r.svg templates/daily-ruled-A5-r.svg templates/cover-A5-r.svg
+ ./planner_generator.py --template daily-ruled-A5 --outdir $(DESTDIR) daily
+
+$(DESTDIR)/daily-A5-$(LANG_NAME).pdf: planner_generator.py templates/daily-A5-r.svg templates/daily-A5-v.svg templates/cover-A5-r.svg
+ ./planner_generator.py --template daily-A5 --outdir $(DESTDIR) daily
+
+$(DESTDIR)/daily-A6-$(LANG_NAME).pdf: planner_generator.py templates/daily-A6-r.svg templates/daily-A6-v.svg templates/cover-A6-r.svg
+ ./planner_generator.py --template daily-A6 --outdir $(DESTDIR) daily
+
+$(DESTDIR)/month-A6-$(LANG_NAME).pdf: planner_generator.py templates/month-A6-r.svg templates/month-A6-v.svg
+ ./planner_generator.py --template month-A6 --outdir $(DESTDIR) month
+
+$(DESTDIR)/week_health-A6-$(LANG_NAME).pdf: planner_generator.py templates/week_health-A6-r.svg templates/week_health-A6-v.svg templates/cover-A6-r.svg
+ ./planner_generator.py --template week_health-A6 --latitude $(LATITUDE) --longitude $(LONGITUDE) --timezone $(TIMEZONE) --outdir $(DESTDIR) ephemerisbiweekly
+
+$(DESTDIR)/week_on_one_page-A6-$(LANG_NAME).pdf: planner_generator.py templates/week_on_one_page-A6-r.svg templates/week_on_one_page-A6-v.svg templates/cover-A6-r.svg
+ ./planner_generator.py --template week_on_one_page-A6 --latitude $(LATITUDE) --longitude $(LONGITUDE) --timezone $(TIMEZONE) --outdir $(DESTDIR) ephemerisbiweekly
+
+$(DESTDIR)/week_on_one_page_dots-A6-$(LANG_NAME).pdf: planner_generator.py templates/week_on_one_page_dots-A6-r.svg templates/week_on_one_page_dots-A6-v.svg templates/cover-A6-r.svg
+ ./planner_generator.py --template week_on_one_page_dots-A6 --outdir $(DESTDIR) biweekly
+
+$(DESTDIR)/week_on_two_pages-A6-$(LANG_NAME).pdf: planner_generator.py templates/week_on_two_pages-A6-r.svg templates/week_on_two_pages-A6-v.svg templates/cover-A6-r.svg
+ ./planner_generator.py --template week_on_two_pages-A6 --outdir $(DESTDIR) weekly
+
+$(DESTDIR)/%-$(LANG_NAME).pdf:
+ echo "building $@ is not supported yet"
+
+
+# nup-ping
+
+$(DESTDIR)/%-A5-$(LANG_NAME)-book.pdf: $(DESTDIR)/%-A5-$(LANG_NAME).pdf
+ ../page_manipulation/a5_book.py $^
+
+$(DESTDIR)/%-A6-$(LANG_NAME)-book.pdf: $(DESTDIR)/%-A6-$(LANG_NAME).pdf
+ ../page_manipulation/a6_book.py $^
-$(DESTDIR)/%-$(LANG_NAME)-book.pdf: $(DESTDIR)/%-$(LANG_NAME).pdf
- echo $@
+clean:
+ rm build/*
+distclean:
+ rm $(DESTDIR)/*