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=sun-report-builder
27PACKAGE = com$/sun$/star$/report$/pentaho
28# we have circular dependencies
29nodep=true
30# --- Settings -----------------------------------------------------
31.INCLUDE: settings.mk
32
33#----- compile .java files -----------------------------------------
34JARFILES        = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar
35.IF "$(SYSTEM_JFREEREPORT)" == "YES"
36EXTRAJARFILES += $(FLUTE_JAR) $(LIBBASE_JAR) $(LIBXML_JAR) $(JFREEREPORT_JAR) $(LIBLOADER_JAR) $(SAC_JAR) $(LIBLAYOUT_JAR) $(LIBSERIALIZER_JAR) $(LIBFONTS_JAR) $(LIBFORMULA_JAR) $(LIBREPOSITORY_JAR)
37.ELSE
38.INCLUDE :  $(SOLARBINDIR)/jfreereport_version.mk
39JARFILES += \
40	flute-$(FLUTE_VERSION).jar				            \
41	libserializer-$(LIBSERIALIZER_VERSION).jar			\
42	libbase-$(LIBBASE_VERSION).jar                      \
43	libfonts-$(LIBFONTS_VERSION).jar					\
44	libformula-$(LIBFORMULA_VERSION).jar				\
45	liblayout-$(LIBLAYOUT_VERSION).jar					\
46	libloader-$(LIBLOADER_VERSION).jar					\
47	librepository-$(LIBREPOSITORY_VERSION).jar			\
48	libxml-$(LIBXML_VERSION).jar						\
49	flow-engine-$(FLOW_ENGINE_VERSION).jar 	            \
50	sac.jar
51.ENDIF
52
53.IF "$(SYSTEM_APACHE_COMMONS)" == "YES"
54EXTRAJARFILES += $(COMMONS_LOGGING_JAR)
55.ELSE
56JARFILES += commons-logging-1.1.3.jar
57.ENDIF
58
59.IF "$(SYSTEM_JFREEREPORT)" == "YES" || "$(SYSTEM_APACHE_COMMONS)" == "YES"
60COMP=fix_system_libs
61.ENDIF
62
63JAVAFILES       := $(shell @$(FIND) . -name "*.java")
64# JAVACLASSFILES	= $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:s/.java/.class/))
65
66#----- copy .properties and .css files -----------------------------------------
67# external find gives / for 4nt too...
68# PROPERTYFILES := $(subst,/,$/ $(subst,./,$(CLASSDIR)$/$(PACKAGE)$/ $(shell @$(FIND) . -name "*.properties")))
69PROPERTYFILES := $(CLASSDIR)$/$(PACKAGE)$/configuration.properties \
70				 $(CLASSDIR)$/$(PACKAGE)$/module.properties \
71				 $(CLASSDIR)$/$(PACKAGE)$/parser$/selectors.properties
72
73# CSSFILES := $(subst,./,$(CLASSDIR)$/$(PACKAGE)$/ $(shell @$(FIND) . -name "*.css"))
74CSSFILES := $(CLASSDIR)$/$(PACKAGE)$/oasis-datastyle.css\
75			$(CLASSDIR)$/$(PACKAGE)$/oasis-draw.css\
76			$(CLASSDIR)$/$(PACKAGE)$/oasis-form.css\
77			$(CLASSDIR)$/$(PACKAGE)$/oasis-style.css\
78			$(CLASSDIR)$/$(PACKAGE)$/oasis-table.css\
79			$(CLASSDIR)$/$(PACKAGE)$/oasis-text.css\
80			$(CLASSDIR)$/$(PACKAGE)$/smil.css\
81			$(CLASSDIR)$/$(PACKAGE)$/star-office.css\
82			$(CLASSDIR)$/$(PACKAGE)$/star-report.css\
83			$(CLASSDIR)$/$(PACKAGE)$/star-rpt.css\
84			$(CLASSDIR)$/$(PACKAGE)$/svg.css\
85			$(CLASSDIR)$/$(PACKAGE)$/xsl-fo.css
86
87XSDFILES := $(CLASSDIR)$/$(PACKAGE)$/parser$/rpt-schema-v1.0-os.xsd \
88			$(CLASSDIR)$/$(PACKAGE)$/styles$/stylemapper.xsd
89
90XMLFILES := $(CLASSDIR)$/$(PACKAGE)$/styles$/stylemapper.xml
91
92TXTFILES := $(CLASSDIR)$/$(PACKAGE)$/parser$/style-mapping.txt
93
94
95#----- make a jar from compiled files ------------------------------
96
97JARCLASSDIRS    = .
98JARTARGET       = $(TARGET).jar
99JARCOMPRESS 	= TRUE
100CUSTOMMANIFESTFILE = Manifest.mf
101
102
103# --- Targets ------------------------------------------------------
104.INCLUDE :  target.mk
105
106.IF "$(JARTARGETN)"!=""
107$(JARTARGETN) : $(COMP) $(PROPERTYFILES) $(CSSFILES) $(XSDFILES) $(TXTFILES) $(XMLFILES)
108.ENDIF          # "$(JARTARGETN)"!=""
109
110fix_system_libs: $(JARMANIFEST)
111	@echo "Fix Java Class-Path entry for libraries from system."
112.IF ("$(SYSTEM_JFREEREPORT)" != "YES" && "$(SYSTEM_APACHE_COMMONS)" == "YES")
113	@$(SED) -r -e "s#commons-logging-1.1.1.jar#file://$(COMMONS_LOGGING_JAR)#" \
114		-i $<
115.ELIF ("$(SYSTEM_JFREEREPORT)" == "YES" && "$(SYSTEM_APACHE_COMMONS)" != "YES")
116	@$(SED) '/flute/,/sac/d' -i ../../../../../../$(INPATH)/class/sun-report-builder/META-INF/MANIFEST.MF
117	@$(SED) -r -e "s#^Class-Path.*#\0\n  file://$(LIBBASE_JAR)\n  file://$(SAC_JAR)\n  file://$(LIBXML_JAR)\n\
118  file://$(FLUTE_JAR)\n  file://$(JFREEREPORT_JAR)\n  file://$(LIBLAYOUT_JAR)\n  file://$(LIBLOADER_JAR)\n  file://$(LIBFORMULA_JAR)\n\
119  file://$(LIBREPOSITORY_JAR)\n  file://$(LIBFONTS_JAR)\n  file://$(LIBSERIALIZER_JAR)\n  commons-logging-1.1.1.jar#" \
120	-i $<
121.ELIF ("$(SYSTEM_JFREEREPORT)" == "YES" && "$(SYSTEM_APACHE_COMMONS)" == "YES")
122	@$(SED) '/flute/,/sac/d' -i ../../../../../../$(INPATH)/class/sun-report-builder/META-INF/MANIFEST.MF
123	@$(SED) -r -e "s#^Class-Path.*#\0\n  file://$(LIBBASE_JAR)\n  file://$(SAC_JAR)\n  file://$(LIBXML_JAR)\n\
124  file://$(FLUTE_JAR)\n  file://$(JFREEREPORT_JAR)\n  file://$(LIBLAYOUT_JAR)\n  file://$(LIBLOADER_JAR)\n  file://$(LIBFORMULA_JAR)\n\
125  file://$(LIBREPOSITORY_JAR)\n  file://$(LIBFONTS_JAR)\n  file://$(LIBSERIALIZER_JAR)\n  file://$(COMMONS_LOGGING_JAR)#" \
126	-i $<
127.ENDIF
128
129$(CLASSDIR)$/$(PACKAGE)$/%.properties : %.properties
130	@@-$(MKDIRHIER) $(@:d)
131    $(COPY) $< $@
132
133$(CLASSDIR)$/$(PACKAGE)$/%.css : %.css
134	@@-$(MKDIRHIER) $(@:d)
135    $(COPY) $< $@
136
137$(CLASSDIR)$/$(PACKAGE)$/%.xsd : %.xsd
138	@@-$(MKDIRHIER) $(@:d)
139    $(COPY) $< $@
140
141$(CLASSDIR)$/$(PACKAGE)$/%.xml : %.xml
142	@@-$(MKDIRHIER) $(@:d)
143    $(COPY) $< $@
144
145$(CLASSDIR)$/$(PACKAGE)$/%.txt : %.txt
146	@@-$(MKDIRHIER) $(@:d)
147    $(COPY) $< $@
148
149