## 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: ######## # set this to name of cg3 dependency rules GIELLA_GRAMMARCHECKER=grammarchecker.cg3 # set this to the filename of the file being used by voikkogc: GIELLA_GC_ZDISTRO=$(GTLANG2).zcheck # set this to the filename of the file being used by voikkogc: GIELLA_GC_SPELLER=$(GTLANG2).zhfst GIELLA_GC_TOKENISER=tokeniser-gramcheck-gt-desc.pmhfst GIELLA_GC_MWEDIS=mwe-dis.bin GIELLA_GC_DISAMBIGUATOR=disambiguator.bin GIELLA_GC_GRAMCHECKER=grammarchecker.bin GIELLA_GC_ANAL_SPELLER=acceptor.default.hfst GIELLA_GC_SPELLER_ERRMOD=errmodel.default.hfst GIELLA_GC_GENERATOR=generator-gt-norm.hfstol GIELLA_GC_ERRORS=errors.xml GIELLA_GC_PIPESPEC=pipespec.xml #! @var GIELLA_GRAMMARCHECKER source for rules of vislcg3 grammar checker EXTRA_DIST=$(GIELLA_GRAMMARCHECKER) \ $(GIELLA_GC_ERRORS) \ $(GIELLA_GC_PIPESPEC) ####### Automake targets: ######## if WANT_GRAMCHECK if CAN_VISLCG GIELLA_GC_ZIPFILES=$(GIELLA_GC_TOKENISER) \ $(GIELLA_GC_VALENCY) \ $(GIELLA_GC_MWEDIS) \ $(GIELLA_GC_DISAMBIGUATOR) \ $(GIELLA_GC_GRAMCHECKER) \ $(GIELLA_GC_ANAL_SPELLER) \ $(GIELLA_GC_SPELLER_ERRMOD) \ $(GIELLA_GC_GENERATOR) \ $(GIELLA_GC_ERRORS) \ $(GIELLA_GC_PIPESPEC) noinst_DATA=$(GIELLA_GC_SPELLER) voikkosharedir=$(libdir)/voikko/4/ voikkoshare_DATA=$(GIELLA_GC_ZDISTRO) endif # CAN_VISLCG endif # WANT_GRAMCHECK ####### Build rules - locally and via include: ######## ZIPFLAGS=-j # Copy tokeniser: $(GIELLA_GC_TOKENISER): $(top_builddir)/tools/tokenisers/$(GIELLA_GC_TOKENISER) $(AM_V_CP)cp -f $< $@ # Copy valency if available: $(GIELLA_GC_VALENCY): $(top_builddir)/src/syntax/$(GIELLA_GC_VALENCY) $(AM_V_CP)cp -f $< $@ # Copy mwe-dis: mwe-dis.cg3: \ $(top_builddir)/tools/tokenisers/mwe-dis.cg3 $(AM_V_CP)cp -f $< $@ # Copy speller-analyser: $(GIELLA_GC_ANAL_SPELLER): \ ../spellcheckers/fstbased/desktop/analyser-desktopspeller-gt-norm.hfst \ filters/make-CG-tags.hfst $(AM_V_HXFST)$(PRINTF) "read regex \ @\"$<\" \ .o. @\"filters/make-CG-tags.hfst\".i \ ;\n\ save stack $@.tmp\n\ quit\n" | $(HFST_XFST) $(AM_V_FST2FST)$(HFST_FST2FST) $(HFST_FLAGS) -f olw -i $@.tmp -o $@ $(AM_V_at)rm -f $@.tmp # Copy speller-errormodel: $(GIELLA_GC_SPELLER_ERRMOD): \ ../spellcheckers/fstbased/desktop/hfst/errmodel.default.hfst $(AM_V_CP)cp -f $< $@ # Build analysing speller zhfst file, used for bash pipes (modes): $(GIELLA_GC_SPELLER): $(GIELLA_GC_ANAL_SPELLER) \ $(GIELLA_GC_SPELLER_ERRMOD) \ $(srcdir)/index.xml $(AM_V_at)rm -f $@ $(AM_V_ZIP)$(ZIP) $(ZIPFLAGS) $(MORE_VERBOSITY) $@ $^ # Copy disambiguator: done by other build rules # Fallback disambiguator rule: %.cg3: $(top_srcdir)/src/syntax/%.cg3 $(AM_V_CP)cp -f $< $@ # Copy grammarchecker: done by other build rules # Copy generator: $(GIELLA_GC_GENERATOR): $(top_builddir)/src/$(GIELLA_GC_GENERATOR) $(AM_V_CP)cp -f $< $@ # Finally build the zhfst file, and make a copy in a subdir named '4', so that # we can test it without installing it (the '4' dir is a voikko requirement): $(GIELLA_GC_ZDISTRO): $(GIELLA_GC_ZIPFILES) $(AM_V_at)rm -f $@ $(AM_V_ZIP)$(ZIP) $(ZIPFLAGS) $(MORE_VERBOSITY) $@ $^ # Additional developer tools: dev: modes/$(GTLANG)gram.mode checkxml schemas.xml modes/%.mode: $(srcdir)/modes.xml $(AM_V_at)$(MKDIR_P) modes apertium-gen-modes $< checkxml: divvun-validate-suggest $(srcdir)/errors.xml schemas.xml: divvun-gen-xmlschemas >$@ ### Clean target: clean-local: -rm -f *.bin schemas.xml *.zcheck *.hfst *.hfstol *.zip *.zhfst *.cg3 -rm -f $(GIELLA_GC_ZIPFILES) -rm -rf modes ### Include the following include $(top_srcdir)/am-shared/vislcg3-include.am include $(top_srcdir)/am-shared/silent_build-include.am # vim: set ft=automake: