1*cdf0e10cSrcweir#*************************************************************************
2*cdf0e10cSrcweir#*
3*cdf0e10cSrcweir# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir#
5*cdf0e10cSrcweir# Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir#
7*cdf0e10cSrcweir# OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir#
9*cdf0e10cSrcweir# This file is part of OpenOffice.org.
10*cdf0e10cSrcweir#
11*cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir# only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir#
15*cdf0e10cSrcweir# OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir# but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir# GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir# (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir#
21*cdf0e10cSrcweir# You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir# version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir# <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir# for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir#
26*cdf0e10cSrcweir#************************************************************************/
27*cdf0e10cSrcweirPRJ=..$/..
28*cdf0e10cSrcweirPRJNAME=i18npool
29*cdf0e10cSrcweirTARGET=breakiterator
30*cdf0e10cSrcweir
31*cdf0e10cSrcweirTARGETTYPE=CUI
32*cdf0e10cSrcweirENABLE_EXCEPTIONS=TRUE
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir# --- Settings -----------------------------------------------------
35*cdf0e10cSrcweir
36*cdf0e10cSrcweir.INCLUDE :  settings.mk
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir# --- Files --------------------------------------------------------
39*cdf0e10cSrcweir
40*cdf0e10cSrcweir# grab all .txt files under data directory, which are breakiterator rule files.
41*cdf0e10cSrcweirMY_BRK_TXTFILES:=$(shell @ls data/*.txt)
42*cdf0e10cSrcweir
43*cdf0e10cSrcweir# insert "OpenOffice" as icu package name in front of the  name of each rule file for searching on application provided data
44*cdf0e10cSrcweirMY_BRK_BRKFILES:=$(subst,data/,$(MISC)$/ $(MY_BRK_TXTFILES:s/.txt/.brk/))
45*cdf0e10cSrcweir
46*cdf0e10cSrcweir# OpenOffice_dat.c is a generated file from the rule file list by gencmn
47*cdf0e10cSrcweirMY_MISC_CXXFILES := \
48*cdf0e10cSrcweir        $(MISC)$/OpenOffice_dat.c \
49*cdf0e10cSrcweir        $(MY_BRK_BRKFILES:s/.brk/_brk.c/)
50*cdf0e10cSrcweir
51*cdf0e10cSrcweirSLOFILES=   \
52*cdf0e10cSrcweir	    $(SLO)$/breakiteratorImpl.obj \
53*cdf0e10cSrcweir	    $(SLO)$/breakiterator_cjk.obj \
54*cdf0e10cSrcweir	    $(SLO)$/breakiterator_ctl.obj \
55*cdf0e10cSrcweir	    $(SLO)$/breakiterator_th.obj \
56*cdf0e10cSrcweir	    $(SLO)$/breakiterator_unicode.obj \
57*cdf0e10cSrcweir	    $(SLO)$/xdictionary.obj \
58*cdf0e10cSrcweir        $(subst,$(MISC)$/,$(SLO)$/ $(MY_MISC_CXXFILES:s/.c/.obj/))
59*cdf0e10cSrcweir
60*cdf0e10cSrcweirOBJFILES   = $(OBJ)$/gendict.obj
61*cdf0e10cSrcweir
62*cdf0e10cSrcweirAPP1TARGET = gendict
63*cdf0e10cSrcweirAPP1RPATH = NONE
64*cdf0e10cSrcweir
65*cdf0e10cSrcweirDEPOBJFILES   = $(OBJ)$/gendict.obj
66*cdf0e10cSrcweirAPP1OBJS   = $(DEPOBJFILES)
67*cdf0e10cSrcweir
68*cdf0e10cSrcweirAPP1STDLIBS = $(SALLIB)
69*cdf0e10cSrcweir
70*cdf0e10cSrcweir# --- Targets ------------------------------------------------------
71*cdf0e10cSrcweir
72*cdf0e10cSrcweir.IF "$(SYSTEM_ICU)" == "YES"
73*cdf0e10cSrcweirGENCMN:=$(SYSTEM_GENCMN)
74*cdf0e10cSrcweirGENBRK:=$(SYSTEM_GENBRK)
75*cdf0e10cSrcweirGENCCODE:=$(SYSTEM_GENCCODE)
76*cdf0e10cSrcweir.ELSE
77*cdf0e10cSrcweirGENCMN:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)$/gencmn
78*cdf0e10cSrcweirGENBRK:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)$/genbrk
79*cdf0e10cSrcweirGENCCODE:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)$/genccode
80*cdf0e10cSrcweir.ENDIF
81*cdf0e10cSrcweir
82*cdf0e10cSrcweir.INCLUDE .IGNORE :  icuversion.mk
83*cdf0e10cSrcweir
84*cdf0e10cSrcweir$(MISC)$/%.txt : data/%.txt
85*cdf0e10cSrcweir# fdo#31271 ")" reclassified in more recent ICU/Unicode Standards
86*cdf0e10cSrcweir.IF "$(ICU_MAJOR)" >= "5" || ("$(ICU_MAJOR)" == "4" && "$(ICU_MINOR)" >= "4")
87*cdf0e10cSrcweir    $(SED) "s#\[:LineBreak =  Close_Punctuation:\]#\[\[:LineBreak =  Close_Punctuation:\] \[:LineBreak = Close_Parenthesis:\]\]#" $< > $@
88*cdf0e10cSrcweir.ELSE
89*cdf0e10cSrcweir    $(COPY) $< $@
90*cdf0e10cSrcweir.ENDIF
91*cdf0e10cSrcweir
92*cdf0e10cSrcweir$(MISC)$/%.brk : $(MISC)/%.txt
93*cdf0e10cSrcweir    $(WRAPCMD) $(GENBRK) -r $< -o $(MISC)$/$*.brk
94*cdf0e10cSrcweir
95*cdf0e10cSrcweir$(MISC)$/%_brk.c : $(MISC)$/%.brk
96*cdf0e10cSrcweir    $(WRAPCMD) $(GENCCODE) -n OpenOffice -d $(MISC)$ $(MISC)$/$*.brk
97*cdf0e10cSrcweir
98*cdf0e10cSrcweir# 'gencmn', 'genbrk' and 'genccode' are tools generated and delivered by icu project to process icu breakiterator rules.
99*cdf0e10cSrcweir# The output of gencmn generates warnings under Windows. We want to minimize the patches to external tools,
100*cdf0e10cSrcweir# so the output (OpenOffice_icu_dat.c) is changed here to include a pragma to disable the warnings.
101*cdf0e10cSrcweir# Output of gencmn is redirected to OpenOffice_icu_tmp.c with the -t switch.
102*cdf0e10cSrcweir$(MISC)$/OpenOffice_%.c : $(MY_BRK_BRKFILES:s/.brk/_brk.c/)
103*cdf0e10cSrcweir    $(WRAPCMD) $(GENCMN) -n OpenOffice -t tmp -S -d $(MISC) O $(mktmp $(subst,$(MISC)$/, $(MY_BRK_BRKFILES:t"\n")))
104*cdf0e10cSrcweir    echo $(USQ)#ifdef _MSC_VER$(USQ) > $@
105*cdf0e10cSrcweir    echo $(USQ)#pragma warning( disable : 4229 4668 )$(USQ) >> $@
106*cdf0e10cSrcweir    echo $(USQ)#endif$(USQ) >> $@
107*cdf0e10cSrcweir    $(TYPE) $(@:s/_dat/_tmp/) >> $@
108*cdf0e10cSrcweir
109*cdf0e10cSrcweir.INCLUDE :	target.mk
110*cdf0e10cSrcweir
111