bin_PROGRAMS = tokenizer putzer htmlEnt2Char
tokenizer_SOURCES = tokenizer.c Tokenizer.h TokenizerLexer.h TokenizerLang.h LC_ISOlatin1.h LC_ISOcyrillic5.h LC_cp1252.h LC_cp1251.h LC_ascii.h $(tokenizer_AUTOGENERATED_SOURCES)
tokenizer_AUTOGENERATED_SOURCES = TokenizeDeL1.l TokenizeDeWin.l TokenizeDeU8.l TokenizeEnL1.l TokenizeEnWin.l TokenizeEnU8.l TokenizeRuI5.l TokenizeRuWin.l TokenizeRuU8.l
tokenizer_EXTRA_SOURCES = TokenizeDe.l TokenizeEn.l TokenizeRu.l torture_de_l1.txt LIESMICH
putzer_SOURCES = putzer.l
htmlEnt2Char_SOURCES = htmlEnt2Char.l
EXTRA_DIST = $(tokenizer_EXTRA_SOURCES)
PERL = perl
ICONV = iconv
putzer: putzer.c
putzer.c: $(putzer_SOURCES)
$(LEX) -t $< > $@
htmlEnt2Char: htmlEnt2Char.c
htmlEnt2Char.c: $(htmlEnt2Char_SOURCES)
$(LEX) -t $< > $@
tokenizer_LANGSPEC_LEXERS_O = $(patsubst %.l,%.o,$(tokenizer_AUTOGENERATED_SOURCES))
tokenizer_LANGSPEC_LEXERS_C = $(patsubst %.l,%.c,$(tokenizer_AUTOGENERATED_SOURCES))
tokenizer: tokenizer.o Tokenizer.h TokenizerLang.h $(tokenizer_LANGSPEC_LEXERS_O)
$(CC) $(CFLAGS) $(filter %.o, $^) $(LEXLIB) -o tokenizer
tokenizer.o: config.h tokenizer.c Tokenizer.h TokenizerLang.h LC_ISOlatin1.h LC_ISOcyrillic5.h LC_cp1252.h LC_cp1251.h LC_ascii.h
$(tokenizer_LANGSPEC_LEXERS_O): %.o: %.c Tokenizer.h TokenizerLexer.h
$(CC) $(CFLAGS) -c -o $*.o $*.c
$(tokenizer_LANGSPEC_LEXERS_C): %.c: %.l
$(LEX) -Pyy$(subst Tokenize,,$*) -t $*.l > $*.c
%L1.l: %.l
- $(PERL) -ne 'chomp; if (s@\s*/\* ####filter: (.+)#### \*/\s*@@) {print $$_, "\n" if ($$1 eq "iso-8859-1")} else {print $$_, "\n"}' $^ | $(ICONV) -c -f UTF-8 -t iso-8859-1 > $@
%RuWin.l: %Ru.l
- $(PERL) -ne 'chomp; if (s@\s*/\* ####filter: (.+)#### \*/\s*@@) {print $$_, "\n" if ($$1 eq "cp1251")} else {print $$_, "\n"}' $^ | $(ICONV) -c -f UTF-8 -t cp1251 > $@
%Win.l: %.l
- $(PERL) -ne 'chomp; if (s@\s*/\* ####filter: (.+)#### \*/\s*@@) {print $$_, "\n" if ($$1 eq "cp1252")} else {print $$_, "\n"}' $^ | $(ICONV) -c -f UTF-8 -t cp1252 > $@
%RuI5.l: %Ru.l
- $(PERL) -ne 'chomp; if (s@\s*/\* ####filter: (.+)#### \*/\s*@@) {print $$_, "\n" if ($$1 eq "iso-8859-5")} else {print $$_, "\n"}' $^ | $(ICONV) -c -f UTF-8 -t iso-8859-5 > $@
%U8.l: %.l
- $(PERL) -CDS -Mutf8 -ne 'chomp; if (s@\s*/\* ####filter: (.+)#### \*/\s*@@) { print $$_, "\n" if ($$1 eq "utf-8")} else { print $$_, "\n" } ' $^ > $@