tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / odk / examples / DevelopersGuide / OfficeDev / Linguistic / Makefile
blob95b6204c003a8d0e79916e1c662fd92d0c62fed0
1 #*************************************************************************
3 # The Contents of this file are made available subject to the terms of
4 # the BSD license.
5 #
6 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # All rights reserved.
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions
11 # are met:
12 # 1. Redistributions of source code must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
14 # 2. Redistributions in binary form must reproduce the above copyright
15 # notice, this list of conditions and the following disclaimer in the
16 # documentation and/or other materials provided with the distribution.
17 # 3. Neither the name of Sun Microsystems, Inc. nor the names of its
18 # contributors may be used to endorse or promote products derived
19 # from this software without specific prior written permission.
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
30 # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
31 # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #**************************************************************************
35 # Builds the OfficeDevLinguistic examples of the Developers Guide.
37 PRJ=../../../..
38 SETTINGS=$(PRJ)/settings
40 include $(SETTINGS)/settings.mk
41 include $(SETTINGS)/std.mk
43 # Define non-platform/compiler specific settings
44 EXAMPLE_NAME=OfficeDevLinguisticExample
45 OUT_COMP_CLASS = $(OUT_CLASS)/$(EXAMPLE_NAME)
47 COMP1_NAME=SampleHyphenator
48 COMP1_PACKAGE = $(OUT_BIN)/$(COMP1_NAME).$(UNOOXT_EXT)
49 COMP1_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP1_NAME).$(UNOOXT_EXT)")
50 COMP1_JAR_NAME = $(COMP1_NAME).uno.jar
51 COMP1_JAR = $(OUT_COMP_CLASS)/$(COMP1_JAR_NAME)
52 COMP1_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMP1_NAME).uno.Manifest
53 COMP1_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP1_NAME)/META-INF/manifest.xml
54 COMP1_COMPONENTS=$(COMP1_NAME).components
56 COMP2_NAME=SampleSpellChecker
57 COMP2_PACKAGE = $(OUT_BIN)/$(COMP2_NAME).$(UNOOXT_EXT)
58 COMP2_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP2_NAME).$(UNOOXT_EXT)")
59 COMP2_JAR_NAME = $(COMP2_NAME).uno.jar
60 COMP2_JAR = $(OUT_COMP_CLASS)/$(COMP2_JAR_NAME)
61 COMP2_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMP2_NAME).uno.Manifest
62 COMP2_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP2_NAME)/META-INF/manifest.xml
63 COMP2_COMPONENTS=$(COMP2_NAME).components
65 COMP3_NAME=SampleThesaurus
66 COMP3_PACKAGE = $(OUT_BIN)/$(COMP3_NAME).$(UNOOXT_EXT)
67 COMP3_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP3_NAME).$(UNOOXT_EXT)")
68 COMP3_JAR_NAME = $(COMP3_NAME).uno.jar
69 COMP3_JAR = $(OUT_COMP_CLASS)/$(COMP3_JAR_NAME)
70 COMP3_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMP3_NAME).uno.Manifest
71 COMP3_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP3_NAME)/META-INF/manifest.xml
72 COMP3_COMPONENTS=$(COMP2_NAME).components
74 APP1_NAME=LinguisticExamples
75 APP1_JAR=$(OUT_COMP_CLASS)/$(APP1_NAME).jar
77 REGISTERFLAG = $(OUT_MISC)/devguide_officedevlinguistic_register_component.flag
79 JAVAFILES = \
80 OneInstanceFactory.java \
81 PropChgHelper.java \
82 PropChgHelper_Hyph.java \
83 PropChgHelper_Spell.java \
84 XHyphenatedWord_impl.java \
85 XMeaning_impl.java \
86 XPossibleHyphens_impl.java \
87 XSpellAlternatives_impl.java \
88 SampleHyphenator.java \
89 SampleSpellChecker.java \
90 SampleThesaurus.java
92 CLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(JAVAFILES))
94 $(COMP1_NAME)_CLASSFILES = XHyphenatedWord_impl.class \
95 XPossibleHyphens_impl.class \
96 PropChgHelper.class \
97 PropChgHelper_Hyph.class \
98 OneInstanceFactory.class \
99 $(COMP1_NAME).class
101 $(COMP2_NAME)_CLASSFILES = XSpellAlternatives_impl.class \
102 PropChgHelper_Spell.class \
103 PropChgHelper.class \
104 OneInstanceFactory.class \
105 $(COMP2_NAME).class
107 $(COMP3_NAME)_CLASSFILES = XMeaning_impl.class \
108 OneInstanceFactory.class \
109 $(COMP3_NAME).class
111 SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
112 $(PATH_SEPARATOR)$(OUT_COMP_CLASS))
114 .PHONY: ALL
115 ALL : $(EXAMPLE_NAME)
117 include $(SETTINGS)/stdtarget.mk
119 $(OUT_COMP_CLASS)/%.Manifest :
120 -$(MKDIR) $(subst /,$(PS),$(@D))
121 @echo RegistrationClassName: $(basename $(basename $(@F)))> $@
123 $(CLASSFILES) : $(JAVAFILES)
124 -$(MKDIR) $(subst /,$(PS),$(@D))
125 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $(JAVAFILES)
127 # NOTE: because of gnu make problems with full qualified paths, the pattern
128 # rules for the component jars and the packages doesn't work proper and we
129 # defined explicit rules
131 # rule for component package manifest
132 $(OUT_COMP_CLASS)/%/manifest.xml :
133 -$(MKDIR) $(subst /,$(PS),$(@D))
134 @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
135 @echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@
136 @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
137 @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)" >> $@
138 @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).components$(QM)"/$(CSEP) >> $@
139 @echo $(OSEP)/manifest:manifest$(CSEP) >> $@
141 $(COMP1_JAR) : $(COMP1_MANIFESTFILE) $(CLASSFILES)
142 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
143 -$(MKDIR) $(subst /,$(PS),$(@D))
144 cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(<F) $($(basename $(basename $(@F)))_CLASSFILES)
146 $(COMP1_PACKAGE) : $(COMP1_JAR) $(COMP1_UNOPKG_MANIFEST) $(COMP1_COMPONENTS)
147 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
148 -$(MKDIR) $(subst /,$(PS),$(@D))
149 $(SDK_ZIP) $@ $(COMP1_COMPONENTS)
150 cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) -u ../../bin/$(@F) $(<F)
151 cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
153 $(COMP2_JAR) : $(COMP2_MANIFESTFILE) $(CLASSFILES)
154 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
155 -$(MKDIR) $(subst /,$(PS),$(@D))
156 cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(<F) $($(basename $(basename $(@F)))_CLASSFILES)
158 $(COMP2_PACKAGE) : $(COMP2_JAR) $(COMP2_UNOPKG_MANIFEST) $(COMP2_COMPONENTS)
159 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
160 -$(MKDIR) $(subst /,$(PS),$(@D))
161 $(SDK_ZIP) $@ $(COMP2_COMPONENTS)
162 cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) -u ../../bin/$(@F) $(<F)
163 cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
165 $(COMP3_JAR) : $(COMP3_MANIFESTFILE) $(CLASSFILES)
166 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
167 -$(MKDIR) $(subst /,$(PS),$(@D))
168 cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(<F) $($(basename $(basename $(@F)))_CLASSFILES)
170 $(COMP3_PACKAGE) : $(COMP3_JAR) $(COMP3_UNOPKG_MANIFEST) $(COMP3_COMPONENTS)
171 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
172 -$(MKDIR) $(subst /,$(PS),$(@D))
173 $(SDK_ZIP) $@ $(COMP3_COMPONENTS)
174 cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) -u ../../bin/$(@F) $(<F)
175 cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
177 $(REGISTERFLAG) : $(COMP1_PACKAGE) $(COMP2_PACKAGE) $(COMP3_PACKAGE)
178 ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
179 -$(MKDIR) $(subst /,$(PS),$(@D))
180 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
181 $(DEPLOYTOOL) $(COMP1_PACKAGE_URL)
182 $(DEPLOYTOOL) $(COMP2_PACKAGE_URL)
183 $(DEPLOYTOOL) $(COMP3_PACKAGE_URL)
184 @echo flagged > $(subst /,$(PS),$@)
185 else
186 @echo --------------------------------------------------------------------------------
187 @echo If you want to install your component automatically, please set the environment
188 @echo variable SDK_AUTO_DEPLOYMENT = YES. But note that auto deployment is only
189 @echo possible if no office instance is running.
190 @echo --------------------------------------------------------------------------------
191 endif
193 $(OUT_COMP_CLASS)/%.class : %.java
194 -$(MKDIR) $(subst /,$(PS),$(@D))
195 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $<
197 $(OUT_COMP_CLASS)/%.mf :
198 -$(MKDIR) $(subst /,$(PS),$(@D))
199 @echo Main-Class: com.sun.star.lib.loader.Loader> $@
200 $(ECHOLINE)>> $@
201 @echo Name: com/sun/star/lib/loader/Loader.class>> $@
202 @echo Application-Class: $*>> $@
204 $(APP1_JAR) : $(OUT_COMP_CLASS)/$(APP1_NAME).mf $(OUT_COMP_CLASS)/$(APP1_NAME).class
205 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
206 -$(MKDIR) $(subst /,$(PS),$(@D))
207 +cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(basename $(@F)).mf $(basename $(@F)).class $(basename $(@F))$(QUOTE)$$Client.class
208 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
211 $(EXAMPLE_NAME) : $(REGISTERFLAG) $(APP1_JAR)
212 @echo --------------------------------------------------------------------------------
213 @echo Please use the following command to execute the example!
214 @echo -
215 @echo $(MAKE) $(APP1_NAME).run
216 @echo --------
217 @echo Before you can run the examples the components "$(QM)$(COMP1_NAME)$(QM)",
218 @echo "$(QM)$(COMP2_NAME)$(QM)" and "$(QM)$(COMP3_NAME)$(QM)" must be deployed.
219 @echo The components will be automatically deployed if SDK_AUTO_DEPLOYMENT = YES.
220 @echo --------------------------------------------------------------------------------
222 %.run: $(OUT_COMP_CLASS)/%.jar
223 $(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $<
225 .PHONY: clean
226 clean :
227 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS))
228 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP1_PACKAGE_URL)))
229 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP2_PACKAGE_URL)))
230 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP3_PACKAGE_URL)))
231 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))