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