* Use wget timestamping feature to decide, if download is necessary. master
authorUrban Wallasch <urban.wallasch@freenet.de>
Wed, 31 Mar 2021 09:55:56 +0000 (11:55 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Wed, 31 Mar 2021 09:55:56 +0000 (11:55 +0200)
Makefile

index da45a65e2d82aaf251d684c6a19de4e75150250d..c5203465d2495bc861e15cdb526517d80cbc3fab 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,24 @@
 
 TARGETS = edict enamdict kanjidic
 
 TARGETS = edict enamdict kanjidic
-#URL = http://ftp.monash.edu.au/pub/nihongo
 URL = http://ftp.edrdg.org/pub/Nihongo
 INSTDIR = /usr/share/gjiten/dics
 
 .PRECIOUS: %.gz
 
 URL = http://ftp.edrdg.org/pub/Nihongo
 INSTDIR = /usr/share/gjiten/dics
 
 .PRECIOUS: %.gz
 
-.PHONY: all clean distclean install
+.PHONY: all clean distclean install update
 
 all: $(TARGETS)
 
 
 all: $(TARGETS)
 
-%: %.gz
-       zcat $^ | recode EUC-JP..UTF-8 > $@
+.SECONDEXPANSION:
+
+$(TARGETS): $$@.gz
+       zcat $@.gz | recode EUC-JP..UTF-8 > $@
+
+%.gz: update
+       wget -N $(URL)/$@
+
+update:
 
 
-%.gz:
-       wget $(URL)/$@
 
 clean:
        -rm -fv $(TARGETS)
 
 clean:
        -rm -fv $(TARGETS)