move out dictionary objet files from working directory
authorLaurent Mazet <mazet@softndesign.org>
Fri, 14 Aug 2020 12:06:49 +0000 (14:06 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Fri, 14 Aug 2020 12:06:49 +0000 (14:06 +0200)
.gitignore
dict-dists-extractor/Makefile

index 40a8c029ae43d8e838272b7375637007872c8035..ce3b8f669090bf0ce20af1e561d0c3b28e8952c5 100644 (file)
@@ -1,11 +1,5 @@
 /server/games.backup.json
 /public/config.js
+/public/dict/*.dict
 /public/l10n
 /.vscode
-/dict-dists-extractor/0index.html
-/dict-dists-extractor/src.mk
-/dict-dists-extractor/*.dir
-/dict-dists-extractor/*.low
-/dict-dists-extractor/*.tar.bz2
-/public/dict/*.dict
-
index eccee0504fa7462049c566a2dbf504de0be7f2c4..9f42ef441e43f628e7b675301c3480e6003dc526 100644 (file)
@@ -1,6 +1,8 @@
 # -*- Makefile -*-
 
 ROOT_DICT = ../public/dict
+#OBJ_DIR = .
+OBJ_DIR = /tmp/trivabble
 
 # 0MB < dictionary size < 10MB
 SMALL = br ca cy da de en es fr ga hr hu hy is lv nl no pt sv
@@ -20,7 +22,7 @@ LOWS = $(addsuffix .low,$(LANGS))
 DICTS = $(addsuffix .dict,$(LANGS))
 
 DEPEND = Makefile
-#MAKEFLAGS = -s
+MAKEFLAGS = -s
 
 all: required
        make $(addprefix check-,$(LANGS))
@@ -28,27 +30,31 @@ all: required
 $(ROOT_DICT):
        mkdir $(ROOT_DICT)
 
+$(OBJ_DIR):
+       mkdir $(OBJ_DIR)
+
 count:
        wc -l $(ROOT_DICT)/*
 
 low: $(LOWS)
 
-required: src.mk $(ROOT_DICT)
+required: $(OBJ_DIR) $(OBJ_DIR)/src.mk $(ROOT_DICT)
 
-src.mk:
+$(OBJ_DIR)/src.mk:
        echo Creation language table
        wget $(ASPDICT) -q -O - | \
        awk 'BEGIN { base="'`dirname $(ASPDICT)`'" } \
          /<tr><td><a/ { $$0 = gensub(/.*"(.+)".*"(.+)\/(.+)".*/, "\\1 \\2 \\3", "g"); \
-                        printf "%s.dir: %s\n\n", $$1, $$3; \
-                            printf "%s:\n", $$3; \
+                        printf "$(OBJ_DIR)/%s.dir: $(OBJ_DIR)/%s\n\n", $$1, $$3; \
+                            printf "$(OBJ_DIR)/%s:\n", $$3; \
                                         printf "\techo Downloading %s dictionary source\n", $$1; \
-                                        printf "\twget -q %s/%s/%s\n\n", base, $$2, $$3 } \
+                                        printf "\twget -q %s/%s/%s -O $$@\n\n", base, $$2, $$3 } \
          /<\/table>/ { exit }' > $@
 
-include $(wildcard src.mk)
+include $(wildcard $(OBJ_DIR)/src.mk)
 
-INSTALL_ASPELL_DICT = tar xjf $(1) && \
+INSTALL_ASPELL_DICT = cd $(OBJ_DIR) && \
+    tar xjf $(1) && \
     cd $(2) && \
        ./configure && \
        make
@@ -56,26 +62,26 @@ INSTALL_ASPELL_DICT = tar xjf $(1) && \
 ASPELL_DUMP_MASTER = aspell --dict-dir=$(2) -d $(1) dump master $(1) | \
     aspell --dict-dir=$(2) -l $(1) expand | \
     tr -s '[:space:]' '\n' | \
-    LC_ALL=C sort -S28G -u > $(1).low
+    LC_ALL=C sort -S28G -u > $(3)
 
 %.dir:
-       echo Installing $(@:.dir=) dictionary
+       echo Installing $@ dictionary
        $(call INSTALL_ASPELL_DICT,$<,$(<:.tar.bz2=))
        mv $(<:.tar.bz2=) $@
 
 %.low: %.dir
        echo Building list of word $@
-       $(call ASPELL_DUMP_MASTER,$(<:.dir=),./$<)
+       $(call ASPELL_DUMP_MASTER,$(patsubst $(OBJ_DIR)/%.dir,%,$<),$<,$@)
 
-no.low:
-       make nb.low
-       mv nb.low $@
+$(OBJ_DIR)/no.low:
+       make $(OBJ_DIR)/nb.low
+       mv $(OBJ_DIR)/nb.low $@
 
-pt.low:
-       make pt_PT.low
-       mv pt_PT.low $@
+$(OBJ_DIR)/pt.low:
+       make $(OBJ_DIR)/pt_PT.low
+       mv $(OBJ_DIR)/pt_PT.low $@
 
-$(ROOT_DICT)/ar.dict: ar.low $(DEPEND)
+$(ROOT_DICT)/ar.dict: $(OBJ_DIR)/ar.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -90,7 +96,7 @@ $(ROOT_DICT)/ar.dict: ar.low $(DEPEND)
         uniq > $@
 #   ا ل ن ش ا ش ي بِ ي ي   ب ا ل ن ش ا ش ي بِ ي ي   ب ن ش ا ش ي بِ ي ي   ف ا ل ن ش ا ش ي بِ ي ي   ف ب ا ل ن ش ا ش ي بِ ي ي   ف ب ن ش ا ش ي بِ ي ي   ف ك ا ل ن ش ا ش ي بِ ي ي   ف ك ن ش ا ش ي بِ ي ي   ف ل ل ن ش ا ش ي بِ ي ي   ف ل ن ش ا ش ي بِ ي ي   ف ن ش ا ش ي بِ ي ي   ك ا ل ن ش ا ش ي بِ ي ي   ك ن ش ا ش ي بِ ي ي   ل ل ن ش ا ش ي بِ ي ي   ل ن ش ا ش ي بِ ي ي   ن ش ا ش ي بِ ي ي   و ا ل ن ش ا ش ي بِ ي ي   و ب ا ل ن ش ا ش ي بِ ي ي   و ب ن ش ا ش ي بِ ي ي   و ك ا ل ن ش ا ش ي بِ ي ي   و ك ن ش ا ش ي بِ ي ي   و ل ل ن ش ا ش ي بِ ي ي   و ل ن ش ا ش ي بِ ي ي   و ن ش ا ش ي بِ ي ي 
 
-$(ROOT_DICT)/bg.dict: bg.low $(DEPEND)
+$(ROOT_DICT)/bg.dict: $(OBJ_DIR)/bg.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -100,7 +106,7 @@ $(ROOT_DICT)/bg.dict: bg.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/br.dict: br.low $(DEPEND)
+$(ROOT_DICT)/br.dict: $(OBJ_DIR)/br.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -117,7 +123,7 @@ $(ROOT_DICT)/br.dict: br.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/ca.dict: ca.low $(DEPEND)
+$(ROOT_DICT)/ca.dict: $(OBJ_DIR)/ca.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -133,7 +139,7 @@ $(ROOT_DICT)/ca.dict: ca.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/cs.dict: cs.low $(DEPEND)
+$(ROOT_DICT)/cs.dict: $(OBJ_DIR)/cs.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -155,7 +161,7 @@ $(ROOT_DICT)/cs.dict: cs.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/cy.dict: cy.low $(DEPEND)
+$(ROOT_DICT)/cy.dict: $(OBJ_DIR)/cy.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -172,7 +178,7 @@ $(ROOT_DICT)/cy.dict: cy.low $(DEPEND)
                sort | \
                uniq > $@
 
-$(ROOT_DICT)/da.dict: da.low $(DEPEND)
+$(ROOT_DICT)/da.dict: $(OBJ_DIR)/da.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -187,7 +193,7 @@ $(ROOT_DICT)/da.dict: da.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/de.dict: de.low $(DEPEND)
+$(ROOT_DICT)/de.dict: $(OBJ_DIR)/de.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -201,7 +207,7 @@ $(ROOT_DICT)/de.dict: de.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/el.dict: el.low $(DEPEND)
+$(ROOT_DICT)/el.dict: $(OBJ_DIR)/el.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -220,7 +226,7 @@ $(ROOT_DICT)/el.dict: el.low $(DEPEND)
                sort | \
                uniq > $@
 
-$(ROOT_DICT)/en.dict: en.low $(DEPEND)
+$(ROOT_DICT)/en.dict: $(OBJ_DIR)/en.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -236,7 +242,7 @@ $(ROOT_DICT)/en.dict: en.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/eo.dict: eo.low $(DEPEND)
+$(ROOT_DICT)/eo.dict: $(OBJ_DIR)/eo.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -245,7 +251,7 @@ $(ROOT_DICT)/eo.dict: eo.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/es.dict: es.low $(DEPEND)
+$(ROOT_DICT)/es.dict: $(OBJ_DIR)/es.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -259,7 +265,7 @@ $(ROOT_DICT)/es.dict: es.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/et.dict: et.low $(DEPEND)
+$(ROOT_DICT)/et.dict: $(OBJ_DIR)/et.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -268,7 +274,7 @@ $(ROOT_DICT)/et.dict: et.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/fi.dict: fi.low $(DEPEND)
+$(ROOT_DICT)/fi.dict: $(OBJ_DIR)/fi.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -277,7 +283,7 @@ $(ROOT_DICT)/fi.dict: fi.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/fr.dict: fr.low $(DEPEND)
+$(ROOT_DICT)/fr.dict: $(OBJ_DIR)/fr.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -292,7 +298,7 @@ $(ROOT_DICT)/fr.dict: fr.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/ga.dict: ga.low $(DEPEND)
+$(ROOT_DICT)/ga.dict: $(OBJ_DIR)/ga.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -307,7 +313,7 @@ $(ROOT_DICT)/ga.dict: ga.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/he.dict: he.low $(DEPEND)
+$(ROOT_DICT)/he.dict: $(OBJ_DIR)/he.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -315,7 +321,7 @@ $(ROOT_DICT)/he.dict: he.low $(DEPEND)
                sort | \
                uniq > $@
 
-$(ROOT_DICT)/hr.dict: hr.low $(DEPEND)
+$(ROOT_DICT)/hr.dict: $(OBJ_DIR)/hr.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -325,7 +331,7 @@ $(ROOT_DICT)/hr.dict: hr.low $(DEPEND)
                sort | \
                uniq > $@
 
-$(ROOT_DICT)/hu.dict: hu.low $(DEPEND)
+$(ROOT_DICT)/hu.dict: $(OBJ_DIR)/hu.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -335,7 +341,7 @@ $(ROOT_DICT)/hu.dict: hu.low $(DEPEND)
                uniq > $@
 
 #grep -v "['ԁԃԂԃ-]"
-$(ROOT_DICT)/hy.dict: hy.low $(DEPEND)
+$(ROOT_DICT)/hy.dict: $(OBJ_DIR)/hy.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -351,7 +357,7 @@ $(ROOT_DICT)/hy.dict: hy.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/it.dict: it.low $(DEPEND)
+$(ROOT_DICT)/it.dict: $(OBJ_DIR)/it.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -366,7 +372,7 @@ $(ROOT_DICT)/it.dict: it.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/is.dict: is.low $(DEPEND)
+$(ROOT_DICT)/is.dict: $(OBJ_DIR)/is.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -375,7 +381,7 @@ $(ROOT_DICT)/is.dict: is.low $(DEPEND)
                sort | \
                uniq > $@
 
-$(ROOT_DICT)/lv.dict: lv.low $(DEPEND)
+$(ROOT_DICT)/lv.dict: $(OBJ_DIR)/lv.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -384,7 +390,7 @@ $(ROOT_DICT)/lv.dict: lv.low $(DEPEND)
                sort | \
                uniq > $@
 
-$(ROOT_DICT)/nl.dict: nl.low $(DEPEND)
+$(ROOT_DICT)/nl.dict: $(OBJ_DIR)/nl.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -400,7 +406,7 @@ $(ROOT_DICT)/nl.dict: nl.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/no.dict: no.low $(DEPEND)
+$(ROOT_DICT)/no.dict: $(OBJ_DIR)/no.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -416,7 +422,7 @@ $(ROOT_DICT)/no.dict: no.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/pl.dict: pl.low $(DEPEND)
+$(ROOT_DICT)/pl.dict: $(OBJ_DIR)/pl.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -432,7 +438,7 @@ $(ROOT_DICT)/pl.dict: pl.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/pt.dict: pt.low $(DEPEND)
+$(ROOT_DICT)/pt.dict: $(OBJ_DIR)/pt.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -446,7 +452,7 @@ $(ROOT_DICT)/pt.dict: pt.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/ro.dict: ro.low $(DEPEND)
+$(ROOT_DICT)/ro.dict: $(OBJ_DIR)/ro.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -461,7 +467,7 @@ $(ROOT_DICT)/ro.dict: ro.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/ru.dict: ru.low $(DEPEND)
+$(ROOT_DICT)/ru.dict: $(OBJ_DIR)/ru.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -476,7 +482,7 @@ $(ROOT_DICT)/ru.dict: ru.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/sk.dict: sk.low $(DEPEND)
+$(ROOT_DICT)/sk.dict: $(OBJ_DIR)/sk.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -491,7 +497,7 @@ $(ROOT_DICT)/sk.dict: sk.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/sl.dict: sl.low $(DEPEND)
+$(ROOT_DICT)/sl.dict: $(OBJ_DIR)/sl.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -509,7 +515,7 @@ $(ROOT_DICT)/sl.dict: sl.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/sv.dict: sv.low $(DEPEND)
+$(ROOT_DICT)/sv.dict: $(OBJ_DIR)/sv.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \
@@ -522,7 +528,7 @@ $(ROOT_DICT)/sv.dict: sv.low $(DEPEND)
         sort | \
         uniq > $@
 
-$(ROOT_DICT)/uk.dict: uk.low $(DEPEND)
+$(ROOT_DICT)/uk.dict: $(OBJ_DIR)/uk.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \
         grep -v '^.$$' | \