-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (32 loc) · 816 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
36
37
38
39
40
41
42
43
LATEX = latex -file-line-error -halt-on-error
DVIPS = dvips
PSPDF = ps2pdf
RM = rm -f
VPATH = regex_examples
TARGET = regex
SRC_EXAMPLES = $(wildcard src_examples/*)
REGEX_EXAMPLES = $(notdir $(wildcard regex_examples/*.regex))
REGEX_SRC = $(patsubst %.regex,%.tex,$(REGEX_EXAMPLES))
SRC = $(TARGET).tex \
cheatsheet.sty \
escape_regex.sed \
$(SRC_EXAMPLES) \
$(REGEX_SRC)
.PHONY: open zip gzip clean
.INTERMEDIATE: $(REGEX_SRC)
$(TARGET).pdf: $(TARGET).ps
$(PSPDF) $<
$(TARGET).ps: $(TARGET).dvi
$(DVIPS) $<
$(TARGET).dvi: $(SRC)
$(LATEX) $<
$(REGEX_SRC): %.tex: %.regex
sed -f escape_regex.sed $< > $@
open: $(TARGET).pdf
open $<
zip: $(TARGET).pdf
zip $(TARGET).pdf.zip $<
gzip: $(TARGET).pdf
gzip -c $< > $(TARGET).pdf.gz
clean:
$(RM) *.log *.out *.aux *.dvi *.ps *.pdf *.zip *.gz