xref: /aoo41x/main/solenv/inc/tg_config.mk (revision cdf0e10c)
1#************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28PACKAGEDIR*:=$(subst,.,/ $(PACKAGE))
29XSLTPACKAGEDIR*:=$(subst,.,/ $(PACKAGE))
30XCSROOTURL!:=$(ABSXCSROOT)
31.IF $(GUI)==WNT
32XCSROOTURL!:=file:///$(subst,\,/ $(XCSROOTURL))
33.ENDIF
34SYSXSLDIR*:=$(XSLDIR)/
35.IF $(GUI)==OS2
36XCSROOTURL!:=$(subst,\,/ $(XCSROOTURL))
37SYSXSLDIR!:=$(subst,\,/ $(SYSXSLDIR))/
38.ENDIF
39
40#
41# --- XCS ---
42#
43
44.IF "$(XCSFILES)"!=""
45# remove unnecessary info from the component schemas
46XCS_TRIM=$(PROCESSOUT)/registry/schema/$(PACKAGEDIR)/{$(XCSFILES)}
47
48# transform xcs format to properties format
49# XCS_RESOURCES=$(foreach,i,$(XCSFILES) $(MISC)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/$(i:b).properties)
50
51ALLTAR: \
52    $(XCS_TRIM)
53.ENDIF			# "$(XCSFILES)"!=""
54
55.IF "$(XCS_TRIM)" != ""
56$(XCS_TRIM) :   $(DTDDIR)/registry/component-schema.dtd \
57                $(XSLDIR)/schema_val.xsl \
58                $(XSLDIR)/sanity.xsl \
59                $(XSLDIR)/schema_trim.xsl
60.ENDIF
61
62$(PROCESSOUT)/registry/schema/$(PACKAGEDIR)/%.xcs : %.xcs
63	@echo "Making:   " $(@:f)
64.IF "$(VERBOSE)" != "FALSE"
65    @echo --- validating and stripping schema files
66.ENDIF
67	@-$(MKDIRHIER) $(@:d)
68	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $(@:d))$*.val) \
69	            --stringparam componentName $(PACKAGE).$* \
70	            $(SYSXSLDIR)schema_val.xsl $<
71	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $(@:d))$*.san) \
72	            $(SYSXSLDIR)sanity.xsl $<
73	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
74	            $(SYSXSLDIR)schema_trim.xsl $<
75	@+-$(RM) $(@:d)$*.val > $(NULLDEV)
76	@+-$(RM) $(@:d)$*.san > $(NULLDEV)
77
78$(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcs : %.xcs
79# just a copy for now - insert "cfgex" commandline when required
80	$(COMMAND_ECHO)-$(MKDIRHIER) $(@:d)
81	$(COMMAND_ECHO)$(COPY) $< $@
82
83# Create properties files for localized <info> contents (Currently not built)
84.IF "$(XCS_RESOURCES)" != ""
85$(XCS_RESOURCES) :   $(XSLDIR)/resource.xsl
86.ENDIF
87
88$(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/%.properties :| $(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcs
89	@echo "Making:   " $(@:f)
90.IF "$(VERBOSE)" != "FALSE"
91    @echo --- creating locale dependent resource bundles
92.ENDIF
93	@-$(MKDIRHIER) $(@:d)
94	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
95	            --stringparam locale {$(subst,/$(PACKAGEDIR)/$(@:f), $(subst,$(PROCESSOUT)/registry/res/, $@))} \
96	            $(SYSXSLDIR)resource.xsl $<
97
98#
99# --- XCU ---
100#
101
102.IF "$(XCUFILES)"!=""
103XCU_DEFAULT =$(PROCESSOUT)/registry/data/$(PACKAGEDIR)/{$(XCUFILES)}
104XCU_MODULES =$(foreach,i,$(MODULEFILES) $(PROCESSOUT)/registry/spool/$(PACKAGEDIR)/$(i))
105XCU_LANG    =$(foreach,i,$(LOCALIZEDFILES) $(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/$(i))
106.ENDIF			# "$(XCUFILES)"!=""
107
108.IF "$(XCU_DEFAULT)" != ""
109$(XCU_DEFAULT) : $(DTDDIR)/registry/component-update.dtd \
110                 $(XSLDIR)/data_val.xsl \
111                 $(XSLDIR)/alllang.xsl
112.ENDIF
113
114$(PROCESSOUT)/registry/data/$(PACKAGEDIR)/%.xcu : %.xcu
115	@echo "Making:   " $(@:f)
116.IF "$(VERBOSE)" != "FALSE"
117    @echo --- validating and creating a locale independent file
118.ENDIF
119	@-$(MKDIRHIER) $(@:d)
120	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $(@:d))$*.val) \
121	            --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$*.xcs \
122	            --stringparam schemaRoot $(XCSROOTURL)/registry/schema \
123		    --path $(DTDDIR)/registry \
124	            $(SYSXSLDIR)data_val.xsl $<
125	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
126	            --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$*.xcs \
127	            --stringparam schemaRoot $(XCSROOTURL)/registry/schema \
128		    --path $(DTDDIR)/registry \
129	            $(SYSXSLDIR)alllang.xsl $<
130	@+-$(RM) $(@:d)$*.val > $(NULLDEV)
131
132# --- localizations ---
133.IF "$(WITH_LANG)"!=""
134.IF "$(XCU_LANG)"!=""
135$(XCU_LANG) : $(LOCALIZESDF)
136.ENDIF			# "$(XCU_LANG)"!=""
137
138$(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcu : %.xcu
139	@-$(MKDIRHIER) $(@:d)
140	$(COMMAND_ECHO)$(CFGEX)  -p $(PRJNAME) -i $(@:f) -o $@ -m $(LOCALIZESDF) -l all
141
142.IF "$(XCU_LANG)" != ""
143$(XCU_LANG) : $(XSLDIR)/alllang.xsl
144.ENDIF
145
146$(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/%.xcu :| $(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcu
147.ELSE			# "$(WITH_LANG)"!=""
148$(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/%.xcu :| %.xcu
149.ENDIF			# "$(WITH_LANG)"!=""
150	@echo "Making:   " $(@:f)
151.IF "$(VERBOSE)" != "FALSE"
152    @echo --- creating locale dependent entries
153.ENDIF
154	@-$(MKDIRHIER) $(@:d)
155	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
156	            --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$*.xcs \
157	            --stringparam schemaRoot $(XCSROOTURL)/registry/schema \
158	            --stringparam locale {$(subst,/$(PACKAGEDIR)/$(@:f), $(subst,$(PROCESSOUT)/registry/res/, $@))} \
159	            --path $(DTDDIR)/registry \
160	            $(SYSXSLDIR)alllang.xsl $<
161
162# --- languagepack tag modules ---
163.IF "$(LANGUAGEPACKS)" != ""
164$(LANGUAGEPACKS) : $(XSLDIR)/delcomment.sed
165.ENDIF
166
167
168$(PROCESSOUT)/registry/spool/Langpack-%.xcu : Langpack.xcu.tmpl
169.IF "$(VERBOSE)" != "FALSE"
170    @echo --- creating a Langpack module for locale $*
171.ENDIF
172	-$(MKDIRHIER) $(@:d)
173    $(COMMAND_ECHO)$(SED) -e "s/__LANGUAGE__/$*/" -f $(XSLDIR)/delcomment.sed $< > $@
174
175
176# --- modules ---
177.IF "$(XCU_MODULES)" != ""
178$(XCU_MODULES) : $(XSLDIR)/alllang.xsl
179.ENDIF
180
181
182$(PROCESSOUT)/registry/spool/$(PACKAGEDIR)/%.xcu :| $$(@:b:s/-/./:b).xcu
183	@echo "Making:   " $(@:f)
184.IF "$(VERBOSE)" != "FALSE"
185    @echo --- creating a module file
186.ENDIF
187	@-$(MKDIRHIER) $(@:d)
188	$(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
189	            --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$(<:b).xcs \
190	            --stringparam schemaRoot $(XCSROOTURL)/registry/schema \
191	            --stringparam module $(subst,$(<:b)-, $(*)) \
192	            $(SYSXSLDIR)alllang.xsl $<
193
194.IF "$(XCUFILES)"!=""
195ALLTAR: \
196    $(XCU_DEFAULT) \
197    $(XCU_MODULES) \
198    $(XCU_LANG)
199
200$(XCU_DEFAULT) : $$(@:d:s!$(PROCESSOUT)/registry/data/!$(ABSXCSROOT)/registry/schema/!)$$(@:f:s/.xcu/.xcs/)
201
202.ENDIF			# "$(XCUFILES)"!=""
203
204