Commit abecca3e authored by Benoit Rat's avatar Benoit Rat

misc: add version to Makefile

parent f7209b9d
......@@ -22,4 +22,4 @@
# Project Specific #
####################
firmware/
pdf/
......@@ -31,6 +31,9 @@ ifneq "$(TEMPLATE)" ""
TEMPLATEARG=--template=$(TEMPLATE)
endif
## Obtain the version ($ is replaced by $$)
VERSION = $(shell git describe --always --dirty=+ | sed 's;^.*-\([v0-9\.]*\)\([a-z0-9\-+]*\)$$;\1\2;' )
#--highlight-style=pygments (the default), kate, monochrome, espresso, haddock, and tango
#-V highlight-bg=true
......@@ -46,12 +49,17 @@ DIR_%:
pdf/%.pdf: %.md Makefile $(TEMPLATE) DIR_pdf
pandoc $(OPTIONS) --latex-engine=xelatex --listings --highlight-style=haddock $(TEMPLATEARG) \
-V lang=english -V fontsize=11pt -V documentclass=article -V bg-color=238,245,240 -o $@ $<
cp $@ $(subst .pdf,-$(VERSION).pdf,$@)
%.tex: %.md Makefile $(TEMPLATE)
@echo "$(dir $@) $< $^ $(TEX)"
@echo "$(VERSION) @ $(notdir $@) $@ < $< ^ $^"
pandoc $(OPTIONS) --listings --highlight-style=haddock $(TEMPLATEARG) \
-V lang=english -V fontsize=11pt -V documentclass=article -V bg-color=238,245,240 -o $@ $<
install: $(PDF)
mkdir -p ../pdf
cp $< ../$(subst .pdf,-$(VERSION).pdf,$<)
.PHONY: clean
clean:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment