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
24PRJ=..
25PRJNAME=reportbuilder
26TARGET=rpt_templates
27
28# ???
29no_common_build_zip=true
30
31EXTENSION_VERSION_BASE=1.0.0
32.IF "$(DBG_LEVEL)" == "0"
33    EXTENSION_VERSION=$(EXTENSION_VERSION_BASE)
34.ELSE
35    EXTENSION_VERSION=$(EXTENSION_VERSION_BASE).$(BUILD)
36.ENDIF
37
38# --- Settings ----------------------------------
39.INCLUDE :  settings.mk
40# ------------------------------------------------------------------
41
42# create Extension -----------------------------
43
44.IF "$(SOLAR_JAVA)"!=""
45
46ZIP1TARGET=sun-report-builder-templates
47ZIP1FLAGS=-r
48ZIP1DIR=$(MISC)$/templates
49ZIP1LIST=*
50ZIP1EXT=.oxt
51
52XMLFILES := $(ZIP1DIR)$/description.xml \
53			$(ZIP1DIR)$/META-INF$/manifest.xml
54
55XCU_FILES := $(ZIP1DIR)$/registry$/data$/org$/openoffice$/Office$/Paths.xcu
56
57ODR_FILES := \
58	$(ZIP1DIR)$/template$/wizard$/report$/finance.odr \
59	$(ZIP1DIR)$/template$/wizard$/report$/finance_2.odr \
60	$(ZIP1DIR)$/template$/wizard$/report$/yellow.odr
61
62HTMLFILES := $(ZIP1DIR)$/readme_en-US.html \
63		$(ZIP1DIR)$/readme_en-US.txt
64
65.IF "$(GUI)"!="WNT"
66TXTFILES:=$(foreach,i,$(alllangiso) $(ZIP1DIR)$/registration$/LICENSE_$i)
67LICLINES:=$(foreach,i,$(TXTFILES)  <license-text xlink:href="registration/$(i:f)" lang="$(subst,LICENSE_, $(i:f))" license-id="$(subst,LICENSE_, $(i:f))" />)
68.ELSE   # "$(GUI)"!="WNT"
69TXTFILES:=$(foreach,i,$(alllangiso) $(ZIP1DIR)$/registration$/license_$i.txt)
70LICLINES:=$(foreach,i,$(TXTFILES)  <license-text xlink:href="registration/$(i:f)" lang="$(subst,.txt, $(subst,license_, $(i:f)))" license-id="$(subst,.txt, $(subst,license_, $(i:f)))" />)
71.ENDIF  # "$(GUI)"!="WNT"
72
73# --- Targets ----------------------------------
74.INCLUDE : target.mk
75
76.IF "$(ZIP1TARGETN)"!=""
77$(ZIP1TARGETN) :  $(TXTFILES) $(XMLFILES) $(HTMLFILES) $(ODR_FILES)
78.ENDIF          # "$(ZIP1TARGETN)"!="
79
80$(MISC)$/template_update_report.flag : $(XCU_FILES)
81	$(TOUCH) $@
82
83$(ZIP1DIR)$/description.xml : pre.xml post.xml
84	@@-$(MKDIRHIER) $(@:d)
85	@@-$(RM) $(ZIP1DIR)$/description.xml
86	$(TYPE) pre.xml > $@
87	$(TYPE) $(mktmp  $(LICLINES)) >> $@
88	$(TYPE) post.xml | $(SED) s/#VERSION#/$(EXTENSION_VERSION)/ >> $@
89
90$(ZIP1DIR)$/registration$/license_%.txt : $(SOLARBINDIR)$/osl$/license_%.txt
91     @@-$(MKDIRHIER) $(@:d)
92    $(COPY) $< $@
93
94$(ZIP1DIR)$/registration$/LICENSE_% : $(SOLARBINDIR)$/osl$/LICENSE_%
95     @@-$(MKDIRHIER) $(@:d)
96    $(COPY) $< $@
97
98$(ZIP1DIR)$/registry$/data$/org$/openoffice$/Office$/%.xcu : $(MISC)$/template$/registry$/data$/org$/openoffice$/Office$/%.xcu
99	@@-$(MKDIRHIER) $(@:d)
100    $(COPY) $< $@
101
102$(ZIP1DIR)$/META-INF$/manifest.xml : manifest.xml $(MISC)$/template_update_report.flag
103	@@-$(MKDIRHIER) $(@:d)
104	$(PERL) $(SOLARENV)$/bin$/makemani.pl $(PRJ)$/template$/manifest.xml $(ZIP1DIR) registry $(@:d:d)
105
106$(ZIP1DIR)$/readme_en-US.% : $(PRJ)$/license$/readme_en-US.%
107	@@-$(MKDIRHIER) $(@:d)
108    $(COPY) $< $@
109
110.ELSE			# "$(SOLAR_JAVA)"!=""
111.INCLUDE : target.mk
112.ENDIF			# "$(SOLAR_JAVA)"!=""
113#
114