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.
25 # Dieses Makefile erzeugt deutsche Trennmuster in den
26 # Unterverzeichnissen $(TRAD) und $(REFO) für die traditionelle
27 # bzw. reformierte Rechtschreibung. Trennmuster für tradionelles
28 # deutschschweizerisches Deutsch werden Verzeichnis $(SWISS) erzeugt.
30 # Die Eingabedaten werden im Verzeichnis $(SRCDIR) erwartet; die möglichen
31 # Make-Ziele sind `pattern-trad', `pattern-refo' und `pattern-swiss'. Wenn
32 # kein Ziel angegeben ist (oder man das Ziel `all' verwendet), werden alle
33 # drei Trennmuster erzeugt.
35 # SRCDIR (und die anderen Variablen) kann man leicht beim Aufruf von
36 # `make' als Parameter modifizieren, z.B.
38 # make pattern-trad SRCDIR=~/git/wortliste
40 # Wird zusätzlich das zusätzliche (künstliche) Ziel `major' angegeben,
41 # werden Haupttrennstellmuster erzeugt.
45 # make major pattern-refo
47 # Die verwendeten Verzeichnisnamen sind die gleichen wie oben,
48 # allerdings mit einem angehängten `-major'.
52 DATADIR
= $(SRCDIR
)/daten
53 SCRIPTDIR
= $(SRCDIR
)/skripte
56 ifneq ($(findstring major
,$(MAKECMDGOALS
)),)
58 # A single `-' gets removed; all other combinations of `-', `=', and `|'
59 # are converted to a hyphen.
60 SEDMAJOR
= $(SED
) -e
'/[=|-]/!n' \
63 -e
's/[=|][=|]*/-/g' \
67 ifeq ($(words $(MAKECMDGOALS
)),1)
70 # This is to suppress the `nothing to be done' warning.
80 TRAD
= dehypht-x
$(MAJOR
)
81 REFO
= dehyphn-x
$(MAJOR
)
82 SWISS
= dehyphts-x
$(MAJOR
)
84 LC_ENVVARS
= LC_COLLATE
=de_DE.ISO8859-1 \
85 LC_CTYPE
=de_DE.ISO8859-1
90 DATE
= $(shell date
'+%Y-%m-%d')
93 ICONV
= iconv
-f latin1
-t utf-8
99 SORT
= $(LC_ENVVARS
) sort -d \
100 |
$(LC_ENVVARS
) uniq
-i
102 GIT_VERSION
:= `$(CHDIR) $(SRCDIR); \
103 $(GIT) log --format=%H -1 HEAD --`
104 TRADFILES
= $(TRAD
)/$(TRAD
)-$(DATE
).pat
$(TRAD
)/$(TRAD
)-$(DATE
).
tex
105 REFOFILES
= $(REFO
)/$(REFO
)-$(DATE
).pat
$(REFO
)/$(REFO
)-$(DATE
).
tex
106 SWISSFILES
= $(SWISS
)/$(SWISS
)-$(DATE
).pat
$(SWISS
)/$(SWISS
)-$(DATE
).
tex
109 override SRCDIR
:= $(shell cd
$(SRCDIR
); $(PWD
))
112 all: pattern-trad pattern-refo pattern-swiss
114 .PHONY
: pattern-trad pattern-refo pattern-swiss major
115 pattern-trad
: $(TRADFILES
)
116 pattern-refo
: $(REFOFILES
)
117 pattern-swiss
: $(SWISSFILES
)
121 .PHONY
: words-trad words-refo
122 words-trad
: $(TRAD
)/words.hyphenated.trad
123 words-refo
: $(REFO
)/words.hyphenated.refo
126 .PHONY
: pre-trad pre-refo pre-swiss
134 $(TRADFILES
) $(TRAD
)/words.hyphenated.trad
: pre-trad
135 $(REFOFILES
) $(REFO
)/words.hyphenated.refo
: pre-refo
136 $(SWISSFILES
) $(SWISS
)/words.hyphenated.swiss
: pre-swiss
139 # GNU make supports creation of multiple targets by a single
140 # invocation of a recipe only for pattern rules, thus we have
141 # to use a `sentinel file' (using `echo' for the time stamp).
144 $(TRAD
)/pattern
.8 $(TRAD
)/pattern.rules
: $(TRAD
)/make-full-pattern-trad
146 $(TRAD
)/make-full-pattern-trad
: $(TRAD
)/words.hyphenated.trad
148 $(SH
) $(SCRIPTDIR
)/make-full-pattern.sh
$(<F
) $(DATADIR
)/german.tr
151 $(TRAD
)/$(TRAD
)-$(DATE
).pat
: $(TRAD
)/pattern
.8 $(TRAD
)/pattern.rules
152 $(CAT
) $(DATADIR
)/$(TRAD
).1 \
153 |
$(SED
) -e
"s/@DATE@/$(DATE)/" \
154 -e
"s/@GIT_VERSION@/$(GIT_VERSION)/" > $@
; \
155 $(CAT
) $(TRAD
)/pattern.rules
>> $@
; \
156 $(CAT
) $(DATADIR
)/$(TRAD
).2 >> $@
; \
157 $(CAT
) $(TRAD
)/pattern
.8 \
159 $(CAT
) $(DATADIR
)/$(TRAD
).3 >> $@
162 $(REFO
)/pattern
.8 $(REFO
)/pattern.rules
: $(REFO
)/make-full-pattern-refo
164 $(REFO
)/make-full-pattern-refo
: $(REFO
)/words.hyphenated.refo
166 $(SH
) $(SCRIPTDIR
)/make-full-pattern.sh
$(<F
) $(DATADIR
)/german.tr
169 $(REFO
)/$(REFO
)-$(DATE
).pat
: $(REFO
)/pattern
.8 $(REFO
)/pattern.rules
170 $(CAT
) $(DATADIR
)/$(REFO
).1 \
171 |
$(SED
) -e
"s/@DATE@/$(DATE)/" \
172 -e
"s/@GIT_VERSION@/$(GIT_VERSION)/" > $@
; \
173 $(CAT
) $(REFO
)/pattern.rules
>> $@
; \
174 $(CAT
) $(DATADIR
)/$(REFO
).2 >> $@
; \
175 $(CAT
) $(REFO
)/pattern
.8 \
177 $(CAT
) $(DATADIR
)/$(REFO
).3 >> $@
180 $(SWISS
)/pattern
.8 $(SWISS
)/pattern.rules
: $(SWISS
)/make-full-pattern-swiss
182 $(SWISS
)/make-full-pattern-swiss
: $(SWISS
)/words.hyphenated.swiss
184 $(SH
) $(SCRIPTDIR
)/make-full-pattern.sh
$(<F
) $(DATADIR
)/german.tr
187 $(SWISS
)/$(SWISS
)-$(DATE
).pat
: $(SWISS
)/pattern
.8 $(SWISS
)/pattern.rules
188 $(CAT
) $(DATADIR
)/$(SWISS
).1 \
189 |
$(SED
) -e
"s/@DATE@/$(DATE)/" \
190 -e
"s/@GIT_VERSION@/$(GIT_VERSION)/" > $@
; \
191 $(CAT
) $(SWISS
)/pattern.rules
>> $@
; \
192 $(CAT
) $(DATADIR
)/$(SWISS
).2 >> $@
; \
193 $(CAT
) $(SWISS
)/pattern
.8 \
195 $(CAT
) $(DATADIR
)/$(SWISS
).3 >> $@
198 $(TRAD
)/words.hyphenated.trad
: $(SRCDIR
)/$(WORDLIST
)
200 |
$(PERL
) $(SCRIPTDIR
)/extract-tex.pl
-l
-t
$(PERLMAJOR
) \
204 $(REFO
)/words.hyphenated.refo
: $(SRCDIR
)/$(WORDLIST
)
206 |
$(PERL
) $(SCRIPTDIR
)/extract-tex.pl
-l
$(PERLMAJOR
) \
210 $(SWISS
)/words.hyphenated.swiss
: $(SRCDIR
)/$(WORDLIST
)
212 |
$(PERL
) $(SCRIPTDIR
)/extract-tex.pl
-l
-s
$(PERLMAJOR
) \
217 $(TRAD
)/$(TRAD
)-$(DATE
).
tex: $(DATADIR
)/$(TRAD
).
tex.in
219 |
$(SED
) -e
"s/@DATE@/$(DATE)/" > $@
221 $(REFO
)/$(REFO
)-$(DATE
).
tex: $(DATADIR
)/$(REFO
).
tex.in
223 |
$(SED
) -e
"s/@DATE@/$(DATE)/" > $@
225 $(SWISS
)/$(SWISS
)-$(DATE
).
tex: $(DATADIR
)/$(SWISS
).
tex.in
227 |
$(SED
) -e
"s/@DATE@/$(DATE)/" > $@