PageRenderTime 1598ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/arm-gp2x-linux-glibc-2.3.6/glibc-2.3.6/manual/Makefile

#
Makefile | 258 lines | 175 code | 42 blank | 41 comment | 3 complexity | eaf0407ca0408c5dfde443d43f55da95 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, BSD-3-Clause, LGPL-2.0
  1. # Copyright (C) 1992-1999,2000,2001,2002,2003,2004
  2. # Free Software Foundation, Inc.
  3. # This file is part of the GNU C Library.
  4. # The GNU C Library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Lesser General Public
  6. # License as published by the Free Software Foundation; either
  7. # version 2.1 of the License, or (at your option) any later version.
  8. # The GNU C Library is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. # Lesser General Public License for more details.
  12. # You should have received a copy of the GNU Lesser General Public
  13. # License along with the GNU C Library; if not, write to the Free
  14. # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. # 02111-1307 USA.
  16. # Makefile for the GNU C Library manual.
  17. subdir := manual
  18. export subdir := $(subdir)
  19. # Allow override
  20. INSTALL_INFO = install-info
  21. .PHONY: all dvi pdf info html
  22. all: dvi
  23. dvi: libc.dvi
  24. pdf: libc.pdf
  25. # Get glibc's configuration info.
  26. ifneq (,$(wildcard ../Makeconfig))
  27. include ../Makeconfig
  28. else
  29. MAKEINFO = makeinfo
  30. TEXI2DVI = texi2dvi
  31. AWK = gawk
  32. endif
  33. TEXI2PDF = texi2dvi --pdf
  34. ifneq ($(strip $(MAKEINFO)),:)
  35. all: info
  36. info: libc.info
  37. endif
  38. # scripts we use
  39. ifndef move-if-change
  40. move-if-change = ./move-if-change
  41. endif
  42. mkinstalldirs = $(..)scripts/mkinstalldirs
  43. chapters = $(addsuffix .texi, \
  44. intro errno memory ctype string charset locale \
  45. message search pattern io stdio llio filesys \
  46. pipe socket terminal syslog math arith time \
  47. resource setjmp signal startup process job nss \
  48. users sysinfo conf crypt debug)
  49. add-chapters = $(wildcard $(foreach d, $(add-ons), ../$d/$d.texi))
  50. appendices = lang.texi header.texi install.texi maint.texi contrib.texi \
  51. freemanuals.texi
  52. -include texis
  53. texis: texis.awk $(chapters) $(add-chapters) $(appendices) lesser.texi fdl.texi
  54. $(AWK) -f $^ > $@.T
  55. mv -f $@.T $@
  56. nonexamples = $(filter-out $(add-chapters) %.c.texi, $(texis))
  57. examples = $(filter-out $(foreach d, $(add-ons), ../$d/%.c.texi), \
  58. $(filter %.c.texi, $(texis)))
  59. # Kludge: implicit rule so Make knows the one command does it all.
  60. chapters.% top-menu.%: libc-texinfo.sh $(texis) Makefile
  61. AWK=$(AWK) $(SHELL) $< '$(chapters)' '$(add-chapters)' '$(appendices)'
  62. libc.dvi libc.pdf libc.info: chapters.texi top-menu.texi dir-add.texi \
  63. libm-err.texi
  64. libc.dvi libc.pdf: texinfo.tex
  65. html: libc/index.html
  66. libc/index.html: chapters.texi top-menu.texi libm-err.texi
  67. $(MAKEINFO) --html libc.texinfo
  68. # Generate the summary from the Texinfo source files for each chapter.
  69. summary.texi: stamp-summary ;
  70. stamp-summary: summary.awk $(filter-out summary.texi, $(texis))
  71. $(AWK) -f $^ | sort -t' ' -df -k 1,1 | tr '\014' '\012' > summary-tmp
  72. $(move-if-change) summary-tmp summary.texi
  73. touch $@
  74. # Generate a file which can be added to the `dir' content to provide direct
  75. # access to the documentation of the function, variables, and other
  76. # definitions.
  77. dir-add.texi: xtract-typefun.awk $(texis)
  78. (echo "@dircategory GNU C library functions and macros"; \
  79. echo "@direntry"; \
  80. $(AWK) -f $^ | sort; \
  81. echo "@end direntry") > $@.new
  82. mv -f $@.new $@
  83. # The table with the math errors is generated.
  84. libm-err.texi: stamp-libm-err
  85. stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
  86. $(dir)/libm-test-ulps))
  87. pwd=`pwd`; \
  88. $(PERL) $< $$pwd/.. > libm-err-tmp
  89. $(move-if-change) libm-err-tmp libm-err.texi
  90. touch $@
  91. # Generate Texinfo files from the C source for the example programs.
  92. %.c.texi: examples/%.c
  93. sed -e 's,[{}],@&,g' \
  94. -e 's,/\*\(@.*\)\*/,\1,g' \
  95. -e 's,/\* *,/* @r{,g' -e 's, *\*/,} */,' \
  96. -e 's/\(@[a-z][a-z]*\)@{\([^}]*\)@}/\1{\2}/g'\
  97. $< | expand > $@.new
  98. mv -f $@.new $@
  99. %.info: %.texinfo
  100. LANGUAGE=C LC_ALL=C $(MAKEINFO) $<
  101. %.dvi: %.texinfo
  102. $(TEXI2DVI) $<
  103. %.pdf: %.texinfo
  104. $(TEXI2PDF) $<
  105. # Distribution.
  106. minimal-dist = summary.awk texis.awk tsort.awk libc-texinfo.sh libc.texinfo \
  107. libm-err.texi stamp-libm-err \
  108. $(filter-out summary.texi, $(nonexamples)) \
  109. $(patsubst %.c.texi,examples/%.c, $(examples))
  110. doc-only-dist = Makefile COPYING.LIB
  111. distribute = $(minimal-dist) $(examples) stdio-fp.c \
  112. libc.info* libc.?? libc.??s texinfo.tex \
  113. xtract-typefun.awk dir-add.texi dir libm-err-tab.pl
  114. export distribute := $(distribute)
  115. tar-it = tar chovf $@ $^
  116. manual.tar: $(doc-only-dist) $(minimal-dist) ; $(tar-it)
  117. mandist.tar: $(doc-only-dist) $(distribute) ; $(tar-it)
  118. edition := $(shell sed -n 's/^@set EDITION \([0-9][0-9.]*\)[^0-9.]*.*$$/\1/p' \
  119. libc.texinfo)
  120. glibc-doc-$(edition).tar: $(doc-only-dist) $(distribute)
  121. @rm -f glibc-doc-$(edition)
  122. ln -s . glibc-doc-$(edition)
  123. tar chovf $@ $(addprefix glibc-doc-$(edition)/,$^)
  124. rm -f glibc-doc-$(edition)
  125. %.Z: %
  126. compress -c $< > $@.new
  127. mv -f $@.new $@
  128. %.gz: %
  129. gzip -9 -c $< > $@.new
  130. mv -f $@.new $@
  131. %.uu: %
  132. uuencode $< < $< > $@.new
  133. mv -f $@.new $@
  134. .PHONY: mostlyclean distclean realclean clean
  135. mostlyclean:
  136. -rm -f libc.dvi libc.pdf libc.tmp libc.info*
  137. -rm -f $(objpfx)stubs $(objpfx)distinfo
  138. -rm -f $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
  139. clean: mostlyclean
  140. distclean: clean
  141. indices = cp fn pg tp vr ky
  142. realclean: distclean
  143. -rm -f texis summary.texi stamp-summary *.c.texi dir-add.texi
  144. -rm -f $(foreach index,$(indices),libc.$(index) libc.$(index)s)
  145. -rm -f libc.log libc.aux libc.toc dir-add.texinfo
  146. -rm -f top-menu.texi chapters.texi
  147. .PHONY: install subdir_install installdirs install-data
  148. install-data subdir_install: install
  149. ifneq ($(strip $(MAKEINFO)),:)
  150. install: $(inst_infodir)/libc.info
  151. @if $(SHELL) -c '$(INSTALL_INFO) --version' >/dev/null 2>&1; then \
  152. test -f $(inst_infodir)/dir || $(INSTALL_DATA) dir $(inst_infodir);\
  153. $(INSTALL_INFO) --info-dir=$(inst_infodir) $(inst_infodir)/libc.info;\
  154. else : ; fi
  155. endif
  156. # Catchall implicit rule for other installation targets from the parent.
  157. install-%: ;
  158. $(inst_infodir)/libc.info: libc.info installdirs
  159. for file in $<*; do \
  160. $(INSTALL_DATA) $$file $(@D)/$$file; \
  161. done
  162. installdirs:
  163. $(mkinstalldirs) $(inst_infodir)
  164. .PHONY: dist
  165. dist: # glibc-doc-$(edition).tar.gz
  166. ifneq (,$(wildcard ../Make-dist))
  167. dist: ../Make-dist
  168. $(MAKE) -f $< $(Make-dist-args)
  169. endif
  170. ifndef ETAGS
  171. ETAGS = etags -T
  172. endif
  173. TAGS: $(minimal-dist)
  174. $(ETAGS) -o $@ $^
  175. # The parent makefile sometimes invokes us with targets `subdir_REAL-TARGET'.
  176. subdir_%: % ;
  177. # For targets we don't define, do nothing.
  178. subdir_%: ;
  179. # These are targets that each glibc subdirectory is expected to understand.
  180. # ../Rules defines them for code subdirectories; for us, they are no-ops.
  181. # None of these should be `subdir_TARGET'; those targets are transformed
  182. # by the implicit rule above into `TARGET' deps.
  183. glibc-targets := lib objects objs others tests xtests lint.out \
  184. echo-headers echo-distinfo
  185. .PHONY: $(glibc-targets)
  186. $(glibc-targets):
  187. # Create stamp files if they don't exist, so the parent makefile's rules for
  188. # updating the library archives are happy with us, and never think we have
  189. # changed the library.
  190. lib: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
  191. ifdef objpfx
  192. .PHONY: stubs
  193. stubs: $(objpfx)stubs
  194. endif
  195. $(objpfx)stubs ../po/manual.pot:
  196. $(make-target-directory)
  197. touch $@
  198. $(objpfx)stamp%:
  199. $(make-target-directory)
  200. touch $@
  201. # Make the target directory if it doesn't exist, using the `mkinstalldirs'
  202. # script that does `mkdir -p' even if `mkdir' doesn't support that flag.
  203. define make-target-directory
  204. $(addprefix $(mkinstalldirs) ,\
  205. $(filter-out $(wildcard $(@D:%/=%)),$(@D:%/=%)))
  206. endef
  207. # The top-level glibc Makefile expects subdir_install to update the stubs file.
  208. subdir_install: stubs
  209. # Get rid of these variables if they came from the parent.
  210. routines =
  211. aux =
  212. sources =
  213. objects =
  214. headers =