Update git submodules
[LibreOffice.git] / odk / examples / DevelopersGuide / Components / Thumbs / org / openoffice / comp / test / Makefile
blob8792173e645f47218cce21aa297bb5a74d8fe72e
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 SpreadSheet examples of the Developers Guide.
37 PRJ=../../../../../../../..
38 SETTINGS=$(PRJ)/settings
40 include $(SETTINGS)/settings.mk
41 include $(SETTINGS)/std.mk
43 include ../../../../thumbs.mk
45 # Define non-platform/compiler specific settings
46 PACKAGE = org/openoffice/comp/test
48 SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
49 $(PATH_SEPARATOR)$(OUT_COMP_CLASS))
52 # Targets
53 .PHONY: ALL
54 ALL : $(REGISTERFLAG) \
55 $(APP1_JAR)
57 include $(SETTINGS)/stdtarget.mk
59 $(OUT_COMP_CLASS)/%.Manifest :
60 -$(MKDIR) $(subst /,$(PS),$(@D))
61 @echo UNO-Type-Path: $(basename $(notdir $*)).uno.jar> $@
62 @echo RegistrationClassName: $(subst /,.,$(PACKAGE)).$(basename $(basename $(@F)))>> $@
64 $(OUT_COMP_CLASS)/$(PACKAGE)/%.class : %.java
65 -$(MKDIR) $(subst /,$(PS),$(@D))
66 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $<
68 $(OUT_COMP_CLASS)/%.mf :
69 -$(MKDIR) $(subst /,$(PS),$(@D))
70 @echo Main-Class: com.sun.star.lib.loader.Loader> $@
71 $(ECHOLINE)>> $@
72 @echo Name: com/sun/star/lib/loader/Loader.class>> $@
73 @echo Application-Class: $(subst /,.,$(PACKAGE)).$*>> $@
75 # rule for component jar file
76 $(COMP_JAR) : $(COMP_MANIFESTFILE) $(OUT_COMP_CLASS)/$(PACKAGE)/$(COMP_NAME).class
77 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
78 -$(MKDIR) $(subst /,$(PS),$(@D))
79 $(SDK_JAR) cvfm $@ $< -C $(OUT_COMP_CLASS) $(PACKAGE)/$(basename $(basename $(@F))).class $(patsubst %.class,-C $(OUT_COMP_CLASS) %.class,$(GENCLASSNAMES))
81 # rule for component package manifest
82 $(OUT_COMP_CLASS)/%/manifest.xml :
83 -$(MKDIR) $(subst /,$(PS),$(@D))
84 @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
85 @echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@
86 @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
87 @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@
88 @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@
89 @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
90 @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_COMPONENTS)$(QM)"/$(CSEP)>> $@
91 @echo $(OSEP)/manifest:manifest$(CSEP) >> $@
93 # rule for component package file
94 $(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS) description.xml
95 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
96 -$(MKDIR) $(subst /,$(PS),$(@D))
97 $(COPY) $(subst /,$(PS),$(COMP_RDB)) $(subst /,$(PS),$(OUT_COMP_CLASS))
98 $(SDK_ZIP) $@ $(COMP_COMPONENTS) description.xml
99 cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_RDB_NAME) $(COMP_JAR_NAME)
100 cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
101 $(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_CLASS)/$(COMP_RDB_NAME)))
103 $(APP1_JAR) : $(OUT_COMP_CLASS)/$(APP1_NAME).mf $(OUT_COMP_CLASS)/$(PACKAGE)/$(APP1_NAME).class
104 -$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@))
105 $(SDK_JAR) cvfm $@ $< -C $(OUT_COMP_CLASS) $(PACKAGE)/$(basename $(@F)).class $(patsubst %.class,-C $(OUT_COMP_CLASS) %.class,$(GENCLASSNAMES))
106 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
109 $(REGISTERFLAG) : $(COMP_PACKAGE)
110 ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
111 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
112 -$(MKDIR) $(subst /,$(PS),$(@D))
113 $(DEPLOYTOOL) $(COMP_PACKAGE_URL)
114 @echo flagged > $(subst /,$(PS),$@)
115 else
116 @echo --------------------------------------------------------------------------------
117 @echo If you want to install your component automatically, please set the environment
118 @echo variable SDK_AUTO_DEPLOYMENT = YES. But note that auto deployment is only
119 @echo possible if no office instance is running.
120 @echo --------------------------------------------------------------------------------
121 endif
123 .PHONY: clean
124 clean :
125 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
126 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_JAR)))
127 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))
128 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(APP1_JAR)))