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.in acconfig.h lesskey.c lessecho.c scrsize.c \
27 cmd.h funcs.h lglob.h less.h lesskey.h option.h pckeys.h position.h \
28 install.sh defines.h.in defines.h.top mkinstalldirs \
29 less.nro lesskey.nro less.man lesskey.man less.hlp \
30 mkfuncs.awk mkhelp.c \
33 all: help.c funcs.h ${srcdir}/configure
35 help.c: less.hlp mkhelp
36 -mv -f ${srcdir}/help.c ${srcdir}/help.c.old
38 ./mkhelp < less.hlp > help.c
39 if cmp -s help.c help.c.old; then mv help.c.old help.c; fi
42 ${CC} -o mkhelp mkhelp.c
44 ${srcdir}/configure: ${srcdir}/configure.in \
45 ${srcdir}/Makefile.in \
46 ${srcdir}/defines.h.top \
48 cd ${srcdir}; autoheader; autoconf
50 funcs.h: ${SRC:%=${srcdir}/%}
51 -mv -f ${srcdir}/funcs.h ${srcdir}/funcs.h.old
52 awk -f ${srcdir}/mkfuncs.awk ${SRC:%=${srcdir}/%} >${srcdir}/funcs.h
53 if cmp -s funcs.h funcs.h.old; then mv funcs.h.old funcs.h; fi
56 lint -I. ${CPPFLAGS} ${SRC}
59 rm -f Makefile config.status config.log config.cache defines.h stamp-h \
60 README NEWS less.nro lesskey.nro less.man lesskey.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}/less.hlp: ${srcdir}/less.hlp.VER ${srcdir}/version.c
84 ${REPLACE_VERSION} ${srcdir}/less.hlp.VER
86 ${srcdir}/less.man: ${srcdir}/less.nro
87 ${NROFF} ${srcdir}/less.nro >${srcdir}/less.man
88 ${srcdir}/lesskey.man: ${srcdir}/lesskey.nro
89 ${NROFF} ${srcdir}/lesskey.nro >${srcdir}/lesskey.man
92 distfiles: ${DISTFILES}
95 if [ ! -d ${srcdir}/release ]; then mkdir ${srcdir}/release; fi
97 REL=`sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/less-\1/' -e q version.c`; \
98 rm -rf release/$$REL; mkdir release/$$REL; \
99 echo "Preparing $$REL"; \
100 rm -rf $$REL; mkdir $$REL; \
101 for file in ${DISTFILES}; do \
102 cp -p $$file $$REL; \
103 chmod -w $$REL/$$file; \
105 cd $$REL; chmod +w ${DISTFILES_W}; cd ..; \
106 echo "Creating release/$$REL/$$REL.tar.gz"; \
107 tar -cf - $$REL | gzip -c >release/$$REL/$$REL.tar.gz; \
108 echo "Creating release/$$REL/$$REL.zip"; \
109 zip -rq release/$$REL/$$REL.zip $$REL; \
113 @REL=`sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/v\1/' -e q ${srcdir}/version.c`; \
114 echo "tagging $$REL"; \
115 for f in ${srcdir}/RCS/*,v; do \
116 REV=`co -p $$f 2>&1 | sed -e '1d' -e '3,$$d' -e 's/revision //'`; \
117 ${RCS} -N$$REL:$$REV $$f; \