166 lines
5.5 KiB
Makefile
166 lines
5.5 KiB
Makefile
# Makefile for authoring less.
|
|
|
|
EMAIL = bug-less@gnu.org
|
|
HOMEPAGE = https://greenwoodsoftware.com/less
|
|
SHELL = /bin/sh
|
|
GIT = git
|
|
NROFF = nroff -t -man
|
|
|
|
srcdir = .
|
|
REL := $(shell sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q ${srcdir}/version.c)
|
|
|
|
ifeq ($(USE_PYTHON),1)
|
|
MKHELP = mkhelp.py
|
|
else
|
|
MKHELP = mkhelp.pl
|
|
endif
|
|
|
|
SRC = \
|
|
main.c screen.c brac.c ch.c charset.c cmdbuf.c \
|
|
command.c cvt.c decode.c edit.c filename.c forwback.c \
|
|
help.c ifile.c input.c jump.c line.c linenum.c \
|
|
lsystem.c mark.c optfunc.c option.c opttbl.c os.c \
|
|
output.c pattern.c position.c prompt.c search.c signal.c \
|
|
tags.c ttyin.c version.c xbuf.c
|
|
DISTFILES_W = \
|
|
defines.ds Makefile.dsb Makefile.dsg Makefile.dsu \
|
|
defines.o2 Makefile.o2e \
|
|
defines.o9 Makefile.o9c Makefile.o9u \
|
|
defines.wn Makefile.wnm Makefile.wnb Makefile.wng \
|
|
configure
|
|
UNICODE_FILES = \
|
|
compose.uni fmt.uni ubin.uni wide.uni
|
|
DISTFILES = \
|
|
${SRC} regexp.c regexp.h \
|
|
COPYING INSTALL LICENSE Makefile.in Makefile.aut NEWS README \
|
|
configure.ac lesskey.c lesskey_parse.c lessecho.c scrsize.c \
|
|
charset.h cmd.h funcs.h lglob.h less.h lesskey.h option.h \
|
|
pckeys.h pattern.h position.h xbuf.h \
|
|
install.sh defines.h.in mkinstalldirs \
|
|
less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man \
|
|
less.hlp \
|
|
mkhelp.pl \
|
|
mkhelp.py \
|
|
mkutable $(UNICODE_FILES) \
|
|
${DISTFILES_W}
|
|
|
|
all: help.c funcs.h $(UNICODE_FILES) ${srcdir}/configure
|
|
|
|
release: .FORCE
|
|
@if ${srcdir}/ready_to_release -d ${srcdir}; then :; else exit 1; fi
|
|
${MAKE} -f Makefile.aut tagall
|
|
${MAKE} -f Makefile.aut all
|
|
${MAKE} -f Makefile.aut clean
|
|
${MAKE} -f Makefile.aut dist
|
|
|
|
.FORCE:
|
|
|
|
help.c: less.hlp
|
|
-mv -f ${srcdir}/help.c ${srcdir}/help.c.old
|
|
rm -rf help.c
|
|
${srcdir}/${MKHELP} < less.hlp > help.c
|
|
if cmp -s help.c help.c.old; then mv -f help.c.old help.c; fi
|
|
|
|
${srcdir}/configure ${srcdir}/defines.h.in: ${srcdir}/configure.ac ${srcdir}/Makefile.in
|
|
cd ${srcdir}; autoheader; autoconf
|
|
|
|
funcs.h: ${SRC:%=${srcdir}/%}
|
|
-mv -f ${srcdir}/funcs.h ${srcdir}/funcs.h.old
|
|
grep -h '^public [^;]*$$' ${SRC:%=${srcdir}/%} | sed 's/$$/;/' >${srcdir}/funcs.h
|
|
|
|
lint:
|
|
lint -I. ${CPPFLAGS} ${SRC}
|
|
|
|
clean:
|
|
rm -f Makefile config.status config.log config.cache defines.h stamp-h \
|
|
configure defines.h.in funcs.h help.c \
|
|
less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man
|
|
|
|
distclean: clean
|
|
realclean: clean
|
|
|
|
REPLACE_VERSION = \
|
|
DT=`date '+%d %h %Y'`; \
|
|
echo "Stuffing version number ${REL} into $@"; \
|
|
rm -f $@; \
|
|
sed \
|
|
-e "s;@@VERSION@@;${REL};" \
|
|
-e "s;@@DATE@@;$$DT;" >$@
|
|
|
|
${srcdir}/less.nro: ${srcdir}/less.nro.VER ${srcdir}/version.c
|
|
${REPLACE_VERSION} ${srcdir}/less.nro.VER
|
|
${srcdir}/lesskey.nro: ${srcdir}/lesskey.nro.VER ${srcdir}/version.c
|
|
${REPLACE_VERSION} ${srcdir}/lesskey.nro.VER
|
|
${srcdir}/lessecho.nro: ${srcdir}/lessecho.nro.VER ${srcdir}/version.c
|
|
${REPLACE_VERSION} ${srcdir}/lessecho.nro.VER
|
|
|
|
${srcdir}/less.man: ${srcdir}/less.nro
|
|
${NROFF} ${srcdir}/less.nro >${srcdir}/less.man
|
|
${srcdir}/lesskey.man: ${srcdir}/lesskey.nro
|
|
${NROFF} ${srcdir}/lesskey.nro >${srcdir}/lesskey.man
|
|
${srcdir}/lessecho.man: ${srcdir}/lessecho.nro
|
|
${NROFF} ${srcdir}/lessecho.nro >${srcdir}/lessecho.man
|
|
|
|
compose.uni: unicode/UnicodeData.txt
|
|
./mkutable -f2 Mn Me -- unicode/UnicodeData.txt > $@
|
|
fmt.uni: unicode/UnicodeData.txt
|
|
./mkutable -f2 Cf -- unicode/UnicodeData.txt > $@
|
|
ubin.uni: unicode/UnicodeData.txt
|
|
./mkutable -f2 Cc Cs Co Zl Zp -- unicode/UnicodeData.txt > $@
|
|
wide.uni: unicode/EastAsianWidth.txt
|
|
./mkutable -f1 W F -- unicode/EastAsianWidth.txt > $@
|
|
|
|
unicode-check:
|
|
rm -rf unicode-old
|
|
mv -f unicode unicode-old
|
|
${MAKE} -f Makefile.aut unicode/UnicodeData.txt unicode/EastAsianWidth.txt
|
|
@if diff -q unicode-old unicode >/dev/null; then rm -rf unicode; mv -f unicode-old unicode; echo "unicode files already up to date"; else echo "unicode files updated"; fi
|
|
|
|
unicode/UnicodeData.txt:
|
|
mkdir -p unicode
|
|
lftp -c 'open -u "anonymous:${EMAIL}" ftp.unicode.org ; get Public/UNIDATA/UnicodeData.txt -o $@'
|
|
touch $@
|
|
unicode/EastAsianWidth.txt:
|
|
mkdir -p unicode
|
|
lftp -c 'open -u "anonymous:${EMAIL}" ftp.unicode.org ; get Public/UNIDATA/EastAsianWidth.txt -o $@'
|
|
touch $@
|
|
|
|
distfiles: ${DISTFILES}
|
|
|
|
echo_distfiles:
|
|
@echo $(subst .nro,.nro.VER,${DISTFILES})
|
|
|
|
dist: ${DISTFILES}
|
|
if [ ! -d ${srcdir}/release ]; then mkdir ${srcdir}/release; fi
|
|
@LESSREL=less-${REL} && RELDIR=release/$$LESSREL && \
|
|
TARF=$$LESSREL-beta.tar.gz && ZIPF=$$LESSREL-beta.zip && \
|
|
cd ${srcdir} && \
|
|
rm -rf $$RELDIR && mkdir $$RELDIR && \
|
|
echo "Preparing $$LESSREL" && \
|
|
rm -rf $$LESSREL && mkdir $$LESSREL && \
|
|
cp ${DISTFILES} $$LESSREL && \
|
|
cd $$LESSREL && chmod -w * && chmod +w ${DISTFILES_W} && chmod +x configure && cd .. && \
|
|
echo "Creating $$RELDIR/$$TARF" && \
|
|
tar -cf - $$LESSREL | gzip -c >$$RELDIR/$$TARF && \
|
|
echo "Signing $$RELDIR/$$TARF" && \
|
|
gpg --detach-sign $$RELDIR/$$TARF && \
|
|
mv $$RELDIR/$$TARF.sig $$RELDIR/$$LESSREL.sig && \
|
|
echo "Creating $$RELDIR/$$ZIPF" && \
|
|
zip -rq $$RELDIR/$$ZIPF $$LESSREL && \
|
|
rm -rf $$LESSREL
|
|
|
|
tagall:
|
|
echo "tagging v${REL}"; \
|
|
$(GIT) tag -a -f -m "v${REL}" "v${REL}"
|
|
|
|
gnu_upload:
|
|
@if [ -z "${REL}" ]; then echo "Please set REL=nnn"; exit 1; fi; \
|
|
LESSREL=less-${REL} && RELDIR=release/$$LESSREL && \
|
|
TARF=$$LESSREL.tar.gz && \
|
|
if [ ! -s $$RELDIR/$$TARF ]; then echo "$$RELDIR/$$TARF does not exist"; exit 1; fi; \
|
|
cd $$RELDIR && \
|
|
gpg -b $$TARF && \
|
|
( echo "version: 1.2"; echo "directory: less"; echo "filename: $$TARF" ) > $$TARF.directive && \
|
|
gpg --clearsign $$TARF.directive && \
|
|
echo "upload ready: cd $$RELDIR; ftp ftp-upload.gnu.org; cd /incoming/ftp; put $$TARF $$TARF.sig $$TARF.directive.asc"
|