| 1 | # $Id: dist.mk,v 1.498 2005/10/09 14:41:57 tom Exp $ | 
|---|
| 2 | # Makefile for creating ncurses distributions. | 
|---|
| 3 | # | 
|---|
| 4 | # This only needs to be used directly as a makefile by developers, but | 
|---|
| 5 | # configure mines the current version number out of here.  To move | 
|---|
| 6 | # to a new version number, just edit this file and run configure. | 
|---|
| 7 | # | 
|---|
| 8 | SHELL = /bin/sh | 
|---|
| 9 |  | 
|---|
| 10 | # These define the major/minor/patch versions of ncurses. | 
|---|
| 11 | NCURSES_MAJOR = 5 | 
|---|
| 12 | NCURSES_MINOR = 5 | 
|---|
| 13 | NCURSES_PATCH = 20051010 | 
|---|
| 14 |  | 
|---|
| 15 | # We don't append the patch to the version, since this only applies to releases | 
|---|
| 16 | VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) | 
|---|
| 17 |  | 
|---|
| 18 | # The most recent html files were generated with lynx 2.8.5, configured with | 
|---|
| 19 | #       --without-manpage-renames | 
|---|
| 20 | # on Debian/testing. | 
|---|
| 21 | DUMP    = lynx -dump | 
|---|
| 22 | DUMP2   = $(DUMP) -nolist | 
|---|
| 23 |  | 
|---|
| 24 | GNATHTML= `type -p gnathtml || type -p gnathtml.pl` | 
|---|
| 25 |  | 
|---|
| 26 | # man2html 3.0.1 is a Perl script which assumes that pages are fixed size. | 
|---|
| 27 | # Not all man programs agree with this assumption; some use half-spacing, which | 
|---|
| 28 | # has the effect of lengthening the text portion of the page -- so man2html | 
|---|
| 29 | # would remove some text.  The man program on Redhat 6.1 appears to work with | 
|---|
| 30 | # man2html if we set the top/bottom margins to 6 (the default is 7).  Newer | 
|---|
| 31 | # versions of 'man' on Linux leave no margin (and make it harder to sync with | 
|---|
| 32 | # pages). | 
|---|
| 33 | MAN2HTML= man2html -botm=0 -topm=0 -cgiurl '$$title.$$section$$subsection.html' | 
|---|
| 34 |  | 
|---|
| 35 | ALL     = ANNOUNCE doc/html/announce.html doc/ncurses-intro.doc doc/hackguide.doc manhtml adahtml | 
|---|
| 36 |  | 
|---|
| 37 | all :   $(ALL) | 
|---|
| 38 |  | 
|---|
| 39 | dist:   $(ALL) | 
|---|
| 40 | (cd ..;  tar cvf ncurses-$(VERSION).tar `sed <ncurses-$(VERSION)/MANIFEST 's/^./ncurses-$(VERSION)/'`;  gzip ncurses-$(VERSION).tar) | 
|---|
| 41 |  | 
|---|
| 42 | distclean: | 
|---|
| 43 | rm -f $(ALL) subst.tmp subst.sed | 
|---|
| 44 |  | 
|---|
| 45 | # Don't mess with announce.html.in unless you have lynx available! | 
|---|
| 46 | doc/html/announce.html: announce.html.in | 
|---|
| 47 | sed 's,@VERSION@,$(VERSION),' <announce.html.in > $@ | 
|---|
| 48 |  | 
|---|
| 49 | ANNOUNCE : doc/html/announce.html | 
|---|
| 50 | $(DUMP) doc/html/announce.html > $@ | 
|---|
| 51 |  | 
|---|
| 52 | doc/ncurses-intro.doc: doc/html/ncurses-intro.html | 
|---|
| 53 | $(DUMP2) doc/html/ncurses-intro.html > $@ | 
|---|
| 54 | doc/hackguide.doc: doc/html/hackguide.html | 
|---|
| 55 | $(DUMP2) doc/html/hackguide.html > $@ | 
|---|
| 56 |  | 
|---|
| 57 | # This is the original command: | 
|---|
| 58 | #       MANPROG = tbl | nroff -man | 
|---|
| 59 | # | 
|---|
| 60 | # This happens to work for groff 1.18.1 on Debian.  At some point groff's | 
|---|
| 61 | # maintainer changed the line-length (we do not want/need that here). | 
|---|
| 62 | # | 
|---|
| 63 | # The distributed html files are formatted using | 
|---|
| 64 | #       configure --without-manpage-renames | 
|---|
| 65 | MANPROG = tbl | nroff -mandoc -rLL=65n -rLT=71n -Tascii | 
|---|
| 66 |  | 
|---|
| 67 | manhtml: | 
|---|
| 68 | @rm -f doc/html/man/*.html | 
|---|
| 69 | @mkdir -p doc/html/man | 
|---|
| 70 | @rm -f subst.tmp ; | 
|---|
| 71 | @for f in man/*.[0-9]*; do \ | 
|---|
| 72 | m=`basename $$f` ;\ | 
|---|
| 73 | x=`echo $$m | awk -F. '{print $$2;}'` ;\ | 
|---|
| 74 | xu=`echo $$x | dd conv=ucase 2>/dev/null` ;\ | 
|---|
| 75 | if [ "$${x}" != "$${xu}" ]; then \ | 
|---|
| 76 | echo "s/$${xu}/$${x}/g" >> subst.tmp ;\ | 
|---|
| 77 | fi ;\ | 
|---|
| 78 | done | 
|---|
| 79 | # change some things to make weblint happy: | 
|---|
| 80 | @echo 's/<B>/<STRONG>/g'     >> subst.tmp | 
|---|
| 81 | @echo 's/<\/B>/<\/STRONG>/g' >> subst.tmp | 
|---|
| 82 | @echo 's/<I>/<EM>/g'         >> subst.tmp | 
|---|
| 83 | @echo 's/<\/I>/<\/EM>/g'     >> subst.tmp | 
|---|
| 84 | @misc/csort < subst.tmp | uniq > subst.sed | 
|---|
| 85 | @echo '/<\/TITLE>/a\' >> subst.sed | 
|---|
| 86 | @echo '<link rev=made href="mailto:bug-ncurses@gnu.org">\' >> subst.sed | 
|---|
| 87 | @echo '<meta http-equiv="Content-Type" content="text\/html; charset=iso-8859-1">' >> subst.sed | 
|---|
| 88 | @rm -f subst.tmp | 
|---|
| 89 | @for f in man/*.[0-9]* ; do \ | 
|---|
| 90 | m=`basename $$f` ;\ | 
|---|
| 91 | T=`egrep '^.TH' $$f|sed -e 's/^.TH //' -e s'/"//g' -e 's/[   ]\+$$//'` ; \ | 
|---|
| 92 | g=$${m}.html ;\ | 
|---|
| 93 | if [ -f doc/html/$$g ]; then chmod +w doc/html/$$g; fi;\ | 
|---|
| 94 | echo "Converting $$m to HTML" ;\ | 
|---|
| 95 | echo '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">' > doc/html/man/$$g ;\ | 
|---|
| 96 | echo '<!-- ' >> doc/html/man/$$g ;\ | 
|---|
| 97 | egrep '^.\\"[^#]' $$f | \ | 
|---|
| 98 | sed     -e 's/\$$/@/g' \ | 
|---|
| 99 | -e 's/^.../  */' \ | 
|---|
| 100 | -e 's/</\</g' \ | 
|---|
| 101 | -e 's/>/\>/g' \ | 
|---|
| 102 | >> doc/html/man/$$g ;\ | 
|---|
| 103 | echo '-->' >> doc/html/man/$$g ;\ | 
|---|
| 104 | ./edit_man.sh normal editing /usr/man man $$f | $(MANPROG) | tr '\255' '-' | $(MAN2HTML) -title "$$T" | \ | 
|---|
| 105 | sed -f subst.sed |\ | 
|---|
| 106 | sed -e 's/"curses.3x.html"/"ncurses.3x.html"/g' \ | 
|---|
| 107 | >> doc/html/man/$$g ;\ | 
|---|
| 108 | done | 
|---|
| 109 | @rm -f subst.sed | 
|---|
| 110 |  | 
|---|
| 111 | # | 
|---|
| 112 | # Please note that this target can only be properly built if the build of the | 
|---|
| 113 | # Ada95 subdir has been done.  The reason is, that the gnathtml tool uses the | 
|---|
| 114 | # .ali files generated by the Ada95 compiler during the build process.  These | 
|---|
| 115 | # .ali files contain cross referencing information required by gnathtml. | 
|---|
| 116 | adahtml: | 
|---|
| 117 | if [ ! -z "$(GNATHTML)" ]; then \ | 
|---|
| 118 | (cd ./Ada95/gen ; make html) ;\ | 
|---|
| 119 | fi | 
|---|
| 120 |  | 
|---|
| 121 | # This only works on a clean source tree, of course. | 
|---|
| 122 | MANIFEST: | 
|---|
| 123 | -rm -f $@ | 
|---|
| 124 | touch $@ | 
|---|
| 125 | find . -type f -print |misc/csort | fgrep -v .lsm |fgrep -v .spec >$@ | 
|---|
| 126 |  | 
|---|
| 127 | TAGS: | 
|---|
| 128 | etags */*.[ch] | 
|---|
| 129 |  | 
|---|
| 130 | # Makefile ends here | 
|---|