/
Makefile
37 lines (27 loc) · 845 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
BOOK_NAME=fontbook
FTP_TOPDIR=fonts
FTP_PDFDIR=$(FTP_TOPDIR)
TARGETS=$(BOOK_NAME) $(BOOK_NAME)-freefonts
TEXINPUTS=
# Include crocodoc conf
include ~/.crocodoc.conf
all: pdf
pdf: $(addsuffix .pdf,$(TARGETS))
%.pdf: %.tex
TEXINPUTS=$(TEXINPUTS) xelatex -shell-escape -interaction=batchmode $*
TEXINPUTS=$(TEXINPUTS) xelatex -shell-escape -interaction=batchmode $*
upload:
-ncftpput -f ~/.ncftp/cc.cfg $(FTP_PDFDIR)/ *.pdf
%.json: %.pdf
ifeq ($(strip $(TOKEN)),)
$(error No crocodoc token found in ~/.crocodoc.conf)
endif
curl -F "file=@$<" -F "token=$(TOKEN)" -F "title=$* $(TODAY)" \
https://crocodoc.com/api/v1/document/upload > $@
crocupload: $(BOOK_NAME).json
clean:
rm -f *.ps *.aux *.log *.out *.lol
rm -f *.idx *.ind *.ilg *.toc *.dvi *.glo
rm -f *.json
# Remove only target pdf
rm -f $(addsuffix *.pdf,$(TARGETS))