1 # Makefile for authoring less.
3 EMAIL = markn@greenwoodsoftware.com
4 HOMEPAGE = http://www.greenwoodsoftware.com/less
12 main.c screen.c brac.c ch.c charset.c cmdbuf.c \
13 command.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 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 pckeys.h position.h \
28 install.sh defines.h.in mkinstalldirs \
29 less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man \
31 mkfuncs.awk mkhelp.c \
34 all: help.c funcs.h ${srcdir}/configure
36 help.c: less.hlp mkhelp
37 -mv -f ${srcdir}/help.c ${srcdir}/help.c.old
39 ./mkhelp < less.hlp > help.c
40 if cmp -s help.c help.c.old; then mv help.c.old help.c; fi
43 ${CC} -o mkhelp mkhelp.c
45 ${srcdir}/configure: ${srcdir}/configure.ac \
47 cd ${srcdir}; autoheader; autoconf
49 funcs.h: ${SRC:%=${srcdir}/%}
50 -mv -f ${srcdir}/funcs.h ${srcdir}/funcs.h.old
51 awk -f ${srcdir}/mkfuncs.awk ${SRC:%=${srcdir}/%} >${srcdir}/funcs.h
52 if cmp -s funcs.h funcs.h.old; then mv funcs.h.old funcs.h; fi
55 lint -I. ${CPPFLAGS} ${SRC}
58 rm -f Makefile config.status config.log config.cache defines.h stamp-h \
60 less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man
66 @REL=`sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q ${srcdir}/version.c`; \
67 DT=`date '+%d %h %Y'`; \
68 echo "Stuffing version number $$REL into $@"; \
70 -e "s;@@VERSION@@;$$REL;" \
71 -e "s;@@DATE@@;$$DT;" \
72 -e "s;@@EMAIL@@;${EMAIL};" \
73 -e "s;@@HOMEPAGE@@;${HOMEPAGE};" >$@
75 ${srcdir}/README: ${srcdir}/README.VER ${srcdir}/version.c
76 ${REPLACE_VERSION} ${srcdir}/README.VER
77 ${srcdir}/NEWS: ${srcdir}/NEWS.VER ${srcdir}/version.c
78 ${REPLACE_VERSION} ${srcdir}/NEWS.VER
79 ${srcdir}/less.nro: ${srcdir}/less.nro.VER ${srcdir}/version.c
80 ${REPLACE_VERSION} ${srcdir}/less.nro.VER
81 ${srcdir}/lesskey.nro: ${srcdir}/lesskey.nro.VER ${srcdir}/version.c
82 ${REPLACE_VERSION} ${srcdir}/lesskey.nro.VER
83 ${srcdir}/lessecho.nro: ${srcdir}/lessecho.nro.VER ${srcdir}/version.c
84 ${REPLACE_VERSION} ${srcdir}/lessecho.nro.VER
85 ${srcdir}/less.hlp: ${srcdir}/less.hlp.VER ${srcdir}/version.c
86 ${REPLACE_VERSION} ${srcdir}/less.hlp.VER
88 ${srcdir}/less.man: ${srcdir}/less.nro
89 ${NROFF} ${srcdir}/less.nro >${srcdir}/less.man
90 ${srcdir}/lesskey.man: ${srcdir}/lesskey.nro
91 ${NROFF} ${srcdir}/lesskey.nro >${srcdir}/lesskey.man
92 ${srcdir}/lessecho.man: ${srcdir}/lessecho.nro
93 ${NROFF} ${srcdir}/lessecho.nro >${srcdir}/lessecho.man
96 distfiles: ${DISTFILES}
99 if [ ! -d ${srcdir}/release ]; then mkdir ${srcdir}/release; fi
101 REL=`sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/less-\1/' -e q version.c`; \
102 rm -rf release/$$REL; mkdir release/$$REL; \
103 echo "Preparing $$REL"; \
104 rm -rf $$REL; mkdir $$REL; \
105 for file in ${DISTFILES}; do \
106 cp -p $$file $$REL; \
107 chmod -w $$REL/$$file; \
109 cd $$REL; chmod +w ${DISTFILES_W}; cd ..; \
110 echo "Creating release/$$REL/$$REL.tar.gz"; \
111 tar -cf - $$REL | gzip -c >release/$$REL/$$REL.tar.gz; \
112 echo "Creating release/$$REL/$$REL.zip"; \
113 zip -rq release/$$REL/$$REL.zip $$REL; \
117 @REL=`sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/v\1/' -e q ${srcdir}/version.c`; \
118 echo "tagging $$REL"; \
119 for f in ${srcdir}/RCS/*,v; do \
120 REV=`co -p $$f 2>&1 | sed -e '1d' -e '3,$$d' -e 's/revision //'`; \
121 ${RCS} -N$$REL:$$REV $$f; \