1*7871dc3eSAndrew Rist#************************************************************** 2*7871dc3eSAndrew Rist# 3*7871dc3eSAndrew Rist# Licensed to the Apache Software Foundation (ASF) under one 4*7871dc3eSAndrew Rist# or more contributor license agreements. See the NOTICE file 5*7871dc3eSAndrew Rist# distributed with this work for additional information 6*7871dc3eSAndrew Rist# regarding copyright ownership. The ASF licenses this file 7*7871dc3eSAndrew Rist# to you under the Apache License, Version 2.0 (the 8*7871dc3eSAndrew Rist# "License"); you may not use this file except in compliance 9*7871dc3eSAndrew Rist# with the License. You may obtain a copy of the License at 10*7871dc3eSAndrew Rist# 11*7871dc3eSAndrew Rist# http://www.apache.org/licenses/LICENSE-2.0 12*7871dc3eSAndrew Rist# 13*7871dc3eSAndrew Rist# Unless required by applicable law or agreed to in writing, 14*7871dc3eSAndrew Rist# software distributed under the License is distributed on an 15*7871dc3eSAndrew Rist# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*7871dc3eSAndrew Rist# KIND, either express or implied. See the License for the 17*7871dc3eSAndrew Rist# specific language governing permissions and limitations 18*7871dc3eSAndrew Rist# under the License. 19*7871dc3eSAndrew Rist# 20*7871dc3eSAndrew Rist#************************************************************** 21*7871dc3eSAndrew Rist 22*7871dc3eSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweirPACKAGEDIR*:=$(subst,.,/ $(PACKAGE)) 25cdf0e10cSrcweirXSLTPACKAGEDIR*:=$(subst,.,/ $(PACKAGE)) 26cdf0e10cSrcweirXCSROOTURL!:=$(ABSXCSROOT) 27cdf0e10cSrcweir.IF $(GUI)==WNT 28cdf0e10cSrcweirXCSROOTURL!:=file:///$(subst,\,/ $(XCSROOTURL)) 29cdf0e10cSrcweir.ENDIF 30cdf0e10cSrcweirSYSXSLDIR*:=$(XSLDIR)/ 31cdf0e10cSrcweir.IF $(GUI)==OS2 32cdf0e10cSrcweirXCSROOTURL!:=$(subst,\,/ $(XCSROOTURL)) 33cdf0e10cSrcweirSYSXSLDIR!:=$(subst,\,/ $(SYSXSLDIR))/ 34cdf0e10cSrcweir.ENDIF 35cdf0e10cSrcweir 36cdf0e10cSrcweir# 37cdf0e10cSrcweir# --- XCS --- 38cdf0e10cSrcweir# 39cdf0e10cSrcweir 40cdf0e10cSrcweir.IF "$(XCSFILES)"!="" 41cdf0e10cSrcweir# remove unnecessary info from the component schemas 42cdf0e10cSrcweirXCS_TRIM=$(PROCESSOUT)/registry/schema/$(PACKAGEDIR)/{$(XCSFILES)} 43cdf0e10cSrcweir 44cdf0e10cSrcweir# transform xcs format to properties format 45cdf0e10cSrcweir# XCS_RESOURCES=$(foreach,i,$(XCSFILES) $(MISC)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/$(i:b).properties) 46cdf0e10cSrcweir 47cdf0e10cSrcweirALLTAR: \ 48cdf0e10cSrcweir $(XCS_TRIM) 49cdf0e10cSrcweir.ENDIF # "$(XCSFILES)"!="" 50cdf0e10cSrcweir 51cdf0e10cSrcweir.IF "$(XCS_TRIM)" != "" 52cdf0e10cSrcweir$(XCS_TRIM) : $(DTDDIR)/registry/component-schema.dtd \ 53cdf0e10cSrcweir $(XSLDIR)/schema_val.xsl \ 54cdf0e10cSrcweir $(XSLDIR)/sanity.xsl \ 55cdf0e10cSrcweir $(XSLDIR)/schema_trim.xsl 56cdf0e10cSrcweir.ENDIF 57cdf0e10cSrcweir 58cdf0e10cSrcweir$(PROCESSOUT)/registry/schema/$(PACKAGEDIR)/%.xcs : %.xcs 59cdf0e10cSrcweir @echo "Making: " $(@:f) 60cdf0e10cSrcweir.IF "$(VERBOSE)" != "FALSE" 61cdf0e10cSrcweir @echo --- validating and stripping schema files 62cdf0e10cSrcweir.ENDIF 63cdf0e10cSrcweir @-$(MKDIRHIER) $(@:d) 64cdf0e10cSrcweir $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $(@:d))$*.val) \ 65cdf0e10cSrcweir --stringparam componentName $(PACKAGE).$* \ 66cdf0e10cSrcweir $(SYSXSLDIR)schema_val.xsl $< 67cdf0e10cSrcweir $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $(@:d))$*.san) \ 68cdf0e10cSrcweir $(SYSXSLDIR)sanity.xsl $< 69cdf0e10cSrcweir $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \ 70cdf0e10cSrcweir $(SYSXSLDIR)schema_trim.xsl $< 71cdf0e10cSrcweir @+-$(RM) $(@:d)$*.val > $(NULLDEV) 72cdf0e10cSrcweir @+-$(RM) $(@:d)$*.san > $(NULLDEV) 73cdf0e10cSrcweir 74cdf0e10cSrcweir$(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcs : %.xcs 75cdf0e10cSrcweir# just a copy for now - insert "cfgex" commandline when required 76cdf0e10cSrcweir $(COMMAND_ECHO)-$(MKDIRHIER) $(@:d) 77cdf0e10cSrcweir $(COMMAND_ECHO)$(COPY) $< $@ 78cdf0e10cSrcweir 79cdf0e10cSrcweir# Create properties files for localized <info> contents (Currently not built) 80cdf0e10cSrcweir.IF "$(XCS_RESOURCES)" != "" 81cdf0e10cSrcweir$(XCS_RESOURCES) : $(XSLDIR)/resource.xsl 82cdf0e10cSrcweir.ENDIF 83cdf0e10cSrcweir 84cdf0e10cSrcweir$(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/%.properties :| $(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcs 85cdf0e10cSrcweir @echo "Making: " $(@:f) 86cdf0e10cSrcweir.IF "$(VERBOSE)" != "FALSE" 87cdf0e10cSrcweir @echo --- creating locale dependent resource bundles 88cdf0e10cSrcweir.ENDIF 89cdf0e10cSrcweir @-$(MKDIRHIER) $(@:d) 90cdf0e10cSrcweir $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \ 91cdf0e10cSrcweir --stringparam locale {$(subst,/$(PACKAGEDIR)/$(@:f), $(subst,$(PROCESSOUT)/registry/res/, $@))} \ 92cdf0e10cSrcweir $(SYSXSLDIR)resource.xsl $< 93cdf0e10cSrcweir 94cdf0e10cSrcweir# 95cdf0e10cSrcweir# --- XCU --- 96cdf0e10cSrcweir# 97cdf0e10cSrcweir 98cdf0e10cSrcweir.IF "$(XCUFILES)"!="" 99cdf0e10cSrcweirXCU_DEFAULT =$(PROCESSOUT)/registry/data/$(PACKAGEDIR)/{$(XCUFILES)} 100cdf0e10cSrcweirXCU_MODULES =$(foreach,i,$(MODULEFILES) $(PROCESSOUT)/registry/spool/$(PACKAGEDIR)/$(i)) 101cdf0e10cSrcweirXCU_LANG =$(foreach,i,$(LOCALIZEDFILES) $(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/$(i)) 102cdf0e10cSrcweir.ENDIF # "$(XCUFILES)"!="" 103cdf0e10cSrcweir 104cdf0e10cSrcweir.IF "$(XCU_DEFAULT)" != "" 105cdf0e10cSrcweir$(XCU_DEFAULT) : $(DTDDIR)/registry/component-update.dtd \ 106cdf0e10cSrcweir $(XSLDIR)/data_val.xsl \ 107cdf0e10cSrcweir $(XSLDIR)/alllang.xsl 108cdf0e10cSrcweir.ENDIF 109cdf0e10cSrcweir 110cdf0e10cSrcweir$(PROCESSOUT)/registry/data/$(PACKAGEDIR)/%.xcu : %.xcu 111cdf0e10cSrcweir @echo "Making: " $(@:f) 112cdf0e10cSrcweir.IF "$(VERBOSE)" != "FALSE" 113cdf0e10cSrcweir @echo --- validating and creating a locale independent file 114cdf0e10cSrcweir.ENDIF 115cdf0e10cSrcweir @-$(MKDIRHIER) $(@:d) 116cdf0e10cSrcweir $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $(@:d))$*.val) \ 117cdf0e10cSrcweir --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$*.xcs \ 118cdf0e10cSrcweir --stringparam schemaRoot $(XCSROOTURL)/registry/schema \ 119cdf0e10cSrcweir --path $(DTDDIR)/registry \ 120cdf0e10cSrcweir $(SYSXSLDIR)data_val.xsl $< 121cdf0e10cSrcweir $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \ 122cdf0e10cSrcweir --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$*.xcs \ 123cdf0e10cSrcweir --stringparam schemaRoot $(XCSROOTURL)/registry/schema \ 124cdf0e10cSrcweir --path $(DTDDIR)/registry \ 125cdf0e10cSrcweir $(SYSXSLDIR)alllang.xsl $< 126cdf0e10cSrcweir @+-$(RM) $(@:d)$*.val > $(NULLDEV) 127cdf0e10cSrcweir 128cdf0e10cSrcweir# --- localizations --- 129cdf0e10cSrcweir.IF "$(WITH_LANG)"!="" 130cdf0e10cSrcweir.IF "$(XCU_LANG)"!="" 131cdf0e10cSrcweir$(XCU_LANG) : $(LOCALIZESDF) 132cdf0e10cSrcweir.ENDIF # "$(XCU_LANG)"!="" 133cdf0e10cSrcweir 134cdf0e10cSrcweir$(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcu : %.xcu 135cdf0e10cSrcweir @-$(MKDIRHIER) $(@:d) 136cdf0e10cSrcweir $(COMMAND_ECHO)$(CFGEX) -p $(PRJNAME) -i $(@:f) -o $@ -m $(LOCALIZESDF) -l all 137cdf0e10cSrcweir 138cdf0e10cSrcweir.IF "$(XCU_LANG)" != "" 139cdf0e10cSrcweir$(XCU_LANG) : $(XSLDIR)/alllang.xsl 140cdf0e10cSrcweir.ENDIF 141cdf0e10cSrcweir 142cdf0e10cSrcweir$(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/%.xcu :| $(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcu 143cdf0e10cSrcweir.ELSE # "$(WITH_LANG)"!="" 144cdf0e10cSrcweir$(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/%.xcu :| %.xcu 145cdf0e10cSrcweir.ENDIF # "$(WITH_LANG)"!="" 146cdf0e10cSrcweir @echo "Making: " $(@:f) 147cdf0e10cSrcweir.IF "$(VERBOSE)" != "FALSE" 148cdf0e10cSrcweir @echo --- creating locale dependent entries 149cdf0e10cSrcweir.ENDIF 150cdf0e10cSrcweir @-$(MKDIRHIER) $(@:d) 151cdf0e10cSrcweir $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \ 152cdf0e10cSrcweir --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$*.xcs \ 153cdf0e10cSrcweir --stringparam schemaRoot $(XCSROOTURL)/registry/schema \ 154cdf0e10cSrcweir --stringparam locale {$(subst,/$(PACKAGEDIR)/$(@:f), $(subst,$(PROCESSOUT)/registry/res/, $@))} \ 155cdf0e10cSrcweir --path $(DTDDIR)/registry \ 156cdf0e10cSrcweir $(SYSXSLDIR)alllang.xsl $< 157cdf0e10cSrcweir 158cdf0e10cSrcweir# --- languagepack tag modules --- 159cdf0e10cSrcweir.IF "$(LANGUAGEPACKS)" != "" 160cdf0e10cSrcweir$(LANGUAGEPACKS) : $(XSLDIR)/delcomment.sed 161cdf0e10cSrcweir.ENDIF 162cdf0e10cSrcweir 163cdf0e10cSrcweir 164cdf0e10cSrcweir$(PROCESSOUT)/registry/spool/Langpack-%.xcu : Langpack.xcu.tmpl 165cdf0e10cSrcweir.IF "$(VERBOSE)" != "FALSE" 166cdf0e10cSrcweir @echo --- creating a Langpack module for locale $* 167cdf0e10cSrcweir.ENDIF 168cdf0e10cSrcweir -$(MKDIRHIER) $(@:d) 169cdf0e10cSrcweir $(COMMAND_ECHO)$(SED) -e "s/__LANGUAGE__/$*/" -f $(XSLDIR)/delcomment.sed $< > $@ 170cdf0e10cSrcweir 171cdf0e10cSrcweir 172cdf0e10cSrcweir# --- modules --- 173cdf0e10cSrcweir.IF "$(XCU_MODULES)" != "" 174cdf0e10cSrcweir$(XCU_MODULES) : $(XSLDIR)/alllang.xsl 175cdf0e10cSrcweir.ENDIF 176cdf0e10cSrcweir 177cdf0e10cSrcweir 178cdf0e10cSrcweir$(PROCESSOUT)/registry/spool/$(PACKAGEDIR)/%.xcu :| $$(@:b:s/-/./:b).xcu 179cdf0e10cSrcweir @echo "Making: " $(@:f) 180cdf0e10cSrcweir.IF "$(VERBOSE)" != "FALSE" 181cdf0e10cSrcweir @echo --- creating a module file 182cdf0e10cSrcweir.ENDIF 183cdf0e10cSrcweir @-$(MKDIRHIER) $(@:d) 184cdf0e10cSrcweir $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \ 185cdf0e10cSrcweir --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$(<:b).xcs \ 186cdf0e10cSrcweir --stringparam schemaRoot $(XCSROOTURL)/registry/schema \ 187cdf0e10cSrcweir --stringparam module $(subst,$(<:b)-, $(*)) \ 188cdf0e10cSrcweir $(SYSXSLDIR)alllang.xsl $< 189cdf0e10cSrcweir 190cdf0e10cSrcweir.IF "$(XCUFILES)"!="" 191cdf0e10cSrcweirALLTAR: \ 192cdf0e10cSrcweir $(XCU_DEFAULT) \ 193cdf0e10cSrcweir $(XCU_MODULES) \ 194cdf0e10cSrcweir $(XCU_LANG) 195cdf0e10cSrcweir 196cdf0e10cSrcweir$(XCU_DEFAULT) : $$(@:d:s!$(PROCESSOUT)/registry/data/!$(ABSXCSROOT)/registry/schema/!)$$(@:f:s/.xcu/.xcs/) 197cdf0e10cSrcweir 198cdf0e10cSrcweir.ENDIF # "$(XCUFILES)"!="" 199cdf0e10cSrcweir 200