set gb_PARTIALBUILD in CustomTargets
[LibreOffice.git] / i18npool / source / breakiterator / Makefile
blob9f1a6ce56481c503cd052879a2350f60a31e61ba
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
2 # Version: MPL 1.1 / GPLv3+ / LGPLv3+
4 # The contents of this file are subject to the Mozilla Public License Version
5 # 1.1 (the "License"); you may not use this file except in compliance with
6 # the License or as specified alternatively below. You may obtain a copy of
7 # the License at http://www.mozilla.org/MPL/
9 # Software distributed under the License is distributed on an "AS IS" basis,
10 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 # for the specific language governing rights and limitations under the
12 # License.
14 # The Initial Developer of the Original Code is
15 # Matúš Kukan <matus.kukan@gmail.com>
16 # Portions created by the Initial Developer are Copyright (C) 2011 the
17 # Initial Developer. All Rights Reserved.
19 # Major Contributor(s):
21 # For minor contributions see the git repository.
23 # Alternatively, the contents of this file may be used under the terms of
24 # either the GNU General Public License Version 3 or later (the "GPLv3+"), or
25 # the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
26 # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
27 # instead of those above.
29 all : OpenOffice_dat.c data/dict_ja.cxx data/dict_zh.cxx
31 gb_PARTIALBUILD:=T
32 include $(GBUILDDIR)/gbuild_simple.mk
34 data:
35 mkdir data
37 data/dict_%.cxx : data/dict_%_invis.cxx
38 sed 's/\tconst/\tSAL_DLLPUBLIC_EXPORT const/' $< > $@
40 data/dict_%_invis.cxx : $(realpath $(SRC_ROOT)/i18npool/source/breakiterator/data)/%.dic data
41 ifeq ($(OS_FOR_BUILD),WNT)
42 $(gb_Helper_execute)gendict `cygpath -m $<` $@
43 else
44 $(gb_Helper_execute)gendict $< $@
45 endif
47 ifeq ($(SYSTEM_GENBRK),)
48 GENBRK := $(gb_Helper_execute)genbrk
49 else
50 GENBRK := $(SYSTEM_GENBRK)
51 endif
53 ifeq ($(SYSTEM_GENCCODE),)
54 GENCCODE := $(gb_Helper_execute)genccode
55 else
56 GENCCODE := $(SYSTEM_GENCCODE)
57 endif
59 ifeq ($(SYSTEM_GENCMN),)
60 GENCMN := $(gb_Helper_execute)gencmn
61 else
62 GENCMN := $(SYSTEM_GENCMN)
63 endif
65 TEMPFILE := $(shell $(gb_MKTEMP))
66 BRKFILES := $(notdir $(subst .txt,.brk,$(wildcard $(SRC_ROOT)/i18npool/source/breakiterator/data/*.txt)))
68 # 'gencmn', 'genbrk' and 'genccode' are tools generated and delivered by icu project to process icu breakiterator rules.
69 # The output of gencmn generates warnings under Windows. We want to minimize the patches to external tools,
70 # so the output (OpenOffice_dat.c) is changed here to include a pragma to disable the warnings.
71 # Output of gencmn is redirected to OpenOffice_icu_tmp.c with the -t switch.
72 OpenOffice_dat.c : $(subst .brk,_brk.c,$(BRKFILES))
73 $(foreach brkfile,$(BRKFILES),$(shell echo $(brkfile) >> $(TEMPFILE)))
74 $(GENCMN) -n OpenOffice -t tmp -S -d ./ 0 $(TEMPFILE)
75 echo '#ifdef _MSC_VER' > $@
76 echo '#pragma warning( disable : 4229 4668 )' >> $@
77 echo '#endif' >> $@
78 cat $(subst _dat,_tmp,$@) >> $@
80 %_brk.c : %.brk
81 $(GENCCODE) -n OpenOffice -d ./ $<
83 %.brk : %.txt.p
84 $(GENBRK) -r $< -o $@
86 # fdo#31271 ")" reclassified in more recent ICU/Unicode Standards
87 %.txt.p : $(realpath $(SRC_ROOT)/i18npool/source/breakiterator/data)/%.txt
88 ifeq ($(ICU_RECLASSIFIED_CLOSE_PARENTHESIS),YES)
89 sed "s#\[:LineBreak = Close_Punctuation:\]#\[\[:LineBreak = Close_Punctuation:\] \[:LineBreak = Close_Parenthesis:\]\]#" $< > $@
90 else
91 cp $< $@
92 endif
94 .PHONY: all
95 # vim: set noet sw=4 ts=4: