1b63233d8Sdamjan############################################################### 2b63233d8Sdamjan# 3b63233d8Sdamjan# Licensed to the Apache Software Foundation (ASF) under one 4b63233d8Sdamjan# or more contributor license agreements. See the NOTICE file 5b63233d8Sdamjan# distributed with this work for additional information 6b63233d8Sdamjan# regarding copyright ownership. The ASF licenses this file 7b63233d8Sdamjan# to you under the Apache License, Version 2.0 (the 8b63233d8Sdamjan# "License"); you may not use this file except in compliance 9b63233d8Sdamjan# with the License. You may obtain a copy of the License at 10b63233d8Sdamjan# 11b63233d8Sdamjan# http://www.apache.org/licenses/LICENSE-2.0 12b63233d8Sdamjan# 13b63233d8Sdamjan# Unless required by applicable law or agreed to in writing, 14b63233d8Sdamjan# software distributed under the License is distributed on an 15b63233d8Sdamjan# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16b63233d8Sdamjan# KIND, either express or implied. See the License for the 17b63233d8Sdamjan# specific language governing permissions and limitations 18b63233d8Sdamjan# under the License. 19b63233d8Sdamjan# 20b63233d8Sdamjan############################################################### 21b63233d8Sdamjan 22b63233d8Sdamjan 23b63233d8Sdamjan 24b63233d8SdamjanWFDIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) 25b63233d8SdamjanGBUILDDIR := $(SOLARENV)/gbuild 26b63233d8Sdamjan 27b63233d8Sdamjaninclude $(WFDIR)generated.mk 28b63233d8Sdamjaninclude $(GBUILDDIR)/gbuild.mk 29b63233d8Sdamjan 30b63233d8Sdamjan# doctok 31b63233d8Sdamjan 32b63233d8Sdamjandoctok : 33b63233d8Sdamjan mkdir doctok 34b63233d8Sdamjan 35b63233d8Sdamjanwf_SRC_doctok_Model=$(WFDIR)doctok/resources.xmi 36b63233d8Sdamjanwf_SRC_doctok_Resources_xsl=$(WFDIR)doctok/resources.xsl 37b63233d8Sdamjanwf_SRC_doctok_ResourcesImpl_xsl=$(WFDIR)doctok/resourcesimpl.xsl 38b63233d8Sdamjanwf_SRC_doctok_ResourceIds_xsl=$(WFDIR)doctok/resourceids.xsl 39b63233d8Sdamjanwf_SRC_doctok_SprmIds_xsl=$(WFDIR)doctok/sprmids.xsl 40b63233d8Sdamjanwf_SRC_doctok_ResourceTools_xsl=$(WFDIR)doctok/resourcetools.xsl 41b63233d8Sdamjan 42b63233d8Sdamjanwf_GEN_doctok_SprmIds_hxx=doctok/sprmids.hxx 43b63233d8Sdamjanwf_GEN_doctok_ResourceIds_hxx=doctok/resourceids.hxx 44b63233d8Sdamjanwf_GEN_doctok_Resources_hxx=doctok/resources.hxx 45b63233d8Sdamjanwf_GEN_doctok_Resources_cxx=resources.cxx 46b63233d8Sdamjan 47*07327bc6SDon Lewis$(wf_GEN_doctok_SprmIds_hxx) : $(wf_SRC_doctok_SprmIds_xsl) $(wf_SRC_doctok_Model) | doctok 48*07327bc6SDon Lewis $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 49b63233d8Sdamjan 50*07327bc6SDon Lewis$(wf_GEN_doctok_ResourceIds_hxx) : $(wf_SRC_doctok_ResourceIds_xsl) $(wf_SRC_doctok_Model) $(wf_SRC_doctok_ResourceTools_xsl) | doctok 51b63233d8Sdamjan $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $(wf_SRC_doctok_ResourceIds_xsl) $(wf_SRC_doctok_Model)) > $@ 52b63233d8Sdamjan 53*07327bc6SDon Lewis$(wf_GEN_doctok_Resources_hxx) : $(wf_SRC_doctok_Resources_xsl) $(wf_SRC_doctok_Model) | doctok 54*07327bc6SDon Lewis $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 55b63233d8Sdamjan 56*07327bc6SDon Lewis$(wf_GEN_doctok_Resources_cxx) : $(wf_SRC_doctok_ResourcesImpl_xsl) $(wf_SRC_doctok_Model) $(wf_SRC_doctok_ResourceTools_xsl) | doctok 57*07327bc6SDon Lewis $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 58b63233d8Sdamjan 59b63233d8Sdamjan# ooxml 60b63233d8Sdamjan 61b63233d8Sdamjanooxml : 62b63233d8Sdamjan mkdir ooxml 63b63233d8Sdamjan 64b63233d8Sdamjanwf_SRC_ooxml_Model=$(WFDIR)ooxml/model.xml 65b63233d8Sdamjanwf_SRC_ooxml_Preprocess_xsl=$(WFDIR)ooxml/modelpreprocess.xsl 66b63233d8Sdamjanwf_SRC_ooxml_FactoryTools_xsl=$(WFDIR)ooxml/factorytools.xsl 67b63233d8Sdamjanwf_SRC_ooxml_FastTokens_xsl=$(WFDIR)ooxml/fasttokens.xsl 68b63233d8Sdamjanwf_SRC_ooxml_NamespaceIds_xsl=$(WFDIR)ooxml/namespaceids.xsl 69b63233d8Sdamjanwf_SRC_ooxml_FactoryValues_xsl=$(WFDIR)ooxml/factory_values.xsl 70b63233d8Sdamjanwf_SRC_ooxml_FactoryValuesImpl_xsl=$(WFDIR)ooxml/factoryimpl_values.xsl 71b63233d8Sdamjanwf_SRC_ooxml_ResourceIds_xsl=$(WFDIR)ooxml/resourceids.xsl 72b63233d8Sdamjanwf_SRC_ooxml_GperfFastTokenHandler_xsl=$(WFDIR)ooxml/gperffasttokenhandler.xsl 73b63233d8Sdamjanwf_SRC_ooxml_Analyze_model_xsl=$(WFDIR)ooxml/analyzemodel.xsl 74b63233d8Sdamjanwf_SRC_ooxml_Status_stage1_sh=$(WFDIR)ooxml/stage1.sh 75b63233d8Sdamjanwf_SRC_ooxml_Status_stage2_xsl=$(WFDIR)ooxml/analyzestage2.xsl 76b63233d8Sdamjanwf_SRC_ooxml_Status_stage3_xsl=$(WFDIR)ooxml/analyzestage3.xsl 77b63233d8Sdamjanwf_SRC_ooxml_Status_todo_xsl=$(WFDIR)ooxml/todo.xsl 78b63233d8Sdamjanwf_SRC_ooxml_Status_efforts_xsl=$(WFDIR)ooxml/effort.xsl 79b63233d8Sdamjan 80b63233d8Sdamjanwf_GEN_ooxml_ResourceIds_hxx=ooxml/resourceids.hxx 81b63233d8Sdamjan 82b63233d8Sdamjanwf_GEN_ooxml_token_xml=token.xml 83b63233d8Sdamjanwf_GEN_ooxml_token_tmp=token.tmp 84b63233d8Sdamjan 85b63233d8Sdamjanwf_GEN_ooxml_Factory_hxx=OOXMLFactory_generated.hxx 86b63233d8Sdamjanwf_GEN_ooxml_Factory_cxx=OOXMLFactory_generated.cxx 87b63233d8Sdamjanwf_GEN_ooxml_FastTokens_hxx=ooxml/OOXMLFastTokens.hxx 88b63233d8Sdamjanwf_GEN_ooxml_NamespaceIds_hxx=ooxml/OOXMLnamespaceids.hxx 89b63233d8Sdamjanwf_GEN_ooxml_FactoryValues_hxx=OOXMLFactory_values.hxx 90b63233d8Sdamjanwf_GEN_ooxml_FactoryValues_cxx=OOXMLFactory_values.cxx 91b63233d8Sdamjanwf_GEN_ooxml_GperfFastToken_hxx=gperffasttoken.hxx 92b63233d8Sdamjanwf_GEN_ooxml_Model_processed=model_preprocessed.xml 93b63233d8Sdamjanwf_GEN_ooxml_Model_analyzed=ooxml/model_analyzed.xml 94b63233d8Sdamjanwf_GEN_ooxml_Status_stage1=ooxml/status_stage1.xml 95b63233d8Sdamjanwf_GEN_ooxml_Status_stage2=ooxml/status_stage2.xml 96b63233d8Sdamjanwf_GEN_ooxml_Status_stage3=ooxml/status_stage3.xml 97b63233d8Sdamjanwf_GEN_ooxml_Status_todo=ooxml/todo.xml 98b63233d8Sdamjanwf_GEN_ooxml_Status_efforts=ooxml/efforts.csv 99b63233d8Sdamjan 100b63233d8Sdamjan$(wf_GEN_ooxml_token_tmp) : $(OUTDIR)/inc$(UPDMINOREXT)/oox/token/tokens.txt 101b63233d8Sdamjan cat $(OUTDIR)/inc$(UPDMINOREXT)/oox/token/tokens.txt \ 102b63233d8Sdamjan | sed "s#\(.*\)#<fasttoken>\1</fasttoken>#" > $@ 103b63233d8Sdamjan 104b63233d8Sdamjan$(wf_GEN_ooxml_token_xml) : $(WFDIR)ooxml/tokenxmlheader $(wf_GEN_ooxml_token_tmp) $(WFDIR)ooxml/tokenxmlfooter 105*07327bc6SDon Lewis cat $^ > $@ 106b63233d8Sdamjan 107*07327bc6SDon Lewis$(wf_GEN_ooxml_FastTokens_hxx) : $(wf_SRC_ooxml_FastTokens_xsl) $(wf_GEN_ooxml_token_xml) | ooxml 108*07327bc6SDon Lewis $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 109b63233d8Sdamjan 110b63233d8Sdamjan$(wf_GEN_ooxml_Factory_hxx) : $(WFDIR)ooxml/factoryinc.xsl $(wf_GEN_ooxml_Model_processed) 111b63233d8Sdamjan $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $< $(wf_GEN_ooxml_Model_processed)) > $@ 112b63233d8Sdamjan 113b63233d8Sdamjan$(wf_GEN_ooxml_Factory_cxx) : $(WFDIR)ooxml/factoryimpl.xsl $(wf_GEN_ooxml_Model_processed) 114b63233d8Sdamjan $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $< $(wf_GEN_ooxml_Model_processed)) > $@ 115b63233d8Sdamjan 116b63233d8SdamjanOOXMLFactory%.cxx : $(WFDIR)ooxml/factoryimpl_ns.xsl $(wf_GEN_ooxml_Model_processed) 117b63233d8Sdamjan $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) --stringparam file $@ $< $(wf_GEN_ooxml_Model_processed)) > $@ 118b63233d8Sdamjan 119b63233d8SdamjanOOXMLFactory%.hxx : $(WFDIR)ooxml/factory_ns.xsl $(wf_GEN_ooxml_Model_processed) 120b63233d8Sdamjan $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) --stringparam file $@ $< $(wf_GEN_ooxml_Model_processed)) > $@ 121b63233d8Sdamjan 122b63233d8Sdamjan$(wf_GEN_ooxml_FactoryValues_hxx) : $(wf_SRC_ooxml_FactoryValues_xsl) $(wf_GEN_ooxml_Model_processed) 123*07327bc6SDon Lewis $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 124b63233d8Sdamjan 125b63233d8Sdamjan$(wf_GEN_ooxml_FactoryValues_cxx) : $(wf_SRC_ooxml_FactoryValuesImpl_xsl) $(wf_GEN_ooxml_Model_processed) 126*07327bc6SDon Lewis $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 127b63233d8Sdamjan 128*07327bc6SDon Lewis$(wf_GEN_ooxml_ResourceIds_hxx) : $(wf_SRC_ooxml_ResourceIds_xsl) $(wf_GEN_ooxml_Model_processed) $(wf_SRC_ooxml_FactoryTools_xsl) | ooxml 129b63233d8Sdamjan $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $(wf_SRC_ooxml_ResourceIds_xsl) $(wf_GEN_ooxml_Model_processed)) > $@ 130b63233d8Sdamjan 131*07327bc6SDon Lewis$(wf_GEN_ooxml_NamespaceIds_hxx) : $(wf_SRC_ooxml_NamespaceIds_xsl) $(wf_GEN_ooxml_Model_processed) | ooxml 132*07327bc6SDon Lewis $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 133b63233d8Sdamjan 134b63233d8Sdamjan$(wf_GEN_ooxml_GperfFastToken_hxx) : $(wf_SRC_ooxml_GperfFastTokenHandler_xsl) $(wf_GEN_ooxml_Model_processed) 135*07327bc6SDon Lewis $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) \ 136b63233d8Sdamjan | tr -d '\r' | gperf -I -t -E -S1 -c -G -LC++ > $@ 137b63233d8Sdamjan 138*07327bc6SDon Lewis$(wf_GEN_ooxml_Model_analyzed): $(wf_SRC_ooxml_Analyze_model_xsl) $(wf_SRC_ooxml_Model) | ooxml 139b63233d8Sdamjan $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 140b63233d8Sdamjan 141*07327bc6SDon Lewis$(wf_GEN_ooxml_Status_stage1) : $(wf_GEN_ooxml_Model_analyzed) $(wf_SRC_ooxml_stage1_sh) | ooxml 142b63233d8Sdamjan $(wf_SRC_ooxml_Status_stage1_sh) $(wf_GEN_ooxml_Model_analyzed) $(WFDIR)dmapper > $@ 143b63233d8Sdamjan 144*07327bc6SDon Lewis$(wf_GEN_ooxml_Status_stage2) : $(wf_SRC_ooxml_Status_stage2_xsl) $(wf_GEN_ooxml_Status_stage1) | ooxml 145b63233d8Sdamjan $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 146b63233d8Sdamjan 147*07327bc6SDon Lewis$(wf_GEN_ooxml_Status_stage3) : $(wf_SRC_ooxml_Status_stage3_xsl) $(wf_GEN_ooxml_Status_stage2) | ooxml 148b63233d8Sdamjan $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 149b63233d8Sdamjan 150*07327bc6SDon Lewis$(wf_GEN_ooxml_Status_todo) : $(wf_SRC_ooxml_Status_todo_xsl) $(wf_GEN_ooxml_Status_stage3) | ooxml 151b63233d8Sdamjan $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 152b63233d8Sdamjan 153*07327bc6SDon Lewis$(wf_GEN_ooxml_Status_efforts) : $(wf_SRC_ooxml_Status_efforts_xsl) $(wf_GEN_ooxml_Status_todo) | ooxml 154b63233d8Sdamjan $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 155b63233d8Sdamjan 156b63233d8Sdamjan# rtftok 157b63233d8Sdamjan 158b63233d8Sdamjanwf_SRC_rtftok_scanner_lex=$(WFDIR)rtftok/RTFScanner.lex 159b63233d8Sdamjanwf_SRC_rtftok_scanner_skl=$(WFDIR)rtftok/RTFScanner.skl 160b63233d8Sdamjan 161b63233d8Sdamjanwf_GEN_rtftok_scanner_cxx=RTFScanner.cxx 162b63233d8Sdamjan 163b63233d8Sdamjan# does not build, currently unused 164b63233d8Sdamjan#$(wf_GEN_rtftok_scanner_cxx) : $(wf_SRC_rtftok_scanner_lex) $(wf_SRC_rtftok_scanner_skl) 165b63233d8Sdamjan# flex -+ -S$(wf_SRC_rtftok_scanner_skl) -o$@ $(wf_SRC_rtftok_scanner_lex) 166b63233d8Sdamjan 167b63233d8Sdamjan# resourcemodel 168b63233d8Sdamjan 169b63233d8Sdamjanwf_GEN_model_QNameToStr_cxx=qnametostr.cxx 170b63233d8Sdamjanwf_GEN_ooxml_QNameToStr_tmp=OOXMLqnameToStr.tmp 171b63233d8Sdamjanwf_GEN_model_SprmCodeToStr_cxx=sprmcodetostr.cxx 172b63233d8Sdamjanwf_GEN_model_SprmCodeToStr_tmp=sprmcodetostr.tmp 173b63233d8Sdamjanwf_GEN_doctok_QnameToStr_tmp=DOCTOKqnameToStr.tmp 174b63233d8Sdamjanwf_SRC_doctok_SprmCodeToStr_xsl=$(WFDIR)doctok/sprmcodetostr.xsl 175b63233d8Sdamjanwf_SRC_doctok_QNameToStr_xsl=$(WFDIR)doctok/qnametostr.xsl 176b63233d8Sdamjanwf_SRC_ooxml_QNameToStr_xsl=$(WFDIR)ooxml/qnametostr.xsl 177b63233d8Sdamjanwf_SRC_model_NamespacePreprocess=$(WFDIR)resourcemodel/namespace_preprocess.pl 178b63233d8Sdamjanwf_GEN_ooxml_Namespacesmap_xsl=namespacesmap.xsl 179b63233d8Sdamjanwf_DEP_ooxml_namespaces_txt=$(OUTDIR)/inc$(UPDMINOREXT)/oox/token/namespaces.txt 180b63233d8Sdamjanwf_GEN_ooxml_preprocess_xsl=modelpreprocess.xsl 181b63233d8Sdamjan 182b63233d8Sdamjan$(wf_GEN_ooxml_QNameToStr_tmp): $(wf_SRC_ooxml_QNameToStr_xsl) $(wf_GEN_ooxml_Model_processed) 183*07327bc6SDon Lewis $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 184b63233d8Sdamjan 185b63233d8Sdamjan$(wf_GEN_doctok_QnameToStr_tmp): $(wf_SRC_doctok_QNameToStr_xsl) $(wf_SRC_doctok_Model) 186*07327bc6SDon Lewis $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 187b63233d8Sdamjan 188*07327bc6SDon Lewis$(wf_GEN_model_QNameToStr_cxx): $(WFDIR)resourcemodel/qnametostrheader $(wf_GEN_ooxml_QNameToStr_tmp) $(wf_GEN_doctok_QnameToStr_tmp) $(WFDIR)resourcemodel/qnametostrfooter 189*07327bc6SDon Lewis cat $^ > $@ 190b63233d8Sdamjan 191b63233d8Sdamjan$(wf_GEN_model_SprmCodeToStr_tmp) : $(wf_SRC_doctok_SprmCodeToStr_xsl) $(wf_SRC_doctok_Model) 192*07327bc6SDon Lewis $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $^) > $@ 193b63233d8Sdamjan 194b63233d8Sdamjan$(wf_GEN_model_SprmCodeToStr_cxx): $(WFDIR)resourcemodel/sprmcodetostrheader $(wf_GEN_model_SprmCodeToStr_tmp) $(WFDIR)resourcemodel/sprmcodetostrfooter 195b63233d8Sdamjan cat $^ > $@ 196b63233d8Sdamjan 197b63233d8Sdamjan$(wf_GEN_ooxml_Namespacesmap_xsl) : $(wf_SRC_ooxml_Model) $(wf_DEP_ooxml_namespaces_txt) $(wf_SRC_model_NamespacePreprocess) 198b63233d8Sdamjan $(PERL) $(wf_SRC_model_NamespacePreprocess) $(wf_DEP_ooxml_namespaces_txt) > $@ 199b63233d8Sdamjan 200b63233d8Sdamjan$(wf_GEN_ooxml_preprocess_xsl) : $(wf_SRC_ooxml_Preprocess_xsl) 201*07327bc6SDon Lewis cp -f $^ $@ 202b63233d8Sdamjan 203b63233d8Sdamjan$(wf_GEN_ooxml_Model_processed) : $(wf_GEN_ooxml_Namespacesmap_xsl) $(wf_GEN_ooxml_preprocess_xsl) $(wf_SRC_ooxml_Model) 204b63233d8Sdamjan $(call gb_Helper_abbreviate_dirs_native, $(gb_XSLTPROC) $(wf_GEN_ooxml_Namespacesmap_xsl) $(wf_SRC_ooxml_Model)) > $@ 205b63233d8Sdamjan 206b63233d8Sdamjan# all 207b63233d8Sdamjan 208b63233d8Sdamjan.DEFAULT_GOAL:=all 209b63233d8Sdamjan.PHONY: all 210b63233d8Sdamjanall : \ 211b63233d8Sdamjan $(wf_GEN_doctok_SprmIds_hxx) \ 212b63233d8Sdamjan $(wf_GEN_doctok_ResourceIds_hxx) \ 213b63233d8Sdamjan $(wf_GEN_doctok_Resources_hxx) \ 214b63233d8Sdamjan $(wf_GEN_doctok_Resources_cxx) \ 215b63233d8Sdamjan $(wf_GEN_ooxml_ResourceIds_hxx) \ 216b63233d8Sdamjan $(wf_GEN_ooxml_Factory_hxx) \ 217b63233d8Sdamjan $(wf_GEN_ooxml_Factory_cxx) \ 218b63233d8Sdamjan $(wf_GEN_ooxml_FactoryValues_hxx) \ 219b63233d8Sdamjan $(wf_GEN_ooxml_FactoryValues_cxx) \ 220b63233d8Sdamjan $(wf_GEN_ooxml_FastTokens_hxx) \ 221b63233d8Sdamjan $(wf_GEN_ooxml_GperfFastToken_hxx) \ 222b63233d8Sdamjan $(wf_GEN_ooxml_NamespaceIds_hxx) \ 223b63233d8Sdamjan $(wf_GEN_ooxml_Status_efforts) \ 224b63233d8Sdamjan $(wf_GEN_model_QNameToStr_cxx) \ 225b63233d8Sdamjan $(wf_GEN_model_SprmCodeToStr_cxx) \ 226b63233d8Sdamjan $(patsubst %,OOXMLFactory_%.hxx,$(WRITERFILTER_OOXMLNAMESPACES)) \ 227b63233d8Sdamjan $(patsubst %,OOXMLFactory_%.cxx,$(WRITERFILTER_OOXMLNAMESPACES)) \ 228