turn gb_CustomTarget_get_workdir into error and remove old _repo_targets
[LibreOffice.git] / i18npool / CustomTarget_breakiterator.mk
blob177966f7952df775fe039625122e985d15ca407e
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(eval $(call gb_CustomTarget_CustomTarget,i18npool/breakiterator))
12 i18npool_BIDIR := $(gb_CustomTarget_workdir)/i18npool/breakiterator
14 $(call gb_CustomTarget_get_target,i18npool/breakiterator) : \
15 $(i18npool_BIDIR)/OpenOffice_dat.c
17 i18npool_BRKTXTS := \
18 count_word.brk \
19 $(call gb_Helper_optional_locale,he,dict_word_he.brk) \
20 $(call gb_Helper_optional_locale,hu,dict_word_hu.brk) \
21 dict_word_nodash.brk \
22 dict_word_prepostdash.brk \
23 dict_word.brk \
24 $(call gb_Helper_optional_locale,he,edit_word_he.brk) \
25 $(call gb_Helper_optional_locale,hu,edit_word_hu.brk) \
26 edit_word.brk \
27 line.brk \
28 sent.brk
30 # 'gencmn', 'genbrk' and 'genccode' are tools generated and delivered by icu project to process icu breakiterator rules.
31 # The output of gencmn generates warnings under Windows. We want to minimize the patches to external tools,
32 # so the output (OpenOffice_dat.c) is changed here to include a pragma to disable the warnings.
33 # Output of gencmn is redirected to OpenOffice_tmp.c with the -t switch.
34 $(i18npool_BIDIR)/OpenOffice_dat.c : $(SRCDIR)/i18npool/CustomTarget_breakiterator.mk \
35 $(patsubst %.brk,$(i18npool_BIDIR)/%_brk.c,$(i18npool_BRKTXTS)) \
36 $(call gb_ExternalExecutable_get_dependencies,gencmn)
37 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CMN,1)
38 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),CMN)
39 $(call gb_Helper_abbreviate_dirs,\
40 RESPONSEFILE=$(shell $(gb_MKTEMP)) && \
41 $(foreach brk,$(i18npool_BRKTXTS),echo '$(brk)' >> $${RESPONSEFILE} && ) \
42 $(call gb_ExternalExecutable_get_command,gencmn) -n OpenOffice -t tmp -S -d $(i18npool_BIDIR)/ 0 $${RESPONSEFILE} && \
43 rm -f $${RESPONSEFILE} && \
44 echo '#ifdef _MSC_VER' > $@ && \
45 echo '#pragma warning( disable : 4229 )' >> $@ && \
46 echo '#endif' >> $@ && \
47 cat $(subst _dat,_tmp,$@) >> $@)
48 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),CMN)
50 $(i18npool_BIDIR)/%_brk.c : $(i18npool_BIDIR)/%.brk $(call gb_ExternalExecutable_get_dependencies,genccode)
51 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CCD,1)
52 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),CCD)
53 $(call gb_Helper_abbreviate_dirs,\
54 $(call gb_ExternalExecutable_get_command,genccode) -n OpenOffice -d $(i18npool_BIDIR)/ $< \
55 $(if $(findstring s,$(MAKEFLAGS)),> /dev/null))
56 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),CCD)
58 $(i18npool_BIDIR)/%.brk : $(SRCDIR)/i18npool/source/breakiterator/data/%.txt \
59 $(call gb_ExternalExecutable_get_dependencies,genbrk) \
60 | $(i18npool_BIDIR)/.dir
61 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),BRK,1)
62 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),BRK)
63 $(call gb_Helper_abbreviate_dirs,\
64 $(call gb_ExternalExecutable_get_command,genbrk) \
65 $(if $(SYSTEM_ICU),,-i $(call gb_UnpackedTarball_get_dir,icu)/source/data/out/tmp) \
66 -r $< -o $@ $(if $(findstring s,$(MAKEFLAGS)),> /dev/null))
67 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),BRK)
69 # vim: set noet sw=4 ts=4: