summaryrefslogtreecommitdiff
path: root/sw/CustomTarget_generated.mk
diff options
context:
space:
mode:
authorDaniel Sikeler <d.sikeler94@gmail.com>2014-11-10 12:23:12 +0000
committerMatúš Kukan <matus.kukan@collabora.com>2014-12-10 19:35:29 +0100
commitc2c0989794d5a4724da8b8880559764bffd059ec (patch)
tree72ec385406e8ba2a57a102b3f7a455e476f68ef1 /sw/CustomTarget_generated.mk
parent55dc40bc85fa5f5b1491d4788eaee0fba415d017 (diff)
fdo#80403: Writer specific AutoCorr use FastParser
Contextclasses implement XFastContextHandler Importclasses implement XFastDocumentHandler Tokens for BlockList.xml are defined in BlockListTokens.txt Tokens for content.xml are defined in TextBlockTokens.txt A perfect hash table is generated with gperf and used by the tokenhandlers This is corrected version of c1e90457d2ecc6e1171b7a296ab8bd05821e39e6 (Also pushing again follow-up c940d4d30673dc02ea34b5e60a4a8140648a0dba "loplugin:saloverride" and 5f0f3d4e91e9eb1d1f60b0cd073e7bbd8ea38c29 "Work around -Werror,-Wdeprecated-register") The commits were reverted in 7ef4457b9fc06b5c25c607d7e0149f45c7015b10 Change-Id: I08cd852fa751f98fd0ac6a55dda22f82a869b4d8
Diffstat (limited to 'sw/CustomTarget_generated.mk')
-rw-r--r--sw/CustomTarget_generated.mk34
1 files changed, 34 insertions, 0 deletions
diff --git a/sw/CustomTarget_generated.mk b/sw/CustomTarget_generated.mk
new file mode 100644
index 000000000000..f8244d2d65dd
--- /dev/null
+++ b/sw/CustomTarget_generated.mk
@@ -0,0 +1,34 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CustomTarget_CustomTarget,sw/generated))
+
+sw_SRC := $(SRCDIR)/sw/source/core/swg
+sw_PL := $(SRCDIR)/solenv/bin/gentoken.pl
+sw_INC := $(call gb_CustomTarget_get_workdir,sw/generated)
+
+$(sw_INC)/TextBlockTokens.gperf : $(sw_SRC)/TextBlockTokens.txt $(sw_PL)
+ mkdir -p $(sw_INC)
+ $(PERL) $(sw_PL) $(sw_SRC)/TextBlockTokens.txt $(sw_INC)/TextBlockTokens.gperf
+
+$(sw_INC)/BlockListTokens.gperf : $(sw_SRC)/BlockListTokens.txt $(sw_PL)
+ mkdir -p $(sw_INC)
+ $(PERL) $(sw_PL) $(sw_SRC)/BlockListTokens.txt $(sw_INC)/BlockListTokens.gperf
+
+$(sw_INC)/tokens.cxx : $(sw_INC)/TextBlockTokens.gperf $(sw_INC)/BlockListTokens.gperf
+ $(GPERF) --compare-strncmp --readonly-tables --output-file=$(sw_INC)/tokens.cxx \
+ --class-name=TextBlockTokens --word-array-name=textBlockList --enum $(sw_INC)/TextBlockTokens.gperf
+ $(GPERF) --compare-strncmp --readonly-tables -T $(sw_INC)/BlockListTokens.gperf \
+ --class-name=BlockListTokens --word-array-name=blockListList >> $(sw_INC)/tokens.cxx
+ sed -i -e "s/(char\*)0/(char\*)0, XML_TOKEN_INVALID/g" $(sw_INC)/tokens.cxx
+ sed -i -e "/^#line/d" $(sw_INC)/tokens.cxx
+
+$(call gb_CustomTarget_get_target,sw/generated) : $(sw_INC)/tokens.cxx
+
+# vim: set noet sw=4 ts=4: