1 # Makefile for authoring less.
3 EMAIL = bug-less@gnu.org
4 HOMEPAGE = http://www.greenwoodsoftware.com/less
12 main.c screen.c brac.c ch.c charset.c cmdbuf.c \
13 command.c cvt.c decode.c edit.c filename.c forwback.c \
14 help.c ifile.c input.c jump.c line.c linenum.c \
15 lsystem.c mark.c optfunc.c option.c opttbl.c os.c \
16 output.c pattern.c position.c prompt.c search.c signal.c \
17 tags.c ttyin.c version.c
19 defines.ds Makefile.dsb Makefile.dsg Makefile.dsu \
20 defines.o2 Makefile.o2e \
21 defines.o9 Makefile.o9c Makefile.o9u \
22 defines.wn Makefile.wnm Makefile.wnb
24 ${SRC} regexp.c regexp.h \
25 COPYING INSTALL LICENSE Makefile.in Makefile.aut NEWS README \
26 configure configure.ac lesskey.c lessecho.c scrsize.c \
27 charset.h cmd.h funcs.h lglob.h less.h lesskey.h option.h \
28 pckeys.h pattern.h position.h \
29 install.sh defines.h.in mkinstalldirs \
30 less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man \
32 mkfuncs.awk mkhelp.c \
35 all: help.c funcs.h ${srcdir}/configure
38 ${MAKE} -f Makefile.aut tagall
39 ${MAKE} -f Makefile.aut all
40 ${MAKE} -f Makefile.aut clean
41 ${MAKE} -f Makefile.aut dist
45 help.c: less.hlp mkhelp
46 -mv -f ${srcdir}/help.c ${srcdir}/help.c.old
48 ./mkhelp < less.hlp > help.c
49 if cmp -s help.c help.c.old; then mv help.c.old help.c; fi
52 ${CC} -o mkhelp mkhelp.c
54 ${srcdir}/configure: ${srcdir}/configure.ac \
56 cd ${srcdir}; autoheader; autoconf
58 funcs.h: ${SRC:%=${srcdir}/%}
59 -mv -f ${srcdir}/funcs.h ${srcdir}/funcs.h.old
60 awk -f ${srcdir}/mkfuncs.awk ${SRC:%=${srcdir}/%} >${srcdir}/funcs.h
61 if cmp -s funcs.h funcs.h.old; then mv funcs.h.old funcs.h; fi
64 lint -I. ${CPPFLAGS} ${SRC}
67 rm -f Makefile config.status config.log config.cache defines.h stamp-h \
69 less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man
75 @REL=`sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q ${srcdir}/version.c`; \
76 DT=`date '+%d %h %Y'`; \
77 echo "Stuffing version number $$REL into $@"; \
79 -e "s;@@VERSION@@;$$REL;" \
80 -e "s;@@DATE@@;$$DT;" \
81 -e "s;@@EMAIL@@;${EMAIL};" \
82 -e "s;@@HOMEPAGE@@;${HOMEPAGE};" >$@
84 ${srcdir}/README: ${srcdir}/README.VER ${srcdir}/version.c
85 ${REPLACE_VERSION} ${srcdir}/README.VER
86 ${srcdir}/NEWS: ${srcdir}/NEWS.VER ${srcdir}/version.c
87 ${REPLACE_VERSION} ${srcdir}/NEWS.VER
88 ${srcdir}/less.nro: ${srcdir}/less.nro.VER ${srcdir}/version.c
89 ${REPLACE_VERSION} ${srcdir}/less.nro.VER
90 ${srcdir}/lesskey.nro: ${srcdir}/lesskey.nro.VER ${srcdir}/version.c
91 ${REPLACE_VERSION} ${srcdir}/lesskey.nro.VER
92 ${srcdir}/lessecho.nro: ${srcdir}/lessecho.nro.VER ${srcdir}/version.c
93 ${REPLACE_VERSION} ${srcdir}/lessecho.nro.VER
94 ${srcdir}/less.hlp: ${srcdir}/less.hlp.VER ${srcdir}/version.c
95 ${REPLACE_VERSION} ${srcdir}/less.hlp.VER
97 ${srcdir}/less.man: ${srcdir}/less.nro
98 ${NROFF} ${srcdir}/less.nro >${srcdir}/less.man
99 ${srcdir}/lesskey.man: ${srcdir}/lesskey.nro
100 ${NROFF} ${srcdir}/lesskey.nro >${srcdir}/lesskey.man
101 ${srcdir}/lessecho.man: ${srcdir}/lessecho.nro
102 ${NROFF} ${srcdir}/lessecho.nro >${srcdir}/lessecho.man
105 distfiles: ${DISTFILES}
108 if [ ! -d ${srcdir}/release ]; then mkdir ${srcdir}/release; fi
110 REL=`sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/less-\1/' -e q version.c`; \
111 rm -rf release/$$REL; mkdir release/$$REL; \
112 echo "Preparing $$REL"; \
113 rm -rf $$REL; mkdir $$REL; \
114 for file in ${DISTFILES}; do \
115 ./add_copyright $$file $$REL; \
117 cd $$REL; chmod +w ${DISTFILES_W}; cd ..; \
118 echo "Creating release/$$REL/$$REL.tar.gz"; \
119 tar -cf - $$REL | gzip -c >release/$$REL/$$REL.tar.gz; \
120 echo "Signing release/$$REL/$$REL.tar.gz"; \
121 gpg --detach-sign release/$$REL/$$REL.tar.gz; \
122 echo "Creating release/$$REL/$$REL.zip"; \
123 zip -rq release/$$REL/$$REL.zip $$REL; \
127 @REL=`sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/v\1/' -e q ${srcdir}/version.c`; \
128 echo "tagging $$REL"; \
129 for f in ${srcdir}/RCS/*,v; do \
130 REV=`co -p $$f 2>&1 | sed -e '1d' -e '3,$$d' -e 's/revision //'`; \
131 ${RCS} -N$$REL:$$REV $$f; \