Skip to content

Instantly share code, notes, and snippets.

@xtetsuji
Created October 6, 2012 17:02
Show Gist options
  • Select an option

  • Save xtetsuji/3845483 to your computer and use it in GitHub Desktop.

Select an option

Save xtetsuji/3845483 to your computer and use it in GitHub Desktop.
Support Maekfile of donwloading and extracting Japanese zipcode database "KEN_ALL".
# -*- makefile -*-
# 2012/08/15
KEN_ALL_ZIP_URL = http://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip
usage:
@echo "Usage:"
@echo " make ken_all.zip"
@echo " make KEN_ALL.CSV"
ken_all.zip:
if type curl >/dev/null 2>&1 ; then \
curl --output $@ $(KEN_ALL_ZIP_URL) ; \
elif tyep wget >/dev/null 2>&1 ; then \
wget -O $@ $(KEN_ALL_ZIP_URL) ; \
elif type fetch >/dev/null 2>&1 ; then \
fetch -o $@ $(KEN_ALL_ZIP_URL) ; \
else \
@echo "need wget or curl to download $@" ; \
fi
KEN_ALL.CSV: ken_all.zip
unzip $<
ls -l $@
@echo "$< access/modify time is updated now."
touch -a -m $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment