dist.mk 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. ##############################################################################
  2. # Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. #
  3. # #
  4. # Permission is hereby granted, free of charge, to any person obtaining a #
  5. # copy of this software and associated documentation files (the "Software"), #
  6. # to deal in the Software without restriction, including without limitation #
  7. # the rights to use, copy, modify, merge, publish, distribute, distribute #
  8. # with modifications, sublicense, and/or sell copies of the Software, and to #
  9. # permit persons to whom the Software is furnished to do so, subject to the #
  10. # following conditions: #
  11. # #
  12. # The above copyright notice and this permission notice shall be included in #
  13. # all copies or substantial portions of the Software. #
  14. # #
  15. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
  16. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
  17. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
  18. # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
  19. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
  20. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
  21. # DEALINGS IN THE SOFTWARE. #
  22. # #
  23. # Except as contained in this notice, the name(s) of the above copyright #
  24. # holders shall not be used in advertising or otherwise to promote the sale, #
  25. # use or other dealings in this Software without prior written #
  26. # authorization. #
  27. ##############################################################################
  28. # $Id: dist.mk,v 1.676 2008/12/13 18:14:24 tom Exp $
  29. # Makefile for creating ncurses distributions.
  30. #
  31. # This only needs to be used directly as a makefile by developers, but
  32. # configure mines the current version number out of here. To move
  33. # to a new version number, just edit this file and run configure.
  34. #
  35. SHELL = /bin/sh
  36. # These define the major/minor/patch versions of ncurses.
  37. NCURSES_MAJOR = 5
  38. NCURSES_MINOR = 7
  39. NCURSES_PATCH = 20081213
  40. # We don't append the patch to the version, since this only applies to releases
  41. VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
  42. # The most recent html files were generated with lynx 2.8.6, using ncurses
  43. # configured with
  44. # --without-manpage-renames
  45. # on Debian/testing. The -scrollbar and -width options are used to make lynx
  46. # use 79 columns as it did in 2.8.5 and before.
  47. DUMP = lynx -dump -scrollbar=0 -width=79
  48. DUMP2 = $(DUMP) -nolist
  49. GNATHTML= `type -p gnathtml || type -p gnathtml.pl`
  50. # man2html 3.0.1 is a Perl script which assumes that pages are fixed size.
  51. # Not all man programs agree with this assumption; some use half-spacing, which
  52. # has the effect of lengthening the text portion of the page -- so man2html
  53. # would remove some text. The man program on Redhat 6.1 appears to work with
  54. # man2html if we set the top/bottom margins to 6 (the default is 7). Newer
  55. # versions of 'man' on Linux leave no margin (and make it harder to sync with
  56. # pages).
  57. MAN2HTML= man2html -botm=0 -topm=0 -cgiurl '$$title.$$section$$subsection.html'
  58. ALL = ANNOUNCE doc/html/announce.html doc/ncurses-intro.doc doc/hackguide.doc manhtml adahtml
  59. all : $(ALL)
  60. dist: $(ALL)
  61. (cd ..; tar cvf ncurses-$(VERSION).tar `sed <ncurses-$(VERSION)/MANIFEST 's/^./ncurses-$(VERSION)/'`; gzip ncurses-$(VERSION).tar)
  62. distclean:
  63. rm -f $(ALL) subst.tmp subst.sed
  64. # Don't mess with announce.html.in unless you have lynx available!
  65. doc/html/announce.html: announce.html.in
  66. sed 's,@VERSION@,$(VERSION),' <announce.html.in > $@
  67. ANNOUNCE : doc/html/announce.html
  68. $(DUMP) doc/html/announce.html > $@
  69. doc/ncurses-intro.doc: doc/html/ncurses-intro.html
  70. $(DUMP2) doc/html/ncurses-intro.html > $@
  71. doc/hackguide.doc: doc/html/hackguide.html
  72. $(DUMP2) doc/html/hackguide.html > $@
  73. # This is the original command:
  74. # MANPROG = tbl | nroff -man
  75. #
  76. # This happens to work for groff 1.18.1 on Debian. At some point groff's
  77. # maintainer changed the line-length (we do not want/need that here).
  78. #
  79. # The distributed html files are formatted using
  80. # configure --without-manpage-renames
  81. #
  82. # The edit_man.sed script is built as a side-effect of installing the manpages.
  83. # If that conflicts with the --without-manpage-renames, you can install those
  84. # in a different location using the --with-install-prefix option of the
  85. # configure script.
  86. MANPROG = tbl | nroff -mandoc -rLL=65n -rLT=71n -Tascii
  87. manhtml:
  88. @rm -f doc/html/man/*.html
  89. @mkdir -p doc/html/man
  90. @rm -f subst.tmp ;
  91. @for f in man/*.[0-9]*; do \
  92. m=`basename $$f` ;\
  93. x=`echo $$m | awk -F. '{print $$2;}'` ;\
  94. xu=`echo $$x | dd conv=ucase 2>/dev/null` ;\
  95. if [ "$${x}" != "$${xu}" ]; then \
  96. echo "s/$${xu}/$${x}/g" >> subst.tmp ;\
  97. fi ;\
  98. done
  99. # change some things to make weblint happy:
  100. @cat man_alias.sed >> subst.tmp
  101. @echo 's/<B>/<STRONG>/g' >> subst.tmp
  102. @echo 's/<\/B>/<\/STRONG>/g' >> subst.tmp
  103. @echo 's/<I>/<EM>/g' >> subst.tmp
  104. @echo 's/<\/I>/<\/EM>/g' >> subst.tmp
  105. @misc/csort < subst.tmp | uniq > subst.sed
  106. @echo '/<\/TITLE>/a\' >> subst.sed
  107. @echo '<link rev=made href="mailto:bug-ncurses@gnu.org">\' >> subst.sed
  108. @echo '<meta http-equiv="Content-Type" content="text\/html; charset=iso-8859-1">' >> subst.sed
  109. @rm -f subst.tmp
  110. @for f in man/*.[0-9]* ; do \
  111. m=`basename $$f` ;\
  112. T=`egrep '^.TH' $$f|sed -e 's/^.TH //' -e s'/"//g' -e 's/[ ]\+$$//'` ; \
  113. g=$${m}.html ;\
  114. if [ -f doc/html/$$g ]; then chmod +w doc/html/$$g; fi;\
  115. echo "Converting $$m to HTML" ;\
  116. echo '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">' > doc/html/man/$$g ;\
  117. echo '<!-- ' >> doc/html/man/$$g ;\
  118. egrep '^.\\"[^#]' $$f | \
  119. sed -e 's/\$$/@/g' \
  120. -e 's/^.../ */' \
  121. -e 's/</\&lt;/g' \
  122. -e 's/>/\&gt;/g' \
  123. >> doc/html/man/$$g ;\
  124. echo '-->' >> doc/html/man/$$g ;\
  125. ./edit_man.sh normal editing /usr/man man $$f | $(MANPROG) | tr '\255' '-' | $(MAN2HTML) -title "$$T" | \
  126. sed -f subst.sed |\
  127. sed -e 's/"curses.3x.html"/"ncurses.3x.html"/g' \
  128. >> doc/html/man/$$g ;\
  129. done
  130. @rm -f subst.sed
  131. #
  132. # Please note that this target can only be properly built if the build of the
  133. # Ada95 subdir has been done. The reason is, that the gnathtml tool uses the
  134. # .ali files generated by the Ada95 compiler during the build process. These
  135. # .ali files contain cross referencing information required by gnathtml.
  136. adahtml:
  137. if [ ! -z "$(GNATHTML)" ]; then \
  138. (cd ./Ada95/gen ; make html) ;\
  139. fi
  140. # This only works on a clean source tree, of course.
  141. MANIFEST:
  142. -rm -f $@
  143. touch $@
  144. find . -type f -print |misc/csort | fgrep -v .lsm |fgrep -v .spec >$@
  145. TAGS:
  146. etags */*.[ch]
  147. # Makefile ends here