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