home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / EDITOR / NVI179B / NVI179B.ZIP / catalog / Makefile < prev    next >
Makefile  |  1996-10-19  |  3KB  |  85 lines

  1. #    @(#)Makefile    8.29 (Berkeley) 10/19/96
  2.  
  3. CAT=    dutch english french german ru_SU.KOI8-R spanish swedish
  4. FILES=    ../cl/*.c ../common/*.c ../ex/*.c ../tk/*.c ../vi/*.c
  5.  
  6. all: dump ${CAT}
  7.  
  8. ${CAT}: english.base
  9.     @echo "... $@";                            \
  10.     rm -f $@;                            \
  11.     sort -u $@.base |                        \
  12.     awk '{                                \
  13.         if ($$1 == 1) {                        \
  14.             print "\nMESSAGE NUMBER 1 IS NOT LEGAL";    \
  15.             exit 1;                        \
  16.         }                            \
  17.         if (++nline > $$1) {                    \
  18.             print "DUPLICATE MESSAGE NUMBER " $$1;        \
  19.             exit 1;                        \
  20.         }                            \
  21.         for (; nline < $$1; ++nline)                \
  22.             print "";                    \
  23.         print $0;                        \
  24.     }' |                                \
  25.     sed -e '1s/^/VI_MESSAGE_CATALOG/'                \
  26.         -e '/"/s/^[^"]*"//'                        \
  27.         -e '1!s/"$$/X/' > $@;                    \
  28.     chmod 444 $@;                            \
  29.     if grep DUPLICATE $@ > /dev/null; then                \
  30.         grep DUPLICATE $@;                    \
  31.     fi;                                \
  32.     if grep 'NOT LEGAL' $@ > /dev/null; then            \
  33.         grep 'NOT LEGAL' $@;                    \
  34.     fi
  35.  
  36. CHK=    dutch.check english.check french.check german.check \
  37.     ru_SU.KOI8-R.check spanish.check swedish.check
  38. check: ${CHK}
  39. ${CHK}: ${CAT}
  40.     @echo "... $@";                            \
  41.     f=`basename $@ .check`;                        \
  42.     (echo "Unused message id's (this is okay):";            \
  43.     awk '{                                \
  44.         while (++nline < $$1)                    \
  45.             printf "%03d\n", nline;                \
  46.     }' < $$f.base;                            \
  47.     echo =========================;                    \
  48.     echo "MISSING ERROR MESSAGES (Please add!):";            \
  49.     awk '{print $$1}' < $$f.base | sort -u > __ck1;            \
  50.     awk '{print $$1}' < english.base | sort -u > __ck2;        \
  51.     comm -13 __ck1 __ck2;                        \
  52.     echo =========================;                    \
  53.     echo "Extra error messages (just delete them):";        \
  54.     comm -23 __ck1 __ck2;                        \
  55.     echo =========================;                    \
  56.     echo "MESSAGES WITH THE SAME MESSAGE ID's (FIX!):";        \
  57.     for j in                            \
  58.         `sed '/^$$/d' < $$f.base | sort -u |            \
  59.         awk '{print $$1}' | uniq -d`; do                \
  60.         egrep $$j $$f.base;                    \
  61.     done;                                \
  62.     echo =========================;                    \
  63.     echo "Duplicate messages, both id and message (this is okay):";    \
  64.     sed '/^$$/d' < $$f.base | sort | uniq -c |            \
  65.     awk '$$1 != 1 { print $$0 }' | sort -n;                \
  66.     echo =========================;                    \
  67.     echo "Duplicate messages, just message (this is okay):";    \
  68.     sed '/^$$/d' < $$f | sort | uniq -c |                \
  69.     awk '$$1 != 1 { print $$0 }' | sort -n;                \
  70.     echo =========================) > $@
  71.  
  72. english.base: dump ${FILES} #Makefile
  73.     ./dump ${FILES} |\
  74.     sed -e '/|/!d' \
  75.         -e 's/|/ "/' \
  76.         -e 's/^"//' \
  77.         -e 's/\\"/"/g' |\
  78.     sort -n > $@
  79.  
  80. dump: dump.c
  81.     ${CC} -O -o dump dump.c
  82.  
  83. clean:
  84.     rm -f dump dump.o ${CAT} english.base *.check __ck1 __ck2
  85.