Skip to content

Commit

Permalink
Add make targets for building release zips
Browse files Browse the repository at this point in the history
  • Loading branch information
janusvm committed Oct 5, 2018
1 parent a417e0d commit abcb9ff
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,6 @@ TSWLatexianTemp*

# generated if using elsarticle.cls
*.spl

# Build folder for preparing GitHub releases
build/
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ PDFS := $(RMDS:.Rmd=.pdf)

all: latex notes

release: clean-build
mkdir -p build
for dir in $(TEMPLATES); do \
$(MAKE) -C $$dir release; \
echo build/`basename $$dir`.zip; \
(cd $$dir && zip -r - . -x Makefile) > build/`basename $$dir`.zip; \
done

latex:
for dir in $(TEMPLATES); do \
$(MAKE) -C $$dir; \
Expand All @@ -18,13 +26,16 @@ latex:
notes: $(PDFS)

%.pdf: %.Rmd
cd resources; \
cd resources
Rscript --slave --vanilla -e "rmarkdown::render('$(<F)')"

clean:
rm -f $(PDFS); \
clean-build:
rm -f build/*

clean: clean-build
rm -f $(PDFS)
for dir in $(TEMPLATES); do \
$(MAKE) -C $$dir clean; \
done

.PHONY: all latex notes clean
.PHONY: all release latex notes clean-build clean
7 changes: 6 additions & 1 deletion latex-template/da/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ INPUT := $(shell find incl/ fig/ py/ -type f ! -name '*.aux')
$(MASTER).pdf: $(MASTER).tex $(INPUT) $(PREAMBLE)
latexmk -pdf -quiet $(MASTER)

release: clean
$(MAKE)
latexmk -bibtex -c

clean:
rm -rf `find -type d -name auto`
latexmk -bibtex -C

.PHONY: master clean
.PHONY: release clean
7 changes: 6 additions & 1 deletion latex-template/en/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ INPUT := $(shell find incl/ fig/ py/ -type f ! -name '*.aux')
$(MASTER).pdf: $(MASTER).tex $(INPUT) $(PREAMBLE)
latexmk -pdf -quiet $(MASTER)

release: clean
$(MAKE)
latexmk -bibtex -c

clean:
rm -rf `find -type d -name auto`
latexmk -bibtex -C

.PHONY: master clean
.PHONY: release clean

0 comments on commit abcb9ff

Please sign in to comment.