blob: 3c61e0afff598abda2437288d24e49b865dc06df [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301##############################################################################
Steve Kondikae271bc2015-11-15 02:50:53 +01002# Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. #
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303# #
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##############################################################################
Steve Kondikae271bc2015-11-15 02:50:53 +010028# $Id: dist.mk,v 1.1064 2015/08/06 23:13:39 tom Exp $
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053029# 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#
35SHELL = /bin/sh
36
37# These define the major/minor/patch versions of ncurses.
Steve Kondikae271bc2015-11-15 02:50:53 +010038NCURSES_MAJOR = 6
39NCURSES_MINOR = 0
40NCURSES_PATCH = 20150808
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053041
42# We don't append the patch to the version, since this only applies to releases
43VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
44
Steve Kondikae271bc2015-11-15 02:50:53 +010045# The most recent html files were generated with lynx 2.8.6 (or later), using
46# ncurses configured with
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053047# --without-manpage-renames
48# on Debian/testing. The -scrollbar and -width options are used to make lynx
49# use 79 columns as it did in 2.8.5 and before.
50DUMP = lynx -dump -scrollbar=0 -width=79
51DUMP2 = $(DUMP) -nolist
52
Steve Kondikae271bc2015-11-15 02:50:53 +010053# gcc's file is "gnathtml.pl"
54GNATHTML= gnathtml
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053055
Steve Kondikae271bc2015-11-15 02:50:53 +010056# man2html is a Perl script which assumes that pages are fixed size.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053057# Not all man programs agree with this assumption; some use half-spacing, which
58# has the effect of lengthening the text portion of the page -- so man2html
59# would remove some text. The man program on Redhat 6.1 appears to work with
60# man2html if we set the top/bottom margins to 6 (the default is 7). Newer
Steve Kondikae271bc2015-11-15 02:50:53 +010061# versions of 'man' leave no margin (and make it harder to sync with pages).
62MAN2HTML= man2html -botm=0 -topm=0 -cgiurl '$$title.$$section$$subsection.html' -index
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053063
64ALL = ANNOUNCE doc/html/announce.html doc/ncurses-intro.doc doc/hackguide.doc manhtml adahtml
65
66all : $(ALL)
67
68dist: $(ALL)
69 (cd ..; tar cvf ncurses-$(VERSION).tar `sed <ncurses-$(VERSION)/MANIFEST 's/^./ncurses-$(VERSION)/'`; gzip ncurses-$(VERSION).tar)
70
71distclean:
72 rm -f $(ALL) subst.tmp subst.sed
73
74# Don't mess with announce.html.in unless you have lynx available!
75doc/html/announce.html: announce.html.in
76 sed 's,@VERSION@,$(VERSION),' <announce.html.in > $@
77
78ANNOUNCE : doc/html/announce.html
79 $(DUMP) doc/html/announce.html > $@
80
81doc/ncurses-intro.doc: doc/html/ncurses-intro.html
82 $(DUMP2) doc/html/ncurses-intro.html > $@
83doc/hackguide.doc: doc/html/hackguide.html
84 $(DUMP2) doc/html/hackguide.html > $@
85
86# This is the original command:
87# MANPROG = tbl | nroff -man
88#
89# This happens to work for groff 1.18.1 on Debian. At some point groff's
90# maintainer changed the line-length (we do not want/need that here).
91#
92# The distributed html files are formatted using
93# configure --without-manpage-renames
94#
95# The edit_man.sed script is built as a side-effect of installing the manpages.
96# If that conflicts with the --without-manpage-renames, you can install those
97# in a different location using the --with-install-prefix option of the
98# configure script.
99MANPROG = tbl | nroff -mandoc -rLL=65n -rLT=71n -Tascii
100
101manhtml:
Steve Kondikae271bc2015-11-15 02:50:53 +0100102 @for f in doc/html/man/*.html; do \
103 test -f $$f || continue; \
104 case $$f in \
105 */index.html) ;; \
106 *) rm -f $$f ;; \
107 esac; \
108 done
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530109 @mkdir -p doc/html/man
110 @rm -f subst.tmp ;
111 @for f in man/*.[0-9]*; do \
112 m=`basename $$f` ;\
113 x=`echo $$m | awk -F. '{print $$2;}'` ;\
114 xu=`echo $$x | dd conv=ucase 2>/dev/null` ;\
115 if [ "$${x}" != "$${xu}" ]; then \
116 echo "s/$${xu}/$${x}/g" >> subst.tmp ;\
117 fi ;\
118 done
119 # change some things to make weblint happy:
120 @cat man_alias.sed >> subst.tmp
121 @echo 's/<B>/<STRONG>/g' >> subst.tmp
122 @echo 's/<\/B>/<\/STRONG>/g' >> subst.tmp
123 @echo 's/<I>/<EM>/g' >> subst.tmp
124 @echo 's/<\/I>/<\/EM>/g' >> subst.tmp
125 @misc/csort < subst.tmp | uniq > subst.sed
126 @echo '/<\/TITLE>/a\' >> subst.sed
127 @echo '<link rev=made href="mailto:bug-ncurses@gnu.org">\' >> subst.sed
128 @echo '<meta http-equiv="Content-Type" content="text\/html; charset=iso-8859-1">' >> subst.sed
129 @rm -f subst.tmp
130 @for f in man/*.[0-9]* ; do \
131 m=`basename $$f` ;\
132 T=`egrep '^.TH' $$f|sed -e 's/^.TH //' -e s'/"//g' -e 's/[ ]\+$$//'` ; \
133 g=$${m}.html ;\
134 if [ -f doc/html/$$g ]; then chmod +w doc/html/$$g; fi;\
135 echo "Converting $$m to HTML" ;\
Steve Kondikae271bc2015-11-15 02:50:53 +0100136 echo '<!-- ' > doc/html/man/$$g ;\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530137 egrep '^.\\"[^#]' $$f | \
138 sed -e 's/\$$/@/g' \
139 -e 's/^.../ */' \
140 -e 's/</\&lt;/g' \
141 -e 's/>/\&gt;/g' \
142 >> doc/html/man/$$g ;\
143 echo '-->' >> doc/html/man/$$g ;\
Steve Kondikae271bc2015-11-15 02:50:53 +0100144 ./edit_man.sh normal editing /usr/man man $$f | \
145 $(MANPROG) | \
146 tr '\255' '-' | \
147 $(MAN2HTML) \
148 -title "$$T" \
149 -aliases man/manhtml.aliases \
150 -externs man/manhtml.externs | \
151 sed -f subst.sed |\
152 sed -e 's/"curses.3x.html"/"ncurses.3x.html"/g' \
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530153 >> doc/html/man/$$g ;\
154 done
155 @rm -f subst.sed
156
157#
158# Please note that this target can only be properly built if the build of the
159# Ada95 subdir has been done. The reason is, that the gnathtml tool uses the
160# .ali files generated by the Ada95 compiler during the build process. These
161# .ali files contain cross referencing information required by gnathtml.
162adahtml:
163 if [ ! -z "$(GNATHTML)" ]; then \
Steve Kondikae271bc2015-11-15 02:50:53 +0100164 (cd ./Ada95/gen ; make html GNATHTML=$(GNATHTML) ) ;\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530165 fi
166
167# This only works on a clean source tree, of course.
168MANIFEST:
169 -rm -f $@
170 touch $@
171 find . -type f -print |misc/csort | fgrep -v .lsm |fgrep -v .spec >$@
172
173TAGS:
174 etags */*.[ch]
175
176# Makefile ends here