-
Notifications
You must be signed in to change notification settings - Fork 427
/
Copy pathMakefile
50 lines (34 loc) · 975 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
44
45
46
47
48
49
50
ifndef CHPL_MAKE_HOME
export CHPL_MAKE_HOME=$(shell pwd)/..
endif
ifndef CHPL_MAKE_PYTHON
export CHPL_MAKE_PYTHON := $(shell $(CHPL_MAKE_HOME)/util/config/find-python.sh)
endif
PROGRAM = chpl
CHPLDOC = chpldoc
MANPAGE = man1/$(PROGRAM).1
CHPLDOC_MANPAGE = man1/$(CHPLDOC).1
TARGETS = $(MANPAGE) $(PROGRAM).pdf $(CHPLDOC).pdf
CHPLDEPS = $(shell $(CHPL_MAKE_PYTHON) $(CHPL_MAKE_HOME)/util/chplenv/chpl_home_utils.py --chpldeps)
RST2MAN = $(shell which rst2man.py || echo $(CHPL_MAKE_PYTHON) $(CHPLDEPS) rst2man.py)
STARS = \*\*\*\*\*
default: echoman $(MANPAGE)
echoman: FORCE
@echo $(STARS) ./ $(STARS)
all: $(TARGETS)
chpldoc: $(CHPLDOC_MANPAGE)
clean:
rm -f $(TARGETS) $(CHPLDOC_MANPAGE)
man1/%.1: %.rst Makefile
mkdir -p $(shell dirname $@)
sed "/conf$</r conf$<" $< > $<.tmp
$(RST2MAN) $<.tmp > $<.tmp.out
mv $<.tmp.out $@
rm -f $<.tmp
%.ps: man1/%.1
groff -man $< > $@
%.html: man1/%.1
groff -T html -man $< > $@
%.pdf: %.ps
ps2pdf $< $@
FORCE: