• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# directories
2top_srcdir = ../..
3srcdir = .
4
5# programs
6PATGEN = patgen
7AWK = awk
8SED = sed
9RMF = rm -f
10
11# main target
12all: hyph-th.tex
13
14TDICT_SRC = 					\
15	$(srcdir)/tdict-common.txt		\
16	$(srcdir)/tdict-collection.txt		\
17	$(srcdir)/tdict-district.txt		\
18	$(srcdir)/tdict-city.txt		\
19	$(srcdir)/tdict-country.txt		\
20	$(srcdir)/tdict-geo.txt			\
21	$(srcdir)/tdict-history.txt		\
22	$(srcdir)/tdict-ict.txt			\
23	$(srcdir)/tdict-lang-ethnic.txt		\
24	$(srcdir)/tdict-proper.txt		\
25	$(srcdir)/tdict-science.txt		\
26	$(srcdir)/tdict-slang.txt		\
27	$(srcdir)/tdict-spell.txt		\
28	$(srcdir)/tdict-std.txt			\
29	$(srcdir)/tdict-std-compound.txt	\
30	$(NULL)
31
32PATGEN_ANS = \
331 5 \n\
342 5 \n\
351 2 10 \n\
361 6 \n\
372 1 8 \n\
383 8 \n\
391 4 5 \n\
403 10 \n\
413 2 1 \n\
424 11 \n\
431 10 1 \n\
44y
45
46thai.dic:  $(TDICT_SRC)
47	cat $(TDICT_SRC) | LC_ALL=C sort -u > $@
48
49thai.out: thai.dic thai.tra
50	rm -f thai.pat
51	touch thai.pat
52	printf "$(PATGEN_ANS)" \
53	  | $(PATGEN) thai.dic thai.pat thai.out $(srcdir)/thai.tra
54
55thai-comb.pat: thai.out thai-exc.pat
56	cat thai.out $(srcdir)/thai-exc.pat > $@
57
58hyph-th.tex: thai-comb.pat hyph-th.tex.in
59	$(AWK) "BEGIN {show=1} /@PATTERNS@/ {show=0} {if(show) print}" \
60	  $(srcdir)/hyph-th.tex.in > $@
61	cat thai-comb.pat >> $@
62	$(AWK) "BEGIN {show=0;pat=0} /@PATTERNS@/ {pat=1} {if(show) print; if(pat) show=1}" \
63	  $(srcdir)/hyph-th.tex.in >> $@
64
65CLEANFILES = \
66	thai.dic thai.pat pattmp.* thai.out thai-comb.pat hyph-th.tex \
67	hyphres.dic hyphtest.* hyph.diff
68
69clean:
70	$(RMF) $(CLEANFILES)
71
72