## 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 . ####### Automake targets: ######## # Make sure that targets are deleted when something breaks: .DELETE_ON_ERROR: ####### Source file defs: ######## #! @param GT_PHONOLOGY_MAIN required, the source of phonology #! @param GT_PHONOLOGY_SUPPLEMENTS optional, other sources to distribute and #! compile for other things #! Both @params are specified in $(GTLANG)/src/phonology/Makefile.am. # The source files are the sum of GT_PHONOLOGY_MAIN and GT_PHONOLOGY_SUPPLEMENTS GT_PHONOLOGY_SRCS=$(GT_PHONOLOGY_MAIN) $(GT_PHONOLOGY_SUPPLEMENTS) # All sources need to be included in the tarball EXTRA_DIST=$(GT_PHONOLOGY_SRCS) ####### Automake targets: ######## # The rule transducer(s) will be built, not installed GT_PHONOLOGY= if CAN_HFST if LEXREF_IN_PHONOLOGY GT_PHONOLOGY+=$(addsuffix .hfst.xfscript, $(basename $(GT_PHONOLOGY_SRCS))) else !LEXREF_IN_PHONOLOGY GT_PHONOLOGY+=$(addsuffix .compose.hfst, $(basename $(GT_PHONOLOGY_SRCS))) GT_PHONOLOGY+=$(addsuffix .lookup.hfst, $(basename $(GT_PHONOLOGY_SRCS))) if WANT_REVERSED_INTERSECT GT_PHONOLOGY+=$(addsuffix .rev.hfst, $(basename $(GT_PHONOLOGY_SRCS))) endif # WANT_REVERSED_INTERSECT endif !LEXREF_IN_PHONOLOGY endif # CAN_HFST if CAN_XFST if LEXREF_IN_PHONOLOGY GT_PHONOLOGY+=$(addsuffix .xfst.xfscript, $(basename $(GT_PHONOLOGY_SRCS))) else !LEXREF_IN_PHONOLOGY GT_PHONOLOGY+=$(addsuffix .compose.xfst, $(basename $(GT_PHONOLOGY_SRCS))) GT_PHONOLOGY+=$(addsuffix .lookup.xfst, $(basename $(GT_PHONOLOGY_SRCS))) endif !LEXREF_IN_PHONOLOGY endif # CAN_XFST if CAN_FOMA if LEXREF_IN_PHONOLOGY GT_PHONOLOGY+=$(addsuffix .foma.xfscript, $(basename $(GT_PHONOLOGY_SRCS))) else !LEXREF_IN_PHONOLOGY GT_PHONOLOGY+=$(addsuffix .compose.foma, $(basename $(GT_PHONOLOGY_SRCS))) GT_PHONOLOGY+=$(addsuffix .lookup.foma, $(basename $(GT_PHONOLOGY_SRCS))) endif !LEXREF_IN_PHONOLOGY endif # CAN_FOMA if WANT_L2 if CAN_HFST if LEXREF_IN_PHONOLOGY GT_PHONOLOGY+=$(GTLANG)-phon-L2.hfst.xfscript else !LEXREF_IN_PHONOLOGY GT_PHONOLOGY+=$(GTLANG)-phon-L2.compose.hfst GT_PHONOLOGY+=$(GTLANG)-phon-L2.lookup.hfst if WANT_REVERSED_INTERSECT GT_PHONOLOGY+=$(GTLANG)-phon-L2.rev.hfst endif # WANT_REVERSED_INTERSECT endif !LEXREF_IN_PHONOLOGY endif # CAN_HFST if CAN_XFST if LEXREF_IN_PHONOLOGY GT_PHONOLOGY+=$(GTLANG)-phon-L2.xfst.xfscript else !LEXREF_IN_PHONOLOGY GT_PHONOLOGY+=$(GTLANG)-phon-L2.compose.xfst GT_PHONOLOGY+=$(GTLANG)-phon-L2.lookup.xfst endif !LEXREF_IN_PHONOLOGY endif # CAN_XFST if CAN_FOMA if LEXREF_IN_PHONOLOGY GT_PHONOLOGY+=$(GTLANG)-phon-L2.foma.xfscript else !LEXREF_IN_PHONOLOGY GT_PHONOLOGY+=$(GTLANG)-phon-L2.compose.foma GT_PHONOLOGY+=$(GTLANG)-phon-L2.lookup.foma endif !LEXREF_IN_PHONOLOGY endif # CAN_FOMA endif # WANT_L2 # If SKIP_PHONOLOGY is defined, noinst_DATA is empty. This causes make to skip # everything. Cf configure.ac if SKIP_PHONOLOGY noinst_DATA= # Othersiwe: build as normal: else !SKIP_PHONOLOGY noinst_DATA=$(GT_PHONOLOGY) endif !SKIP_PHONOLOGY # Build instructions for the reversed rule file: %.rev.hfst: %.compose.hfst $(AM_V_at)rm -f $@ $(AM_V_HSPLIT)$(HFST_SPLIT) -p split $< $(AM_V_REVERSE)for i in split*.hfst; do $(HFST_REVERSE) $$i \ | $(HFST_MINIMIZE) >> $@ ; done $(AM_V_at)rm -f split*.hfst # Build instruction for the xfscript with lexicon ref: define giella_phon_w_lex_ref %.$(1).xfscript: %.xfscript $$(AM_V_GEN)sed 's/&FST&/$(1)/' $$< > $$@ endef $(foreach fst,hfst xfst foma,$(eval $(call giella_phon_w_lex_ref,$(fst)))) ####### Other targets: ########### clean-local: -rm -f *.hfst *.xfst *.foma ########################################## # General build rules included from here:# include $(top_srcdir)/am-shared/twolc-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: