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)$/THIRDPARTYREADMELICENSE.html \
63			$(ZIP1DIR)$/readme_en-US.html \
64			$(ZIP1DIR)$/readme_en-US.txt
65
66.IF "$(GUI)"!="WNT"
67TXTFILES:=$(foreach,i,$(alllangiso) $(ZIP1DIR)$/registration$/LICENSE_$i)
68LICLINES:=$(foreach,i,$(TXTFILES)  <license-text xlink:href="registration/$(i:f)" lang="$(subst,LICENSE_, $(i:f))" license-id="$(subst,LICENSE_, $(i:f))" />)
69.ELSE   # "$(GUI)"!="WNT"
70TXTFILES:=$(foreach,i,$(alllangiso) $(ZIP1DIR)$/registration$/license_$i.txt)
71LICLINES:=$(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)))" />)
72.ENDIF  # "$(GUI)"!="WNT"
73
74# --- Targets ----------------------------------
75.INCLUDE : target.mk
76
77.IF "$(ZIP1TARGETN)"!=""
78$(ZIP1TARGETN) :  $(TXTFILES) $(XMLFILES) $(HTMLFILES) $(ODR_FILES)
79.ENDIF          # "$(ZIP1TARGETN)"!="
80
81$(MISC)$/template_update_report.flag : $(XCU_FILES)
82	$(TOUCH) $@
83
84$(ZIP1DIR)$/description.xml : pre.xml post.xml
85	@@-$(MKDIRHIER) $(@:d)
86	@@-$(RM) $(ZIP1DIR)$/description.xml
87	$(TYPE) pre.xml > $@
88	$(TYPE) $(mktmp  $(LICLINES)) >> $@
89	$(TYPE) post.xml | $(SED) s/#VERSION#/$(EXTENSION_VERSION)/ >> $@
90
91$(ZIP1DIR)$/registration$/license_%.txt : $(SOLARBINDIR)$/osl$/license_%.txt
92     @@-$(MKDIRHIER) $(@:d)
93    $(COPY) $< $@
94
95$(ZIP1DIR)$/registration$/LICENSE_% : $(SOLARBINDIR)$/osl$/LICENSE_%
96     @@-$(MKDIRHIER) $(@:d)
97    $(COPY) $< $@
98
99$(ZIP1DIR)$/registry$/data$/org$/openoffice$/Office$/%.xcu : $(MISC)$/template$/registry$/data$/org$/openoffice$/Office$/%.xcu
100	@@-$(MKDIRHIER) $(@:d)
101    $(COPY) $< $@
102
103$(ZIP1DIR)$/META-INF$/manifest.xml : manifest.xml $(MISC)$/template_update_report.flag
104	@@-$(MKDIRHIER) $(@:d)
105	$(PERL) $(SOLARENV)$/bin$/makemani.pl $(PRJ)$/template$/manifest.xml $(ZIP1DIR) registry $(@:d:d)
106
107$(ZIP1DIR)$/readme_en-US.% : $(PRJ)$/license$/readme_en-US.%
108	@@-$(MKDIRHIER) $(@:d)
109    $(COPY) $< $@
110
111$(ZIP1DIR)$/THIRDPARTYREADMELICENSE.html : $(PRJ)$/license$/THIRDPARTYREADMELICENSE.html
112    @@-$(MKDIRHIER) $(@:d)
113    $(COPY) $< $@
114
115.ELSE			# "$(SOLAR_JAVA)"!=""
116.INCLUDE : target.mk
117.ENDIF			# "$(SOLAR_JAVA)"!=""
118#
119