template_tex/Makefile

48 lines
999 B
Makefile
Raw Normal View History

2024-03-06 02:49:41 +03:00
color = 000000
2023-09-01 22:54:35 +03:00
photo = true
2024-03-06 02:49:41 +03:00
extra = true
2023-09-01 22:54:35 +03:00
build = $(CURDIR)/build
src = $(CURDIR)/tex
2024-03-06 02:49:41 +03:00
target = $(src)/Main.tex
output = $(build)/Main.pdf
outputen = $(build)/DocumentEn.pdf
outputru = $(build)/DocumentRu.pdf
2023-09-01 22:54:35 +03:00
export DOCUMENT_COLOR := $(color)
export DOCUMENT_PHOTO := $(photo)
export DOCUMENT_EXTRA := $(extra)
.PHONY: all
all: clean icon en ru open
.PHONY: clean
2024-03-06 02:49:41 +03:00
clean:
2023-09-01 22:54:35 +03:00
@rm -rf $(build)
.PHONY: icon
icon:
@mkdir -p $(build)/image;\
cd image/icon;\
for file in *; do convert "$$file" -fill "#$$DOCUMENT_COLOR" -colorize 100 $(build)/image/"$$file" &> /dev/null || cp "$$file" $(build)/image/; done
.PHONY: en
en: icon
@mkdir -p $(build);\
cd $(src);\
export DOCUMENT_LANG=en;\
lualatex --output-dir=$(build) $(target);\
mv $(output) $(outputen)
.PHONY: ru
ru: icon
@mkdir -p $(build);\
cd $(src);\
export DOCUMENT_LANG=ru;\
lualatex --output-dir=$(build) $(target);\
mv $(output) $(outputru)
.PHONY: open
open:
@xdg-open $(outputen);\
xdg-open $(outputru)