Makefile 2.21 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
######################################################
# Makefile for HackLab Cormano website and documents 
######################################################

# FIXME: completely missing dependency checks, ala make configure (to check config)

# Settings
# #######################################

PANDOC = pandoc
STATIC = static_output
ASSOCIAZIONE = associazione

14 15 16
dir_guard=@mkdir -p $(@D)

.PHONY: help staticdir clean deploy
17 18 19 20 21 22 23

help:
	@echo "Please use \`make <target>' where <target> is one of"
	@echo "  manifesto          build our manifesto (PDF)"
	@echo "  statuto            build our statuto (PDF and Markdown)"
	@echo "  attocostitutivo    build our atto costitutivo (PDF and Markdown)"
	@echo "  associazione       build all above documents"
24 25 26 27
	@echo "  "
	@echo "  clean              clean documents"
	@echo "  deploy             deploy documents"

28

29
# All associazione documents
30 31
associazione: manifesto statuto attocostitutivo

32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
# Manifesto
manifesto: $(ASSOCIAZIONE)/$(STATIC)/manifesto.pdf

$(ASSOCIAZIONE)/$(STATIC)/manifesto.pdf: $(ASSOCIAZIONE)/manifesto.md
	$(dir_guard)
	pandoc $< -o $@ -V links-as-notes

# Statuto
statuto: $(ASSOCIAZIONE)/$(STATIC)/statuto.pdf $(ASSOCIAZIONE)/$(STATIC)/statuto.md

$(ASSOCIAZIONE)/$(STATIC)/statuto.pdf: $(ASSOCIAZIONE)/statuto.tex
	$(dir_guard)
	pdflatex -output-directory $(@D) $< $(@F)

$(ASSOCIAZIONE)/$(STATIC)/statuto.md: $(ASSOCIAZIONE)/statuto.tex
	$(dir_guard)
	pandoc $< -o $@

# Atto costitutivo
attocostitutivo: $(ASSOCIAZIONE)/$(STATIC)/atto_costitutivo.pdf $(ASSOCIAZIONE)/$(STATIC)/atto_costitutivo.md

$(ASSOCIAZIONE)/$(STATIC)/atto_costitutivo.pdf: $(ASSOCIAZIONE)/atto_costitutivo.tex
	$(dir_guard)
	pdflatex -output-directory $(@D) $< $(@F)

$(ASSOCIAZIONE)/$(STATIC)/atto_costitutivo.md: $(ASSOCIAZIONE)/atto_costitutivo.tex
	$(dir_guard)
	pandoc $< -o $@
60

61 62 63 64
####################
# maintenance tasks
clean:
	rm -R $(ASSOCIAZIONE)/$(STATIC)/*
65

66 67
deploy:
	@echo "To be done..."
68 69 70 71 72 73

# FIXME: probably make can make this with just one parametrized stanza for all check-<command> needed
check-pandoc:
ifeq ($(shell which $(PANDOC) >/dev/null 2>&1; echo $$?), 1)
	$(error '$(PANDOC)' not found. Please make sure you have it installed and the full path of the executable is in your PATH.')
endif