xref: /AOO41X/main/writerfilter/source/ooxml/makefile.mk (revision 47148b3bc50811ceb41802e4cc50a5db21535900)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21PRJ=..$/..
22PRJNAME=writerfilter
23TARGET=ooxml
24#LIBTARGET=NO
25#USE_DEFFILE=TRUE
26ENABLE_EXCEPTIONS=TRUE
27
28# --- Settings -----------------------------------------------------
29
30.INCLUDE :  settings.mk
31.INCLUDE :  $(PRJ)$/inc$/writerfilter.mk
32
33#CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501
34#CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820
35
36NAMESPACES= \
37    wml \
38    dml-stylesheet \
39    dml-styleDefaults \
40    dml-shape3DLighting \
41    dml-shape3DScene \
42    dml-shape3DStyles \
43    dml-shape3DCamera \
44    dml-baseStylesheet \
45    dml-textCharacter \
46    dml-shapeEffects \
47    dml-shapeLineProperties \
48    dml-shapeProperties \
49    dml-baseTypes \
50    dml-documentProperties \
51    dml-graphicalObject \
52    dml-shapeGeometry \
53    dml-wordprocessingDrawing \
54    sml-customXmlMappings \
55    shared-math \
56    shared-relationshipReference \
57    dml-chartDrawing \
58    vml-main \
59    vml-officeDrawing \
60    vml-wordprocessingDrawing
61
62# --- Files --------------------------------------------------------
63
64SLOFACTORIESNAMESPACES= \
65    $(SLO)$/OOXMLFactory_{$(NAMESPACES)}.obj
66
67SLOFILES= \
68    $(SLOFACTORIESNAMESPACES) \
69    $(SLOFASTNAMESPACES) \
70    $(SLO)$/OOXMLFactory_generated.obj \
71    $(SLO)$/OOXMLFactory.obj \
72    $(SLO)$/OOXMLBinaryObjectReference.obj\
73    $(SLO)$/OOXMLFactory_values.obj \
74    $(SLO)$/OOXMLPropertySetImpl.obj \
75    $(SLO)$/OOXMLParserState.obj \
76    $(SLO)$/Handler.obj \
77    $(SLO)$/OOXMLDocumentImpl.obj \
78    $(SLO)$/OOXMLStreamImpl.obj \
79    $(SLO)$/OOXMLFastDocumentHandler.obj \
80    $(SLO)$/OOXMLFastContextHandler.obj \
81    $(SLO)$/OOXMLFastTokenHandler.obj
82
83SHL1TARGET=$(TARGET)
84
85.IF "$(GUI)"=="UNX" || "$(GUI)"=="MAC" || "$(GUI)"=="OS2"
86RESOURCEMODELLIB=-lresourcemodel
87.ELIF "$(GUI)"=="WNT"
88.IF "$(COM)"=="GCC"
89RESOURCEMODELLIB=-lresourcemodel
90.ELSE
91RESOURCEMODELLIB=$(LB)$/iresourcemodel.lib
92.ENDIF
93.ENDIF
94
95SHL1STDLIBS=$(SALLIB)\
96    $(CPPULIB)\
97    $(CPPUHELPERLIB) \
98    $(COMPHELPERLIB) \
99    $(RESOURCEMODELLIB)
100SHL1IMPLIB=i$(SHL1TARGET)
101SHL1USE_EXPORTS=name
102
103SHL1OBJS=$(SLOFILES)
104
105SHL1DEF=$(MISC)$/$(SHL1TARGET).def
106DEF1NAME=$(SHL1TARGET)
107DEFLIB1NAME=$(TARGET)
108
109# --- Targets ------------------------------------------------------
110
111.INCLUDE :  target.mk
112
113.PHONY : test
114
115test:
116    echo $(SLOFILES)
117
118OOXMLCXXOUTDIR=$(MISC)
119OOXMLHXXOUTDIR=$(INCCOM)/ooxml
120OOXMLHXXOUTDIRCREATED=$(OOXMLHXXOUTDIR)/created
121
122OOXMLFACTORYCXXS=$(OOXMLCXXOUTDIR)$/OOXMLFactory_{$(NAMESPACES)}.cxx
123OOXMLFACTORYHXXS=$(OOXMLHXXOUTDIR)$/OOXMLFactory_{$(NAMESPACES)}.hxx
124
125OOXMLMODEL=model.xml
126OOXMLPREPROCESSXSL=modelpreprocess.xsl
127OOXMLFACTORYTOOLSXSL=factorytools.xsl
128OOXMLRESORUCETOKENSXSL=resourcestokens.xsl
129OOXMLFASTTOKENSXSL=fasttokens.xsl
130OOXMLRESOURCESIMPLXSL=resourcesimpl.xsl
131OOXMLNAMESPACEIDSXSL=namespaceids.xsl
132OOXMLFACTORYVALUESXSL=factory_values.xsl
133OOXMLFACTORYVALUESIMPLXSL=factoryimpl_values.xsl
134OOXMLRESOURCEIDSXSL=resourceids.xsl
135OOXMLGPERFFASTTOKENXSL=gperffasttokenhandler.xsl
136
137OOXMLRESOURCEIDSHXX=$(OOXMLHXXOUTDIR)$/resourceids.hxx
138
139TOKENXML=$(OOXMLCXXOUTDIR)$/token.xml
140TOKENXMLTMP=$(OOXMLCXXOUTDIR)$/token.tmp
141
142OOXMLFACTORYGENERATEDHXX=$(OOXMLHXXOUTDIR)$/OOXMLFactory_generated.hxx
143OOXMLFACTORYGENERATEDCXX=$(OOXMLCXXOUTDIR)$/OOXMLFactory_generated.cxx
144OOXMLFASTTOKENSHXX=$(OOXMLHXXOUTDIR)$/OOXMLFastTokens.hxx
145OOXMLNAMESPACEIDSHXX=$(OOXMLHXXOUTDIR)$/OOXMLnamespaceids.hxx
146OOXMLFACTORYVALUESHXX=$(OOXMLCXXOUTDIR)$/OOXMLFactory_values.hxx
147OOXMLFACTORYVALUESCXX=$(OOXMLCXXOUTDIR)$/OOXMLFactory_values.cxx
148GPERFFASTTOKENHXX=$(OOXMLHXXOUTDIR)$/gperffasttoken.hxx
149MODELPROCESSED=$(MISC)$/model_preprocessed.xml
150
151OOXMLGENHEADERS= \
152    $(OOXMLFACTORYGENERATEDHXX) \
153    $(OOXMLFACTORYHXXS) \
154    $(OOXMLFASTTOKENSHXX) \
155    $(OOXMLFACTORYVALUESHXX) \
156    $(GPERFFASTTOKENHXX) \
157    $(OOXMLRESOURCEIDSHXX) \
158    $(OOXMLNAMESPACEIDSHXX)
159
160GENERATEDFILES= \
161    $(OOXMLGENHEADERS) \
162    $(OOXMLFACTORYGENERATEDCXX) \
163    $(OOXMLFACTORYCXXS) \
164    $(OOXMLFACTORYVALUESCXX) \
165    $(TOKENXMLTMP) \
166    $(TOKENXML)
167
168$(TOKENXMLTMP): $(SOLARVER)$/$(INPATH)$/inc$(UPDMINOREXT)$/oox$/token$/tokens.txt
169    @$(TYPE) $(SOLARVER)$/$(INPATH)$/inc$(UPDMINOREXT)$/oox$/token$/tokens.txt | $(SED) "s#\(.*\)#<fasttoken>\1</fasttoken>#" > $@
170
171$(TOKENXML): tokenxmlheader $(TOKENXMLTMP) tokenxmlfooter
172    @$(TYPE) tokenxmlheader $(TOKENXMLTMP) tokenxmlfooter > $@
173
174$(OOXMLHXXOUTDIRCREATED):
175    $(MKDIRHIER) $(OOXMLHXXOUTDIR)
176    @$(TOUCH) $@
177
178$(OOXMLGENHEADERS): $(OOXMLHXXOUTDIRCREATED)
179
180$(OOXMLFASTTOKENSHXX): $(OOXMLFASTTOKENSXSL) $(TOKENXML)
181    @echo "Making:   " $(@:f)
182    $(COMMAND_ECHO)$(XSLTPROC) $(OOXMLFASTTOKENSXSL) $(TOKENXML) > $@
183
184$(OOXMLFACTORYGENERATEDHXX): factoryinc.xsl
185    @echo "Making:   " $(@:f)
186    $(COMMAND_ECHO)$(XSLTPROC) $< $(MODELPROCESSED) > $@
187
188$(OOXMLFACTORYGENERATEDCXX): factoryimpl.xsl
189    @echo "Making:   " $(@:f)
190    $(COMMAND_ECHO)$(XSLTPROC) $< $(MODELPROCESSED) > $@
191
192$(OOXMLFACTORYGENERATEDCXX): $(MODELPROCESSED)
193
194$(OOXMLFACTORYGENERATEDHXX): $(MODELPROCESSED)
195
196$(OOXMLFACTORYCXXS): $(MODELPROCESSED)
197
198$(OOXMLFACTORYHXXS): $(MODELPROCESSED)
199
200$(OOXMLCXXOUTDIR)$/OOXMLFactory%.cxx: factoryimpl_ns.xsl
201    @echo "Making:   " $(@:f)
202    $(COMMAND_ECHO)$(XSLTPROC) --stringparam file $@ $< $(MODELPROCESSED) > $@
203
204$(OOXMLHXXOUTDIR)$/OOXMLFactory%.hxx: factory_ns.xsl
205    @echo "Making:   " $(@:f)
206    $(COMMAND_ECHO)$(XSLTPROC) --stringparam file $@ $< $(MODELPROCESSED) > $@
207
208$(OOXMLFACTORYVALUESHXX): $(OOXMLFACTORYVALUESXSL) $(MODELPROCESSED)
209    @echo "Making:   " $(@:f)
210    $(COMMAND_ECHO)$(XSLTPROC) $(OOXMLFACTORYVALUESXSL) $(MODELPROCESSED) > $@
211
212$(OOXMLFACTORYVALUESCXX): $(OOXMLFACTORYVALUESIMPLXSL) $(MODELPROCESSED)
213    @echo "Making:   " $(@:f)
214    $(COMMAND_ECHO)$(XSLTPROC) $(OOXMLFACTORYVALUESIMPLXSL) $(MODELPROCESSED) > $@
215
216$(OOXMLRESOURCEIDSHXX):  $(OOXMLHXXOUTDIRCREATED) $(OOXMLRESOURCEIDSXSL) \
217    $(MODELPROCESSED)
218    @echo "Making:   " $(@:f)
219    $(COMMAND_ECHO)$(XSLTPROC) $(OOXMLRESOURCEIDSXSL) $(MODELPROCESSED) > $@
220
221$(OOXMLNAMESPACEIDSHXX):  $(OOXMLHXXOUTDIRCREATED) $(OOXMLNAMESPACEIDSXSL) \
222    $(MODELPROCESSED)
223    @echo "Making:   " $(@:f)
224    $(COMMAND_ECHO)$(XSLTPROC) $(OOXMLNAMESPACEIDSXSL) $(MODELPROCESSED) > $@
225
226$(GPERFFASTTOKENHXX): $(OOXMLGPERFFASTTOKENXSL) $(MODELPROCESSED)
227    @echo "Making:   " $(@:f)
228    $(COMMAND_ECHO)$(XSLTPROC) $(OOXMLGPERFFASTTOKENXSL) $(MODELPROCESSED) | tr -d '\r' | $(GPERF) -I -t -E -S1 -c -G -LC++ > $@
229
230$(SLOFACTORIESNAMESPACES): $(OOXMLFACTORYSCXXS) $(OOXMLGENHEADERS)
231
232$(GENERATEDFILES): $(OOXMLFACTORYTOOLSXSL)
233
234$(SLOFILES): $(OOXMLGENHEADERS)
235
236$(SLO)/OOXMLFactory_values.obj: $(OOXMLFACTORYVALUESCXX) $(OOXMLFACTORYVALUESHXX)
237
238$(SLO)$/OOXMLFactory_generated.obj: $(OOXMLFACTORYGENERATEDCXX) $(OOXMLGENHEADERS)
239
240.PHONY: genclean genmake genheaders
241
242genclean:
243    rm -f $(GENERATEDFILES)
244
245genmake: $(GENERATEDFILES)
246
247genheaders: $(GENHEADERS)
248