-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmirdoc_noprog.mak
89 lines (75 loc) · 2.29 KB
/
mirdoc_noprog.mak
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
## -*- makefile-automake -*-
##
## Include mirdoc.mak unless you're in src/tools/.
##
## Define a variable DOCINPUTS before including this Makefile
## fragment. It should list all of the files that are to be
## processed by the doc program.
##
## You can also define DOCFLAGS to give extra flags to pass to
## the doc program. This will almost never be necessary.
DOCSTAMPS = $(DOCINPUTS:=_ds)
%.for_ds: %.for $(doc_prog)
$(AM_V_GEN)cat=`pwd`/$(doc_catsrc) ; \
doc=`pwd`/$(doc_prog) ; \
input=`pwd`/$< ; \
$(mkdir_p) docwork ; \
(cd docwork && MIRCAT=$$cat $$doc -p $(DOCFLAGS) $$input) && \
touch $@
%.f2c_ds: %.f2c $(doc_prog)
$(AM_V_GEN)cat=`pwd`/$(doc_catsrc) ; \
doc=`pwd`/$(doc_prog) ; \
input=`pwd`/$< ; \
$(mkdir_p) docwork ; \
(cd docwork && MIRCAT=$$cat $$doc -p $(DOCFLAGS) $$input) && \
touch $@
%.c_ds: %.c $(doc_prog)
$(AM_V_GEN)cat=`pwd`/$(doc_catsrc) ; \
doc=`pwd`/$(doc_prog) ; \
input=`pwd`/$< ; \
$(mkdir_p) docwork ; \
(cd docwork && MIRCAT=$$cat $$doc -p $(DOCFLAGS) $$input) && \
touch $@
%.f_ds: %.f $(doc_prog)
$(AM_V_GEN)cat=`pwd`/$(doc_catsrc) ; \
doc=`pwd`/$(doc_prog) ; \
input=`pwd`/$< ; \
$(mkdir_p) docwork ; \
(cd docwork && MIRCAT=$$cat $$doc -p $(DOCFLAGS) $$input) && \
touch $@
# This is needed for scripts. Sigh.
%.clone_ds: %.clone $(doc_prog)
$(AM_V_GEN)cat=`pwd`/$(doc_catsrc) ; \
doc=`pwd`/$(doc_prog) ; \
input=`pwd`/$< ; \
$(mkdir_p) docwork ; \
(cd docwork && MIRCAT=$$cat $$doc -p $(DOCFLAGS) $$input) && \
touch $@
# Silently do nothing for these. Lets us be a bit more liberal in what
# we say DOCINPUTS is in our Makefile.am's.
.h.h_ds:
@touch $@
.inc.inc_ds:
@touch $@
# Hooking up all the rules ...
all-local: $(DOCSTAMPS)
install-data-local:
$(mkdir_p) "$(DESTDIR)$(sdocdir)"
$(mkdir_p) "$(DESTDIR)$(pdocdir)"
if test "`echo docwork/*.sdoc`" = 'docwork/*.sdoc'; then \
: ; \
else \
echo $(INSTALL_DATA) docwork/*.sdoc "$(DESTDIR)$(sdocdir)" ; \
$(INSTALL_DATA) docwork/*.sdoc "$(DESTDIR)$(sdocdir)" ; \
fi
for ext in doc cdoc tdoc kdoc ; do \
if test "`echo docwork/*.$$ext`" = 'docwork/*.'$$ext ; then \
: ; \
else \
echo $(INSTALL_DATA) docwork/*.$$ext "$(DESTDIR)$(pdocdir)" ; \
$(INSTALL_DATA) docwork/*.$$ext "$(DESTDIR)$(pdocdir)" ; \
fi ; \
done
clean-local:
rm -rf docwork
rm -f $(DOCSTAMPS)