| •1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
subdir := manual |
| 22 |
|
| 23 |
|
| 24 |
INSTALL_INFO = install-info |
| 25 |
|
| 26 |
.PHONY: dvi pdf info html |
| 27 |
|
| 28 |
|
| 29 |
include ../Makeconfig |
| 30 |
|
| 31 |
dvi: $(objpfx)libc.dvi |
| 32 |
pdf: $(objpfx)libc.pdf |
| 33 |
|
| 34 |
TEXI2DVI = texi2dvi |
| 35 |
TEXI2PDF = texi2dvi --pdf |
| 36 |
|
| 37 |
ifneq ($(strip $(MAKEINFO)),:) |
| 38 |
info: $(objpfx)libc.info |
| 39 |
endif |
| 40 |
|
| 41 |
chapters = $(addsuffix .texi, \ |
| 42 |
intro errno memory ctype string charset locale \ |
| 43 |
message search pattern io stdio llio filesys \ |
| 44 |
pipe socket terminal syslog math arith time \ |
| 45 |
resource setjmp signal startup process job nss \ |
| 46 |
users sysinfo conf crypt debug) |
| 47 |
add-chapters = $(wildcard $(foreach d, $(add-ons), ../$d/$d.texi)) |
| 48 |
appendices = lang.texi header.texi install.texi maint.texi platform.texi \ |
| 49 |
contrib.texi |
| 50 |
licenses = freemanuals.texi lgpl-2.1.texi fdl-1.3.texi |
| 51 |
|
| 52 |
-include $(objpfx)texis |
| 53 |
$(objpfx)texis: texis.awk $(chapters) $(add-chapters) $(appendices) $(licenses) |
| 54 |
$(make-target-directory) |
| 55 |
$(AWK) -f $^ > [email protected] |
| 56 |
mv -f [email protected] $@ |
| 57 |
|
| 58 |
nonexamples = $(filter-out $(add-chapters) %.c.texi, $(texis)) |
| 59 |
examples = $(filter-out $(foreach d, $(add-ons), ../$d/%.c.texi), \ |
| 60 |
$(filter %.c.texi, $(texis))) |
| 61 |
|
| 62 |
|
| 63 |
libc-texi-generated = chapters.texi top-menu.texi dir-add.texi \ |
| 64 |
libm-err.texi version.texi |
| 65 |
|
| 66 |
|
| 67 |
texis-path := $(filter-out $(libc-texi-generated) summary.texi $(examples), \ |
| 68 |
$(texis)) \ |
| 69 |
$(addprefix $(objpfx),$(filter $(libc-texi-generated) summary.texi \ |
| 70 |
$(examples), $(texis))) |
| 71 |
|
| 72 |
|
| 73 |
chapters.% top-menu.%: libc-texinfo.sh $(texis-path) Makefile |
| 74 |
AWK=$(AWK) $(SHELL) $< $(objpfx) \ |
| 75 |
'$(chapters)' \ |
| 76 |
'$(add-chapters)' \ |
| 77 |
'$(appendices) $(licenses)' |
| 78 |
|
| 79 |
|
| 80 |
$(objpfx)libc.dvi $(objpfx)libc.pdf $(objpfx)libc.info: \ |
| 81 |
$(addprefix $(objpfx),$(libc-texi-generated)) |
| 82 |
$(objpfx)libc.dvi $(objpfx)libc.pdf: texinfo.tex |
| 83 |
|
| 84 |
html: $(objpfx)libc/index.html |
| 85 |
$(objpfx)libc/index.html: $(addprefix $(objpfx),$(libc-texi-generated)) |
| 86 |
$(MAKEINFO) -P $(objpfx) -o $(objpfx)libc --html libc.texinfo |
| 87 |
|
| 88 |
|
| 89 |
$(objpfx)summary.texi: $(objpfx)stamp-summary ; |
| 90 |
$(objpfx)stamp-summary: summary.awk $(filter-out $(objpfx)summary.texi, \ |
| 91 |
$(texis-path)) |
| 92 |
$(AWK) -f $^ | sort -t'' -df -k 1,1 | tr '\014' '\012' \ |
| 93 |
> $(objpfx)summary-tmp |
| 94 |
$(move-if-change) $(objpfx)summary-tmp $(objpfx)summary.texi |
| 95 |
touch $@ |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
$(objpfx)dir-add.texi: xtract-typefun.awk $(texis-path) |
| 101 |
(echo "@dircategory GNU C library functions and macros"; \ |
| 102 |
echo "@direntry"; \ |
| 103 |
$(AWK) -f $^ | sort; \ |
| 104 |
echo "@end direntry") > [email protected] |
| 105 |
mv -f [email protected] $@ |
| 106 |
|
| 107 |
|
| 108 |
$(objpfx)libm-err.texi: $(objpfx)stamp-libm-err |
| 109 |
$(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\ |
| 110 |
$(dir)/libm-test-ulps)) |
| 111 |
pwd=`pwd`; \ |
| 112 |
$(PERL) $< $$pwd/.. > $(objpfx)libm-err-tmp |
| 113 |
$(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi |
| 114 |
touch $@ |
| 115 |
|
| 116 |
|
| 117 |
$(objpfx)version.texi: $(objpfx)stamp-version ; |
| 118 |
$(objpfx)stamp-version: $(common-objpfx)config.make |
| 119 |
echo "@set VERSION $(version)" > $(objpfx)version-tmp |
| 120 |
$(move-if-change) $(objpfx)version-tmp $(objpfx)version.texi |
| 121 |
touch $@ |
| 122 |
|
| 123 |
|
| 124 |
$(objpfx)%.c.texi: examples/%.c |
| 125 |
sed -e '1,/^\*\/$$/d' \ |
| 126 |
-e 's,[{}],@&,g' \ |
| 127 |
-e 's,/\*\(@.*\)\*/,\1,g' \ |
| 128 |
-e 's,/\* *,/* @r{,g' -e 's, *\*/,} */,' \ |
| 129 |
-e 's/\(@[a-z][a-z]*\)@{\([^}]*\)@}/\1{\2}/g'\ |
| 130 |
$< | expand > [email protected] |
| 131 |
mv -f [email protected] $@ |
| 132 |
|
| 133 |
$(objpfx)%.info: %.texinfo |
| 134 |
LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=$@ $< |
| 135 |
|
| 136 |
$(objpfx)%.dvi: %.texinfo |
| 137 |
cd $(objpfx);$(TEXI2DVI) -I $(shell cd $(<D) && pwd) --output=$@ \ |
| 138 |
$(shell cd $(<D) && pwd)/$< |
| 139 |
|
| 140 |
$(objpfx)%.pdf: %.texinfo |
| 141 |
cd $(objpfx);$(TEXI2PDF) -I $(shell cd $(<D) && pwd) --output=$@ \ |
| 142 |
$(shell cd $(<D) && pwd)/$< |
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
minimal-dist = summary.awk texis.awk tsort.awk libc-texinfo.sh libc.texinfo \ |
| 147 |
libm-err.texi stamp-libm-err \ |
| 148 |
$(filter-out summary.texi, $(nonexamples)) \ |
| 149 |
$(patsubst %.c.texi,examples/%.c, $(examples)) |
| 150 |
|
| 151 |
indices = cp fn pg tp vr ky |
| 152 |
generated-dirs := libc |
| 153 |
generated = libc.dvi libc.pdf libc.tmp libc.info* \ |
| 154 |
stubs \ |
| 155 |
texis summary.texi stamp-summary *.c.texi \ |
| 156 |
$(foreach index,$(indices),libc.$(index) libc.$(index)s) \ |
| 157 |
libc.log libc.aux libc.toc \ |
| 158 |
$(libc-texi-generated) \ |
| 159 |
stamp-libm-err stamp-version |
| 160 |
|
| 161 |
include ../Rules |
| 162 |
|
| 163 |
.PHONY: install subdir_install install-data |
| 164 |
install-data subdir_install: install |
| 165 |
ifneq ($(strip $(MAKEINFO)),:) |
| 166 |
install: $(inst_infodir)/libc.info |
| 167 |
@if $(SHELL) -c '$(INSTALL_INFO) --version' >/dev/null 2>&1; then \ |
| 168 |
test -f $(inst_infodir)/dir || $(INSTALL_DATA) dir $(inst_infodir);\ |
| 169 |
$(INSTALL_INFO) --info-dir=$(inst_infodir) $(inst_infodir)/libc.info;\ |
| 170 |
else : ; fi |
| 171 |
endif |
| 172 |
|
| 173 |
install-%: ; |
| 174 |
|
| 175 |
$(inst_infodir)/libc.info: $(objpfx)libc.info |
| 176 |
$(make-target-directory) |
| 177 |
for file in $<*; do \ |
| 178 |
$(INSTALL_DATA) $$file $(@D)/; \ |
| 179 |
done |
| 180 |
|
| 181 |
TAGS: $(minimal-dist) |
| 182 |
$(ETAGS) -o $@ $^ |