## Process this file with automake to produce Makefile.in ## Copyright (C) 2011 Samediggi ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . ####### Source file defs: ######## #! @var GT_ORTHOGRAPHIC_SRCS names of orthographic rule source files, should #! be one of: #! xfst, regex or twolc files GT_ORTHOGRAPHIC_SRCS=$(GT_ORTHOGRAPHIC_REGEX_SRCS) \ $(GT_ORTHOGRAPHIC_XFSCRIPT_SRCS) EXTRA_DIST=$(GT_ORTHOGRAPHIC_SRCS) ####### Automake targets: ######## # Define variable before using it: GIELLA_ORTH_TARGETS= # Generate the filter targets from the source filenames: if CAN_HFST GIELLA_ORTH_TARGETS+=$(patsubst %.xfscript,%.lookup.hfst,$(GT_ORTHOGRAPHIC_XFSCRIPT_SRCS)) GIELLA_ORTH_TARGETS+=$(patsubst %.xfscript,%.compose.hfst,$(GT_ORTHOGRAPHIC_XFSCRIPT_SRCS)) GIELLA_ORTH_TARGETS+=$(patsubst %.regex,%.lookup.hfst,$(GT_ORTHOGRAPHIC_REGEX_SRCS)) GIELLA_ORTH_TARGETS+=$(patsubst %.regex,%.compose.hfst,$(GT_ORTHOGRAPHIC_REGEX_SRCS)) endif if CAN_XFST GIELLA_ORTH_TARGETS+=$(patsubst %.xfscript,%.lookup.xfst,$(GT_ORTHOGRAPHIC_XFSCRIPT_SRCS)) GIELLA_ORTH_TARGETS+=$(patsubst %.xfscript,%.compose.xfst,$(GT_ORTHOGRAPHIC_XFSCRIPT_SRCS)) GIELLA_ORTH_TARGETS+=$(patsubst %.regex,%.lookup.xfst,$(GT_ORTHOGRAPHIC_REGEX_SRCS)) GIELLA_ORTH_TARGETS+=$(patsubst %.regex,%.compose.xfst,$(GT_ORTHOGRAPHIC_REGEX_SRCS)) endif if CAN_FOMA GIELLA_ORTH_TARGETS+=$(patsubst %.xfscript,%.lookup.foma,$(GT_ORTHOGRAPHIC_XFSCRIPT_SRCS)) GIELLA_ORTH_TARGETS+=$(patsubst %.xfscript,%.compose.foma,$(GT_ORTHOGRAPHIC_XFSCRIPT_SRCS)) GIELLA_ORTH_TARGETS+=$(patsubst %.regex,%.lookup.foma,$(GT_ORTHOGRAPHIC_REGEX_SRCS)) GIELLA_ORTH_TARGETS+=$(patsubst %.regex,%.compose.foma,$(GT_ORTHOGRAPHIC_REGEX_SRCS)) endif noinst_DATA=$(GIELLA_ORTH_TARGETS) ################################################################################ ########## We need special treatment of the downcase script because ########## ########## of incompatible treatment of empty strings between Xerox ########## ########## and Hfst. The following targets work around that. ########## ################################################################################ downcase-derived_proper-strings.xeroxscript: \ downcase-derived_proper-strings.xfscript $(AM_V_SED)sed 's/@IF_HFST@/#/g; s/HYPMINFLAG//g' $^ > $@ downcase-derived_proper-strings.fomascript: \ downcase-derived_proper-strings.xfscript $(AM_V_SED)sed 's/@IF_HFST@/#/g; s/HYPMINFLAG//g' $^ > $@ downcase-derived_proper-strings.hfstscript: \ downcase-derived_proper-strings.xfscript $(AM_V_SED)sed s/@IF_HFST@//g $^ > $@ ####### HFST build rules: ######## downcase-derived_proper-strings.hfst: \ downcase-derived_proper-strings.hfstscript $(AM_V_HXFST)printf "save stack $@\nquit\n" | cat $< - \ | $(HFST_XFST) -p $(MORE_VERBOSITY) $(HFST_FORMAT) ####### Xerox build rules: ####### downcase-derived_proper-strings.xfst: \ downcase-derived_proper-strings.xeroxscript $(AM_V_XFST)$(XFST) $(VERBOSITY) -l $< -e "save stack $@" -stop ####### Foma build rules: ####### downcase-derived_proper-strings.foma: \ downcase-derived_proper-strings.fomascript $(AM_V_FOMA)$(FOMA) $(VERBOSITY) -l $< -e "save stack $@" -s ################################################################################ ########## End of special build rules. ########## ################################################################################ ####### Copy source files from common location if not found locally: ####### %.regex: $(GIELLA_SHARED)/all_langs/src/orthography/%.regex $(AM_V_CP)cp $< $@ %.xfscript: $(GIELLA_SHARED)/all_langs/src/orthography/%.xfscript $(AM_V_CP)cp $< $@ ####### Other targets: ########### # The "clean" target: clean-local: -rm -f *.hfst *.xfst *.foma ########################################## # General build rules included from here:# include $(top_srcdir)/am-shared/regex-include.am include $(top_srcdir)/am-shared/xfscript-include.am include $(top_srcdir)/am-shared/lookup-include.am include $(top_srcdir)/am-shared/hfst-format-include.am include $(top_srcdir)/am-shared/silent_build-include.am # vim: set ft=automake: