## 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 . ####### Intermediate target file names: ######## # set this to the filename of the grammar checker archive: GIELLA_GC_ZDISTRO=$(GTLANG2).zcheck # set this to the filename of the speller archive: GIELLA_GC_SPELLER=$(GTLANG2).zhfst GIELLA_GC_MWEDIS=$(GIELLA_GC_MWEDIS_SRC:.cg3=.bin) GIELLA_GC_SPELLER_CG=$(GIELLA_GC_SPELLER_CG_SRC:.cg3=.bin) GIELLA_GC_GRAMCHECKER=$(GIELLA_GC_GRAMCHECKER_SRC:.cg3=.bin) GIELLA_GC_DISAMBIGUATOR=$(GIELLA_GC_DISAMBIGUATOR_SRC:.cg3=.bin) GIELLA_GC_WHSPACE_ANAL=$(GIELLA_GC_WHSPACE_ANAL_SRC:.regex=.hfst) GIELLA_GC_TOKENISER=tokeniser-gramcheck-gt-desc.pmhfst GIELLA_GC_ANAL_SPELLER=acceptor.default.hfst GIELLA_GC_SPELLER_ERRMOD=errmodel.default.hfst GIELLA_GC_GENERATOR=generator-gramcheck-gt-norm.hfstol GIELLA_GC_ERRORS=errors.xml GIELLA_GC_PIPESPEC=pipespec.xml #! @var GIELLA_GC_GRAMCHECKER_SRC source for rules of vislcg3 grammar checker GC_SRC_FILES=$(GIELLA_GC_MWEDIS_SRC) \ $(GIELLA_GC_SPELLER_CG_SRC) \ $(GIELLA_GC_DISAMBIGUATOR_SRC) \ $(GIELLA_GC_WHSPACE_ANAL_SRC) \ $(GIELLA_GC_GRAMCHECKER_SRC) \ $(GIELLA_GC_VALENCY) EXTRA_DIST=$(GC_SRC_FILES) \ $(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_SPELLER_CG) \ $(GIELLA_GC_GENERATOR) \ $(GIELLA_GC_ERRORS) \ $(GIELLA_GC_PIPESPEC) \ $(GIELLA_GC_WHSPACE_ANAL) \ $(LOCAL_GC_ZIP_FILES) noinst_DATA=$(GIELLA_GC_SPELLER) voikkosharedir=$(datadir)/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 $< $@ # Whitespace analysers: %.hfst: %.regex $(AM_V_RGX2FST)$(HFST_REGEXP2FST) --disjunct -i $< \ | $(HFST_FST2FST) -O -o $@ # Copy speller-analyser: $(GIELLA_GC_ANAL_SPELLER): \ ../spellcheckers/fstbased/desktop/analyser-desktopspeller-gt-norm.hfst \ filters/make-desktopspeller-CG-tags.hfst $(AM_V_HXFST)$(PRINTF) "read regex \ @\"$<\" \ .o. @\"filters/make-desktopspeller-CG-tags.hfst\".i \ ;\n\ save stack $@.tmp\n\ quit\n" | $(HFST_XFST) -p $(MORE_VERBOSITY) $(AM_V_FST2FST)$(HFST_PUSH_WEIGHTS) --push=initial -i $@.tmp \ | $(HFST_FST2FST) $(HFST_FLAGS) -f olw -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: disambiguator.cg3: $(top_srcdir)/src/syntax/disambiguator.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 $< $@ # Validate and copy the error messages: $(GIELLA_GC_ERRORS): $(srcdir)/errors.source.xml $(AM_V_GEN)divvun-validate-suggest $< $(AM_V_GEN)awk "{print} NR==1{print \"\"}" \ $< > $@ # 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 schemas.xml modes/%.mode: pipespec.xml $(AM_V_at)$(MKDIR_P) modes $(AM_V_GEN)divvun-gen-sh -d modes $< schemas.xml: divvun-gen-xmlschemas >$@ ### Clean target: clean-local: -rm -f *.bin schemas.xml *.zcheck *.hfst *.hfstol *.zip *.zhfst -rm -f mwe-dis.cg3 valency.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: