1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
# Makefile for ZIP-code dictionaries.
EMACS = @emacs@
GREP= @grep@
RM= @rm@
WGET= @wget@
LHA= @lha@
SKKDIC_EXPR=@skkdic_expr@
SKKDIC_SORT=@skkdic_sort@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
temp_dir = @temp_dir@
TEMP_ZIPCODE=$(temp_dir)/.zipcode
TEMP_OFFICE=$(temp_dir)/.office
SOURCE_KEN_ALL=http://www.post.yusei.go.jp/newnumber/lzh/s/ken_all.lzh
SOURCE_JIGYOSYO=http://www.post.yusei.go.jp/newnumber/lzh/o/jigyosyo.lzh
KEN_ALL_LZH=$(temp_dir)/ken_all.lzh
JIGYOSYO_LZH=$(temp_dir)/jigyosyo.lzh
KEN_ALL=$(temp_dir)/ken_all.csv
JIGYOSYO=$(temp_dir)/jigyosyo.csv
all: zipcode office words
zipcode:
$(EMACS) -batch -q -no-site-file -l $(srcdir)/ZIPCODE-MK -f mkdic-zipcode \
-f mkdic-zipcode-header $(TEMP_ZIPCODE) $(TEMP_OFFICE) $(KEN_ALL) \
$(JIGYOSYO)
$(SKKDIC_EXPR) $(TEMP_ZIPCODE) | $(SKKDIC_SORT) >> SKK-JISYO.zipcode
office:
$(EMACS) -batch -q -no-site-file -l $(srcdir)/ZIPCODE-MK -f mkdic-office \
-f mkdic-office-header $(TEMP_ZIPCODE) $(TEMP_OFFICE) $(KEN_ALL) \
$(JIGYOSYO)
$(SKKDIC_EXPR) $(TEMP_OFFICE) | $(SKKDIC_SORT) >> SKK-JISYO.office.zipcode
words:
$(EMACS) -batch -q -no-site-file -l $(srcdir)/ZIPCODE-MK -f mkdic-words
# For checking new entries.
update: orig all diff
orig:
cp -f $(srcdir)/SKK-JISYO.office.zipcode SKK-JISYO.office.zipcode.orig
cp -f $(srcdir)/SKK-JISYO.zipcode SKK-JISYO.zipcode.orig
cp -f $(srcdir)/words.zipcode words.zipcode.orig
diff:
diff -u SKK-JISYO.office.zipcode.orig SKK-JISYO.office.zipcode \
| cat > SKK-JISYO.office.zipcode.diff
diff -u SKK-JISYO.zipcode.orig SKK-JISYO.zipcode | cat \
> SKK-JISYO.zipcode.diff
diff -u words.zipcode.orig words.zipcode | cat > words.zipcode.diff
# For doing everything automatically.
batch: fetch extract update
fetch:
$(WGET) $(SOURCE_KEN_ALL) -O $(KEN_ALL_LZH)
$(WGET) $(SOURCE_JIGYOSYO) -O $(JIGYOSYO_LZH)
extract:
$(LHA) p $(KEN_ALL_LZH) | $(GREP) -e "^[0-9]" > $(KEN_ALL)
$(LHA) p $(JIGYOSYO_LZH) | $(GREP) -e "^[0-9]" > $(JIGYOSYO)
clean:
-$(RM) -f $(TEMP_ZIPCODE) $(TEMP_OFFICE)
clean-temps: clean
-$(RM) -f $(KEN_ALL) $(JIGYOSYO)
clean-sources: clean-temps
-$(RM) -f $(KEN_ALL_LZH) $(JIGYOSYO_LZH)
clean-diffs:
-$(RM) -f SKK-JISYO.office.zipcode.orig SKK-JISYO.office.zipcode.diff \
SKK-JISYO.zipcode.orig SKK-JISYO.zipcode.diff \
words.zipcode.orig words.zipcode.diff
paraclean: clean-temps clean-diffs
distclean: paraclean
-$(RM) -f config.cache config.status config.log Makefile
|