1 #************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: tg_config.mk,v $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 PACKAGEDIR
*:=$(subst,.
,$/ $(PACKAGE
))
33 XSLTPACKAGEDIR
*:=$(subst,.
,/ $(PACKAGE
))
34 XCSROOTURL
!:=$(ABSXCSROOT
)
36 XCSROOTURL
!:=file
:///$(subst,\
,/ $(XCSROOTURL
))
38 SYSXSLDIR
*:=$(XSLDIR
)$/
45 # remove unnecessary info from the component schemas
46 XCS_TRIM
=$(PROCESSOUT
)$/registry
$/schema
$/$(PACKAGEDIR
)$/{$(XCSFILES
)}
48 # transform xcs format to properties format
49 # XCS_RESOURCES=$(foreach,i,$(XCSFILES) $(MISC)$/registry$/res$/{$(alllangiso)}$/$(PACKAGEDIR)$/$(i:b).properties)
53 .ENDIF
# "$(XCSFILES)"!=""
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
62 $(PROCESSOUT
)$/registry
$/schema
$/$(PACKAGEDIR
)$/%.xcs
: %.xcs
63 @echo
-------------+ validating and stripping schema files
65 $(XSLTPROC
) --nonet
-o
$(normpath
$(PWD
)$/$(@
:d
)$*.val
) \
66 --stringparam componentName
$(PACKAGE
).
$* \
67 $(SYSXSLDIR
)schema_val.xsl
$<
68 $(XSLTPROC
) --nonet
-o
$(normpath
$(PWD
)$/$(@
:d
)$*.san
) \
69 $(SYSXSLDIR
)sanity.xsl
$<
70 $(XSLTPROC
) --nonet
-o
$(normpath
$(PWD
)$/$@
) \
71 $(SYSXSLDIR
)schema_trim.xsl
$<
72 +-$(RM
) $(@
:d
)$*.val
> $(NULLDEV
)
73 +-$(RM
) $(@
:d
)$*.san
> $(NULLDEV
)
75 $(PROCESSOUT
)$/merge
$/$(PACKAGEDIR
)$/%.xcs
: %.xcs
76 # just a copy for now - insert "cfgex" commandline when required
80 # Create properties files for localized <info> contents (Currently not built)
81 .IF
"$(XCS_RESOURCES)" != ""
82 $(XCS_RESOURCES
) : $(XSLDIR
)$/resource.xsl
85 $(PROCESSOUT
)$/registry
$/res
$/{$(alllangiso
)}$/$(PACKAGEDIR
)$/%.properties
:|
$(PROCESSOUT
)$/merge
$/$(PACKAGEDIR
)$/%.xcs
86 @echo
-------------+ creating locale dependent resource bundles
88 $(XSLTPROC
) --nonet
-o
$(normpath
$(PWD
)$/$@
) \
89 --stringparam locale
{$(subst,$/$(PACKAGEDIR
)$/$(@
:f
), $(subst,$(PROCESSOUT
)$/registry
$/res
$/, $@
))} \
90 $(SYSXSLDIR
)resource.xsl
$<
97 XCU_DEFAULT
=$(PROCESSOUT
)$/registry
$/data
$/$(PACKAGEDIR
)$/{$(XCUFILES
)}
98 XCU_MODULES
=$(foreach,i
,$(MODULEFILES
) $(PROCESSOUT
)$/registry
$/spool
$/$(PACKAGEDIR
)$/$(i
))
99 XCU_LANG
=$(foreach,i
,$(LOCALIZEDFILES
) $(PROCESSOUT
)$/registry
$/res
$/{$(alllangiso
)}$/$(PACKAGEDIR
)$/$(i
))
100 .ENDIF
# "$(XCUFILES)"!=""
102 .IF
"$(XCU_DEFAULT)" != ""
103 $(XCU_DEFAULT
) : $(DTDDIR
)$/registry
$/component-update.dtd \
104 $(XSLDIR
)$/data_val.xsl \
105 $(XSLDIR
)$/alllang.xsl
108 $(PROCESSOUT
)$/registry
$/data
$/$(PACKAGEDIR
)$/%.xcu
: %.xcu
109 @echo
-------------+ validating and creating a locale independent file
111 $(XSLTPROC
) --nonet
-o
$(normpath
$(PWD
)$/$(@
:d
)$*.val
) \
112 --stringparam xcs
$(XCSROOTURL
)/registry
/schema
/$(XSLTPACKAGEDIR
)/$*.xcs \
113 --stringparam schemaRoot
$(XCSROOTURL
)/registry
/schema \
114 $(SYSXSLDIR
)data_val.xsl
$<
115 $(XSLTPROC
) --nonet
-o
$(normpath
$(PWD
)$/$@
) \
116 --stringparam xcs
$(XCSROOTURL
)/registry
/schema
/$(XSLTPACKAGEDIR
)/$*.xcs \
117 --stringparam schemaRoot
$(XCSROOTURL
)/registry
/schema \
118 $(SYSXSLDIR
)alllang.xsl
$<
119 +-$(RM
) $(@
:d
)$*.val
> $(NULLDEV
)
121 # --- localizations ---
122 .IF
"$(WITH_LANG)"!=""
123 .IF
"$(XCU_LANG)"!=""
124 $(XCU_LANG
) : localize.sdf
125 .ENDIF
# "$(XCU_LANG)"!=""
127 $(PROCESSOUT
)$/merge
$/$(PACKAGEDIR
)$/%.xcu
: %.xcu
129 $(CFGEX
) -p
$(PRJNAME
) -i
$(@
:f
) -o
$@
-m localize.sdf
-l
all
131 .IF
"$(XCU_LANG)" != ""
132 $(XCU_LANG
) : $(XSLDIR
)$/alllang.xsl
135 $(PROCESSOUT
)$/registry
$/res
$/{$(alllangiso
)}$/$(PACKAGEDIR
)$/%.xcu
:|
$(PROCESSOUT
)$/merge
$/$(PACKAGEDIR
)$/%.xcu
136 .ELSE
# "$(WITH_LANG)"!=""
137 $(PROCESSOUT
)$/registry
$/res
$/{$(alllangiso
)}$/$(PACKAGEDIR
)$/%.xcu
:|
%.xcu
138 .ENDIF
# "$(WITH_LANG)"!=""
139 @echo
------------- creating locale dependent entries
141 $(XSLTPROC
) --nonet
-o
$(normpath
$(PWD
)$/$@
) \
142 --stringparam xcs
$(XCSROOTURL
)/registry
/schema
/$(XSLTPACKAGEDIR
)/$*.xcs \
143 --stringparam schemaRoot
$(XCSROOTURL
)/registry
/schema \
144 --stringparam locale
{$(subst,$/$(PACKAGEDIR
)$/$(@
:f
), $(subst,$(PROCESSOUT
)$/registry
$/res
$/, $@
))} \
145 $(SYSXSLDIR
)alllang.xsl
$<
147 # --- languagepack tag modules ---
148 .IF
"$(LANGUAGEPACKS)" != ""
149 $(LANGUAGEPACKS
) : $(XSLDIR
)$/delcomment.sed
153 $(PROCESSOUT
)$/registry
$/spool
$/Langpack-
%.xcu
: Langpack.xcu.tmpl
154 @echo
-------------+ creating a Langpack module for locale
$*
156 $(SED
) -e
"s/__LANGUAGE__/$*/" -f
$(XSLDIR
)$/delcomment.sed
$< > $@
160 .IF
"$(XCU_MODULES)" != ""
161 $(XCU_MODULES
) : $(XSLDIR
)$/alllang.xsl
165 $(PROCESSOUT
)$/registry
$/spool
$/$(PACKAGEDIR
)$/%.xcu
:|
$$(@
:b
:s
/-/.
/:b
).xcu
166 @echo
-------------+ creating a module file
168 $(XSLTPROC
) --nonet
-o
$(normpath
$(PWD
)$/$@
) \
169 --stringparam xcs
$(XCSROOTURL
)/registry
/schema
/$(XSLTPACKAGEDIR
)/$(<:b
).xcs \
170 --stringparam schemaRoot
$(XCSROOTURL
)/registry
/schema \
171 --stringparam module
$(subst,$(<:b
)-, $(*)) \
172 $(SYSXSLDIR
)alllang.xsl
$<
174 .IF
"$(XCUFILES)"!=""
180 $(XCU_DEFAULT
) : $$(@
:d
:s
!$(PROCESSOUT
)$/registry
$/data
$/!$(ABSXCSROOT
)$/registry
$/schema
$/!)$$(@
:f
:s
/.xcu
/.xcs
/)
182 .ENDIF
# "$(XCUFILES)"!=""