2002-09-18 18:00:33 +04:00
|
|
|
# $NetBSD: Makefile,v 1.10 2002/09/18 14:00:43 lukem Exp $
|
1998-01-09 11:03:16 +03:00
|
|
|
#
|
2001-03-31 15:37:44 +04:00
|
|
|
# @(#)Makefile 8.29 (Berkeley) 10/19/96
|
1996-05-20 05:53:18 +04:00
|
|
|
|
2002-09-18 18:00:33 +04:00
|
|
|
NOMAN= # defined
|
|
|
|
|
2002-06-18 04:08:00 +04:00
|
|
|
CATALOG= dutch english french german ru_RU.KOI8-R spanish swedish
|
2001-03-31 17:58:56 +04:00
|
|
|
VI_FILES= ${.CURDIR}/../cl/*.c ${.CURDIR}/../common/*.c \
|
|
|
|
${.CURDIR}/../ex/*.c ${.CURDIR}/../vi/*.c
|
2002-06-18 04:08:00 +04:00
|
|
|
FILES= ${CATALOG}
|
2001-03-31 16:13:34 +04:00
|
|
|
FILESDIR= /usr/share/vi/catalog
|
1996-05-20 05:53:18 +04:00
|
|
|
|
2001-03-31 15:37:44 +04:00
|
|
|
HOSTPROG= dump
|
|
|
|
SRCS= dump.c
|
1996-05-20 05:53:18 +04:00
|
|
|
|
2002-06-18 04:08:00 +04:00
|
|
|
CLEANFILES+= ${CATALOG} english.base *.check __ck1 __ck2
|
2001-03-31 15:37:44 +04:00
|
|
|
|
2002-06-18 04:08:00 +04:00
|
|
|
realall: ${CATALOG}
|
2001-03-31 15:37:44 +04:00
|
|
|
|
2002-06-18 04:08:00 +04:00
|
|
|
${CATALOG}: english.base ${HOSTPROG}
|
1996-05-20 05:53:18 +04:00
|
|
|
@echo "... $@"; \
|
|
|
|
rm -f $@; \
|
2001-03-31 17:58:56 +04:00
|
|
|
if test -f $@.base; then \
|
|
|
|
f=$@.base; \
|
|
|
|
else \
|
|
|
|
f=${.CURDIR}/$@.base; \
|
|
|
|
fi; \
|
|
|
|
sort -u $$f | \
|
1996-05-20 05:53:18 +04:00
|
|
|
awk '{ \
|
|
|
|
if ($$1 == 1) { \
|
|
|
|
print "\nMESSAGE NUMBER 1 IS NOT LEGAL"; \
|
|
|
|
exit 1; \
|
|
|
|
} \
|
|
|
|
if (++nline > $$1) { \
|
|
|
|
print "DUPLICATE MESSAGE NUMBER " $$1; \
|
|
|
|
exit 1; \
|
|
|
|
} \
|
|
|
|
for (; nline < $$1; ++nline) \
|
|
|
|
print ""; \
|
|
|
|
print $0; \
|
|
|
|
}' | \
|
|
|
|
sed -e '1s/^/VI_MESSAGE_CATALOG/' \
|
|
|
|
-e '/"/s/^[^"]*"//' \
|
|
|
|
-e '1!s/"$$/X/' > $@; \
|
|
|
|
chmod 444 $@; \
|
|
|
|
if grep DUPLICATE $@ > /dev/null; then \
|
|
|
|
grep DUPLICATE $@; \
|
|
|
|
fi; \
|
|
|
|
if grep 'NOT LEGAL' $@ > /dev/null; then \
|
|
|
|
grep 'NOT LEGAL' $@; \
|
|
|
|
fi
|
|
|
|
|
2001-03-31 15:37:44 +04:00
|
|
|
CHK= dutch.check english.check french.check german.check \
|
|
|
|
ru_RU.KOI8-R.check spanish.check swedish.check
|
1996-05-20 05:53:18 +04:00
|
|
|
check: ${CHK}
|
2002-06-18 04:08:00 +04:00
|
|
|
${CHK}: ${CATALOG}
|
1996-05-20 05:53:18 +04:00
|
|
|
@echo "... $@"; \
|
|
|
|
f=`basename $@ .check`; \
|
|
|
|
(echo "Unused message id's (this is okay):"; \
|
|
|
|
awk '{ \
|
|
|
|
while (++nline < $$1) \
|
|
|
|
printf "%03d\n", nline; \
|
2001-03-31 17:58:56 +04:00
|
|
|
}' < ${.CURDIR}/$$f.base; \
|
1996-05-20 05:53:18 +04:00
|
|
|
echo =========================; \
|
2001-03-31 15:37:44 +04:00
|
|
|
echo "MISSING ERROR MESSAGES (Please add!):"; \
|
2001-03-31 17:58:56 +04:00
|
|
|
awk '{print $$1}' < ${.CURDIR}/$$f.base | sort -u > __ck1; \
|
2001-03-31 15:37:44 +04:00
|
|
|
awk '{print $$1}' < english.base | sort -u > __ck2; \
|
|
|
|
comm -13 __ck1 __ck2; \
|
1996-05-20 05:53:18 +04:00
|
|
|
echo =========================; \
|
|
|
|
echo "Extra error messages (just delete them):"; \
|
2001-03-31 15:37:44 +04:00
|
|
|
comm -23 __ck1 __ck2; \
|
1996-05-20 05:53:18 +04:00
|
|
|
echo =========================; \
|
2001-03-31 15:37:44 +04:00
|
|
|
echo "MESSAGES WITH THE SAME MESSAGE ID's (FIX!):"; \
|
1996-05-20 05:53:18 +04:00
|
|
|
for j in \
|
|
|
|
`sed '/^$$/d' < $$f.base | sort -u | \
|
|
|
|
awk '{print $$1}' | uniq -d`; do \
|
|
|
|
egrep $$j $$f.base; \
|
|
|
|
done; \
|
|
|
|
echo =========================; \
|
|
|
|
echo "Duplicate messages, both id and message (this is okay):"; \
|
|
|
|
sed '/^$$/d' < $$f.base | sort | uniq -c | \
|
|
|
|
awk '$$1 != 1 { print $$0 }' | sort -n; \
|
|
|
|
echo =========================; \
|
|
|
|
echo "Duplicate messages, just message (this is okay):"; \
|
|
|
|
sed '/^$$/d' < $$f | sort | uniq -c | \
|
|
|
|
awk '$$1 != 1 { print $$0 }' | sort -n; \
|
|
|
|
echo =========================) > $@
|
|
|
|
|
2001-03-31 15:37:44 +04:00
|
|
|
english.base: dump ${VI_FILES} #Makefile
|
|
|
|
./dump ${VI_FILES} |\
|
1996-05-20 05:53:18 +04:00
|
|
|
sed -e '/|/!d' \
|
|
|
|
-e 's/|/ "/' \
|
2001-03-31 15:37:44 +04:00
|
|
|
-e 's/^"//' \
|
|
|
|
-e 's/\\"/"/g' |\
|
1996-05-20 05:53:18 +04:00
|
|
|
sort -n > $@
|
|
|
|
|
2001-03-31 15:37:44 +04:00
|
|
|
.include <bsd.hostprog.mk>
|