File: Makefile

package info (click to toggle)
wmaker-usersguide 0.20.2-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 568 kB
  • ctags: 15
  • sloc: makefile: 73; sh: 29
file content (43 lines) | stat: -rw-r--r-- 831 bytes parent folder | download | duplicates (4)
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
# this is what 'latex' prints when a new latex run is needed
MAGIC_REF  := 'There were undefined references'

# this is what 'latex' prints when a bibtex run is needed
MAGIC_BIB  := 'Citation.*undefined'

LATEX=$(run-latex)
DVIPS=dvips
RM=/bin/rm

all: guide.dvi guide.ps

guide.dvi: guide.tex
	$(LATEX)

guide.ps: guide.dvi
	$(DVIPS) guide.dvi -o guide.ps

clean:
	-$(RM) *~ *.log *.aux 

distclean: clean
	-$(RM) guide.dvi guide.ps

dist: distclean
	rm -fr UserGuide
	mkdir UserGuide
	cp guide.tex UserGuide
	cp *.ps UserGuide
	cp *.gif UserGuide
	cp logo.eps UserGuide
	cp Makefile UserGuide
	tar czf UserGuide.tar.gz UserGuide

define run-latex
latex $<
if grep -q $(MAGIC_REF) $(patsubst %.tex, %.log, $<) ; then \
  latex $< ;\
  if grep -q $(MAGIC_REF) $(patsubst %.tex, %.log, $<) ; then \
    latex $< ;\
  fi ;\
fi
endef