1 1.3 christos # $NetBSD: Makefile,v 1.3 2018/05/01 19:59:43 christos Exp $ 2 1.1 christos # 3 1.1 christos # @(#)Makefile 8.29 (Berkeley) 10/19/96 4 1.1 christos 5 1.3 christos .include <bsd.hostinit.mk> 6 1.1 christos 7 1.1 christos .PATH: ${DIST}/catalog 8 1.1 christos 9 1.2 christos CATALOG= dutch english french german ru_RU.KOI8-R spanish swedish 10 1.1 christos 11 1.1 christos VI_FILES= ${DIST}/cl/*.c ${DIST}/common/*.c \ 12 1.1 christos ${DIST}/ex/*.c ${DIST}/vi/*.c 13 1.1 christos FILES= ${CATALOG} 14 1.1 christos FILESDIR= /usr/share/nvi/catalog 15 1.1 christos 16 1.1 christos HOSTPROG= dump 17 1.1 christos SRCS= dump.c 18 1.1 christos 19 1.1 christos CLEANFILES+= ${CATALOG} english.base *.check __ck1 __ck2 20 1.1 christos 21 1.1 christos realall: ${CATALOG} 22 1.1 christos 23 1.1 christos ${CATALOG}: ${CATALOG:S/$/.base/} 24 1.1 christos @echo "... $@"; \ 25 1.1 christos rm -f $@; \ 26 1.1 christos if test -f $@.base; then \ 27 1.1 christos f=$@.base; \ 28 1.1 christos else \ 29 1.1 christos f=${DIST}/catalog/$@.base; \ 30 1.1 christos fi; \ 31 1.1 christos sort -u $$f | \ 32 1.1 christos ${TOOL_AWK} '{ \ 33 1.1 christos if ($$1 == 1) { \ 34 1.1 christos print "\nMESSAGE NUMBER 1 IS NOT LEGAL"; \ 35 1.1 christos exit 1; \ 36 1.1 christos } \ 37 1.1 christos if (++nline > $$1) { \ 38 1.1 christos print "DUPLICATE MESSAGE NUMBER " $$1; \ 39 1.1 christos exit 1; \ 40 1.1 christos } \ 41 1.1 christos for (; nline < $$1; ++nline) \ 42 1.1 christos print ""; \ 43 1.1 christos print $0; \ 44 1.1 christos }' | \ 45 1.1 christos ${TOOL_SED} -e '1s/^/VI_MESSAGE_CATALOG/' \ 46 1.1 christos -e '/"/s/^[^"]*"//' \ 47 1.1 christos -e '1!s/"$$/X/' > $@; \ 48 1.1 christos if grep DUPLICATE $@ > /dev/null; then \ 49 1.1 christos grep DUPLICATE $@; \ 50 1.1 christos fi; \ 51 1.1 christos if grep 'NOT LEGAL' $@ > /dev/null; then \ 52 1.1 christos grep 'NOT LEGAL' $@; \ 53 1.1 christos fi 54 1.1 christos 55 1.1 christos CHK= dutch.check english.check french.check german.check \ 56 1.1 christos ru_RU.KOI8-R.check spanish.check swedish.check 57 1.1 christos check: ${CHK} 58 1.1 christos ${CHK}: ${CATALOG} 59 1.1 christos @echo "... $@"; \ 60 1.1 christos f=${DIST}/catalog/`basename $@ .check`; \ 61 1.1 christos (echo "Unused message id's (this is okay):"; \ 62 1.1 christos ${TOOL_AWK} '{ \ 63 1.1 christos while (++nline < $$1) \ 64 1.1 christos printf "%03d\n", nline; \ 65 1.1 christos }' < ${DIST}/catalog/$$f.base; \ 66 1.1 christos echo =========================; \ 67 1.1 christos echo "MISSING ERROR MESSAGES (Please add!):"; \ 68 1.1 christos ${TOOL_AWK} '{print $$1}' < $$f.base | sort -u > __ck1; \ 69 1.1 christos ${TOOL_AWK} '{print $$1}' < english.base | sort -u > __ck2; \ 70 1.1 christos comm -13 __ck1 __ck2; \ 71 1.1 christos echo =========================; \ 72 1.1 christos echo "Extra error messages (just delete them):"; \ 73 1.1 christos comm -23 __ck1 __ck2; \ 74 1.1 christos echo =========================; \ 75 1.1 christos echo "MESSAGES WITH THE SAME MESSAGE ID's (FIX!):"; \ 76 1.1 christos for j in \ 77 1.1 christos `${TOOL_SED} '/^$$/d' < $$f.base | sort -u | \ 78 1.1 christos ${TOOL_AWK} '{print $$1}' | uniq -d`; do \ 79 1.1 christos egrep $$j $$f.base; \ 80 1.1 christos done; \ 81 1.1 christos echo =========================; \ 82 1.1 christos echo "Duplicate messages, both id and message (this is okay):"; \ 83 1.1 christos ${TOOL_SED} '/^$$/d' < $$f.base | sort | uniq -c | \ 84 1.1 christos ${TOOL_AWK} '$$1 != 1 { print $$0 }' | sort -n; \ 85 1.1 christos echo =========================; \ 86 1.1 christos echo "Duplicate messages, just message (this is okay):"; \ 87 1.1 christos ${TOOL_SED} '/^$$/d' < $$f | sort | uniq -c | \ 88 1.1 christos ${TOOL_AWK} '$$1 != 1 { print $$0 }' | sort -n; \ 89 1.1 christos echo =========================) > $@ 90 1.1 christos 91 1.1 christos english.base: dump ${VI_FILES} #Makefile 92 1.1 christos ${_MKTARGET_CREATE} 93 1.1 christos ./dump ${VI_FILES} |\ 94 1.1 christos ${TOOL_SED} -e '/|/!d' \ 95 1.1 christos -e 's/|/ "/' \ 96 1.1 christos -e 's/^"//' \ 97 1.1 christos -e 's/\\"/"/g' |\ 98 1.1 christos sort -n > $@ 99 1.1 christos 100 1.1 christos .include <bsd.hostprog.mk> 101