xref: /aoo41x/main/solenv/inc/tg_config.mk (revision 7871dc3e)
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#**************************************************************
21
22
23
24PACKAGEDIR*:=$(subst,.,/ $(PACKAGE))
25XSLTPACKAGEDIR*:=$(subst,.,/ $(PACKAGE))
26XCSROOTURL!:=$(ABSXCSROOT)
27.IF $(GUI)==WNT
28XCSROOTURL!:=file:///$(subst,\,/ $(XCSROOTURL))
29.ENDIF
30SYSXSLDIR*:=$(XSLDIR)/
31.IF $(GUI)==OS2
32XCSROOTURL!:=$(subst,\,/ $(XCSROOTURL))
33SYSXSLDIR!:=$(subst,\,/ $(SYSXSLDIR))/
34.ENDIF
35
36#
37# --- XCS ---
38#
39
40.IF "$(XCSFILES)"!=""
41# remove unnecessary info from the component schemas
42XCS_TRIM=$(PROCESSOUT)/registry/schema/$(PACKAGEDIR)/{$(XCSFILES)}
43
44# transform xcs format to properties format
45# XCS_RESOURCES=$(foreach,i,$(XCSFILES) $(MISC)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/$(i:b).properties)
46
47ALLTAR: \
48    $(XCS_TRIM)
49.ENDIF			# "$(XCSFILES)"!=""
50
51.IF "$(XCS_TRIM)" != ""
52$(XCS_TRIM) :   $(DTDDIR)/registry/component-schema.dtd \
53                $(XSLDIR)/schema_val.xsl \
54                $(XSLDIR)/sanity.xsl \
55                $(XSLDIR)/schema_trim.xsl
56.ENDIF
57
58$(PROCESSOUT)/registry/schema/$(PACKAGEDIR)/%.xcs : %.xcs
59	@echo "Making:   " $(@:f)
60.IF "$(VERBOSE)" != "FALSE"
61    @echo --- validating and stripping schema files
62.ENDIF
63	@-$(MKDIRHIER) $(@:d)
64	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $(@:d))$*.val) \
65	            --stringparam componentName $(PACKAGE).$* \
66	            $(SYSXSLDIR)schema_val.xsl $<
67	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $(@:d))$*.san) \
68	            $(SYSXSLDIR)sanity.xsl $<
69	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
70	            $(SYSXSLDIR)schema_trim.xsl $<
71	@+-$(RM) $(@:d)$*.val > $(NULLDEV)
72	@+-$(RM) $(@:d)$*.san > $(NULLDEV)
73
74$(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcs : %.xcs
75# just a copy for now - insert "cfgex" commandline when required
76	$(COMMAND_ECHO)-$(MKDIRHIER) $(@:d)
77	$(COMMAND_ECHO)$(COPY) $< $@
78
79# Create properties files for localized <info> contents (Currently not built)
80.IF "$(XCS_RESOURCES)" != ""
81$(XCS_RESOURCES) :   $(XSLDIR)/resource.xsl
82.ENDIF
83
84$(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/%.properties :| $(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcs
85	@echo "Making:   " $(@:f)
86.IF "$(VERBOSE)" != "FALSE"
87    @echo --- creating locale dependent resource bundles
88.ENDIF
89	@-$(MKDIRHIER) $(@:d)
90	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
91	            --stringparam locale {$(subst,/$(PACKAGEDIR)/$(@:f), $(subst,$(PROCESSOUT)/registry/res/, $@))} \
92	            $(SYSXSLDIR)resource.xsl $<
93
94#
95# --- XCU ---
96#
97
98.IF "$(XCUFILES)"!=""
99XCU_DEFAULT =$(PROCESSOUT)/registry/data/$(PACKAGEDIR)/{$(XCUFILES)}
100XCU_MODULES =$(foreach,i,$(MODULEFILES) $(PROCESSOUT)/registry/spool/$(PACKAGEDIR)/$(i))
101XCU_LANG    =$(foreach,i,$(LOCALIZEDFILES) $(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/$(i))
102.ENDIF			# "$(XCUFILES)"!=""
103
104.IF "$(XCU_DEFAULT)" != ""
105$(XCU_DEFAULT) : $(DTDDIR)/registry/component-update.dtd \
106                 $(XSLDIR)/data_val.xsl \
107                 $(XSLDIR)/alllang.xsl
108.ENDIF
109
110$(PROCESSOUT)/registry/data/$(PACKAGEDIR)/%.xcu : %.xcu
111	@echo "Making:   " $(@:f)
112.IF "$(VERBOSE)" != "FALSE"
113    @echo --- validating and creating a locale independent file
114.ENDIF
115	@-$(MKDIRHIER) $(@:d)
116	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $(@:d))$*.val) \
117	            --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$*.xcs \
118	            --stringparam schemaRoot $(XCSROOTURL)/registry/schema \
119		    --path $(DTDDIR)/registry \
120	            $(SYSXSLDIR)data_val.xsl $<
121	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
122	            --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$*.xcs \
123	            --stringparam schemaRoot $(XCSROOTURL)/registry/schema \
124		    --path $(DTDDIR)/registry \
125	            $(SYSXSLDIR)alllang.xsl $<
126	@+-$(RM) $(@:d)$*.val > $(NULLDEV)
127
128# --- localizations ---
129.IF "$(WITH_LANG)"!=""
130.IF "$(XCU_LANG)"!=""
131$(XCU_LANG) : $(LOCALIZESDF)
132.ENDIF			# "$(XCU_LANG)"!=""
133
134$(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcu : %.xcu
135	@-$(MKDIRHIER) $(@:d)
136	$(COMMAND_ECHO)$(CFGEX)  -p $(PRJNAME) -i $(@:f) -o $@ -m $(LOCALIZESDF) -l all
137
138.IF "$(XCU_LANG)" != ""
139$(XCU_LANG) : $(XSLDIR)/alllang.xsl
140.ENDIF
141
142$(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/%.xcu :| $(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcu
143.ELSE			# "$(WITH_LANG)"!=""
144$(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/%.xcu :| %.xcu
145.ENDIF			# "$(WITH_LANG)"!=""
146	@echo "Making:   " $(@:f)
147.IF "$(VERBOSE)" != "FALSE"
148    @echo --- creating locale dependent entries
149.ENDIF
150	@-$(MKDIRHIER) $(@:d)
151	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
152	            --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$*.xcs \
153	            --stringparam schemaRoot $(XCSROOTURL)/registry/schema \
154	            --stringparam locale {$(subst,/$(PACKAGEDIR)/$(@:f), $(subst,$(PROCESSOUT)/registry/res/, $@))} \
155	            --path $(DTDDIR)/registry \
156	            $(SYSXSLDIR)alllang.xsl $<
157
158# --- languagepack tag modules ---
159.IF "$(LANGUAGEPACKS)" != ""
160$(LANGUAGEPACKS) : $(XSLDIR)/delcomment.sed
161.ENDIF
162
163
164$(PROCESSOUT)/registry/spool/Langpack-%.xcu : Langpack.xcu.tmpl
165.IF "$(VERBOSE)" != "FALSE"
166    @echo --- creating a Langpack module for locale $*
167.ENDIF
168	-$(MKDIRHIER) $(@:d)
169    $(COMMAND_ECHO)$(SED) -e "s/__LANGUAGE__/$*/" -f $(XSLDIR)/delcomment.sed $< > $@
170
171
172# --- modules ---
173.IF "$(XCU_MODULES)" != ""
174$(XCU_MODULES) : $(XSLDIR)/alllang.xsl
175.ENDIF
176
177
178$(PROCESSOUT)/registry/spool/$(PACKAGEDIR)/%.xcu :| $$(@:b:s/-/./:b).xcu
179	@echo "Making:   " $(@:f)
180.IF "$(VERBOSE)" != "FALSE"
181    @echo --- creating a module file
182.ENDIF
183	@-$(MKDIRHIER) $(@:d)
184	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
185	            --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$(<:b).xcs \
186	            --stringparam schemaRoot $(XCSROOTURL)/registry/schema \
187	            --stringparam module $(subst,$(<:b)-, $(*)) \
188	            $(SYSXSLDIR)alllang.xsl $<
189
190.IF "$(XCUFILES)"!=""
191ALLTAR: \
192    $(XCU_DEFAULT) \
193    $(XCU_MODULES) \
194    $(XCU_LANG)
195
196$(XCU_DEFAULT) : $$(@:d:s!$(PROCESSOUT)/registry/data/!$(ABSXCSROOT)/registry/schema/!)$$(@:f:s/.xcu/.xcs/)
197
198.ENDIF			# "$(XCUFILES)"!=""
199
200