1 # This Makefile creates German hyphenation patterns in subdirectories
2 # $(TRAD) and $(REFO) for traditional and new orthography, respectively.
3 # Hyphenation patterns for traditional Swiss German are generated in
6 # The input data is in $(SRCDIR); the possible targets are `pattern-trad',
7 # `pattern-refo', and `pattern-swiss'. If no target (or target `all') is
8 # given, all patterns for all three targets are built.
10 # SRCDIR (and the other variables) can be easily modified as parameters
11 # while calling `make', e.g.
13 # make pattern-trad SRCDIR=~/git/wortliste
15 # If you add the (phony) target `major', patterns which only use major
16 # hyphenation points (`Haupttrennstellen') are created. Example:
18 # make major pattern-refo
20 # The used directories names are the same as above but with `-major'
21 # appended to the names.
23 # To control the used weights in the major hyphenation patterns, add
24 # variable `W=N', where `N' gives the quality: value 1 specifies the best
25 # hyphenation points only, value 2 both the best and second-best points,
26 # etc. The default is value 0, using all major hyphenation points.
30 # Dieses Makefile erzeugt deutsche Trennmuster in den
31 # Unterverzeichnissen $(TRAD) und $(REFO) für die traditionelle
32 # bzw. reformierte Rechtschreibung. Trennmuster für tradionelles
33 # deutschschweizerisches Deutsch werden Verzeichnis $(SWISS) erzeugt.
35 # Die Eingabedaten werden im Verzeichnis $(SRCDIR) erwartet; die möglichen
36 # Make-Ziele sind `pattern-trad', `pattern-refo' und `pattern-swiss'. Wenn
37 # kein Ziel angegeben ist (oder man das Ziel `all' verwendet), werden alle
38 # drei Trennmuster erzeugt.
40 # SRCDIR (und die anderen Variablen) kann man leicht beim Aufruf von
41 # `make' als Parameter modifizieren, z.B.
43 # make pattern-trad SRCDIR=~/git/wortliste
45 # Wird zusätzlich das zusätzliche (künstliche) Ziel `major' angegeben,
46 # werden Haupttrennstellmuster erzeugt.
50 # make major pattern-refo
52 # Die verwendeten Verzeichnisnamen sind die gleichen wie oben, allerdings
53 # mit einem angehängten `-major'.
55 # Die Wichtung der verwendeten Haupttrennstellen kann mittels der Variable
56 # `W=N' kontrolliert werden, wo `N' die Qualität angibt: Wert 1 selektiert
57 # nur die besten Haupttrennstellen, Wert 2 die besten und zweitbesten
58 # Haupttrennstellen usw. Der Standardwert für `W' ist 0; er gibt an, dass
59 # alle Haupttrennstellen verwendet werden sollen.
65 DATADIR
= $(SRCDIR
)/daten
66 SCRIPTDIR
= $(SRCDIR
)/skripte
69 ifneq ($(findstring major
,$(MAKECMDGOALS
)),)
71 # A single `-' gets removed; all other combinations of `-', `<', `>',
72 # `=', and `|' are converted to a hyphen.
73 SEDMAJOR
= $(SED
) -e
'/[=|<>-]/!n' \
76 -e
's/[=|<>][=|<>]*/-/g' \
80 ifeq ($(words $(MAKECMDGOALS
)),1)
83 # This is to suppress the `nothing to be done' warning.
93 TRAD
= dehypht-x
$(MAJOR
)
94 REFO
= dehyphn-x
$(MAJOR
)
95 SWISS
= dehyphts-x
$(MAJOR
)
97 LC_ENVVARS
= LC_COLLATE
=de_DE.ISO8859-1 \
98 LC_CTYPE
=de_DE.ISO8859-1
103 DATE
= $(shell date
'+%Y-%m-%d')
106 ICONV
= iconv
-f latin1
-t utf-8
112 SORT
= $(LC_ENVVARS
) sort -d \
113 |
$(LC_ENVVARS
) uniq
-i
115 GIT_VERSION
:= `$(CHDIR) $(SRCDIR); \
116 $(GIT) log --format=%H -1 HEAD --`
117 TRADFILES
= $(TRAD
)/$(TRAD
)-$(DATE
).pat
$(TRAD
)/$(TRAD
)-$(DATE
).
tex
118 REFOFILES
= $(REFO
)/$(REFO
)-$(DATE
).pat
$(REFO
)/$(REFO
)-$(DATE
).
tex
119 SWISSFILES
= $(SWISS
)/$(SWISS
)-$(DATE
).pat
$(SWISS
)/$(SWISS
)-$(DATE
).
tex
122 override SRCDIR
:= $(shell cd
$(SRCDIR
); $(PWD
))
125 all: pattern-trad pattern-refo pattern-swiss
127 .PHONY
: pattern-trad pattern-refo pattern-swiss major
128 pattern-trad
: $(TRADFILES
)
129 pattern-refo
: $(REFOFILES
)
130 pattern-swiss
: $(SWISSFILES
)
134 .PHONY
: words-trad words-refo
135 words-trad
: $(TRAD
)/words.hyphenated.trad
136 words-refo
: $(REFO
)/words.hyphenated.refo
139 .PHONY
: pre-trad pre-refo pre-swiss
147 $(TRADFILES
) $(TRAD
)/words.hyphenated.trad
: pre-trad
148 $(REFOFILES
) $(REFO
)/words.hyphenated.refo
: pre-refo
149 $(SWISSFILES
) $(SWISS
)/words.hyphenated.swiss
: pre-swiss
152 # GNU make supports creation of multiple targets by a single
153 # invocation of a recipe only for pattern rules, thus we have
154 # to use a `sentinel file' (using `echo' for the time stamp).
157 $(TRAD
)/pattern
.8 $(TRAD
)/pattern.rules
: $(TRAD
)/make-full-pattern-trad
159 $(TRAD
)/make-full-pattern-trad
: $(TRAD
)/words.hyphenated.trad
161 $(SH
) $(SCRIPTDIR
)/make-full-pattern.sh
$(<F
) $(DATADIR
)/german.tr
164 $(TRAD
)/$(TRAD
)-$(DATE
).pat
: $(TRAD
)/pattern
.8 $(TRAD
)/pattern.rules
165 $(CAT
) $(DATADIR
)/$(TRAD
).1 \
166 |
$(SED
) -e
"s/@DATE@/$(DATE)/" \
167 -e
"s/@GIT_VERSION@/$(GIT_VERSION)/" > $@
; \
168 $(CAT
) $(TRAD
)/pattern.rules
>> $@
; \
169 $(CAT
) $(DATADIR
)/$(TRAD
).2 >> $@
; \
170 $(CAT
) $(TRAD
)/pattern
.8 \
172 $(CAT
) $(DATADIR
)/$(TRAD
).3 >> $@
175 $(REFO
)/pattern
.8 $(REFO
)/pattern.rules
: $(REFO
)/make-full-pattern-refo
177 $(REFO
)/make-full-pattern-refo
: $(REFO
)/words.hyphenated.refo
179 $(SH
) $(SCRIPTDIR
)/make-full-pattern.sh
$(<F
) $(DATADIR
)/german.tr
182 $(REFO
)/$(REFO
)-$(DATE
).pat
: $(REFO
)/pattern
.8 $(REFO
)/pattern.rules
183 $(CAT
) $(DATADIR
)/$(REFO
).1 \
184 |
$(SED
) -e
"s/@DATE@/$(DATE)/" \
185 -e
"s/@GIT_VERSION@/$(GIT_VERSION)/" > $@
; \
186 $(CAT
) $(REFO
)/pattern.rules
>> $@
; \
187 $(CAT
) $(DATADIR
)/$(REFO
).2 >> $@
; \
188 $(CAT
) $(REFO
)/pattern
.8 \
190 $(CAT
) $(DATADIR
)/$(REFO
).3 >> $@
193 $(SWISS
)/pattern
.8 $(SWISS
)/pattern.rules
: $(SWISS
)/make-full-pattern-swiss
195 $(SWISS
)/make-full-pattern-swiss
: $(SWISS
)/words.hyphenated.swiss
197 $(SH
) $(SCRIPTDIR
)/make-full-pattern.sh
$(<F
) $(DATADIR
)/german.tr
200 $(SWISS
)/$(SWISS
)-$(DATE
).pat
: $(SWISS
)/pattern
.8 $(SWISS
)/pattern.rules
201 $(CAT
) $(DATADIR
)/$(SWISS
).1 \
202 |
$(SED
) -e
"s/@DATE@/$(DATE)/" \
203 -e
"s/@GIT_VERSION@/$(GIT_VERSION)/" > $@
; \
204 $(CAT
) $(SWISS
)/pattern.rules
>> $@
; \
205 $(CAT
) $(DATADIR
)/$(SWISS
).2 >> $@
; \
206 $(CAT
) $(SWISS
)/pattern
.8 \
208 $(CAT
) $(DATADIR
)/$(SWISS
).3 >> $@
211 $(TRAD
)/words.hyphenated.trad
: $(SRCDIR
)/$(WORDLIST
)
213 |
$(PERL
) $(SCRIPTDIR
)/extract-tex.pl
-l
-t
$(PERLMAJOR
) \
217 $(REFO
)/words.hyphenated.refo
: $(SRCDIR
)/$(WORDLIST
)
219 |
$(PERL
) $(SCRIPTDIR
)/extract-tex.pl
-l
$(PERLMAJOR
) \
223 $(SWISS
)/words.hyphenated.swiss
: $(SRCDIR
)/$(WORDLIST
)
225 |
$(PERL
) $(SCRIPTDIR
)/extract-tex.pl
-l
-s
$(PERLMAJOR
) \
230 $(TRAD
)/$(TRAD
)-$(DATE
).
tex: $(DATADIR
)/$(TRAD
).
tex.in
232 |
$(SED
) -e
"s/@DATE@/$(DATE)/" > $@
234 $(REFO
)/$(REFO
)-$(DATE
).
tex: $(DATADIR
)/$(REFO
).
tex.in
236 |
$(SED
) -e
"s/@DATE@/$(DATE)/" > $@
238 $(SWISS
)/$(SWISS
)-$(DATE
).
tex: $(DATADIR
)/$(SWISS
).
tex.in
240 |
$(SED
) -e
"s/@DATE@/$(DATE)/" > $@