Update ooo320-m1
[ooovba.git] / odk / examples / DevelopersGuide / Components / Thumbs / org / openoffice / comp / test / Makefile
blob6e44b55a3f9a0eee972441aed852c932b153f97e
1 #*************************************************************************
3 # $RCSfile: Makefile,v $
5 # $Revision: 1.7 $
7 # last change: $Author: obo $ $Date: 2007-01-25 11:04:52 $
9 # The Contents of this file are made available subject to the terms of
10 # the BSD license.
12 # Copyright (c) 2003 by Sun Microsystems, Inc.
13 # All rights reserved.
15 # Redistribution and use in source and binary forms, with or without
16 # modification, are permitted provided that the following conditions
17 # are met:
18 # 1. Redistributions of source code must retain the above copyright
19 # notice, this list of conditions and the following disclaimer.
20 # 2. Redistributions in binary form must reproduce the above copyright
21 # notice, this list of conditions and the following disclaimer in the
22 # documentation and/or other materials provided with the distribution.
23 # 3. Neither the name of Sun Microsystems, Inc. nor the names of its
24 # contributors may be used to endorse or promote products derived
25 # from this software without specific prior written permission.
27 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
30 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
31 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
32 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
34 # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
35 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
36 # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
37 # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 #**************************************************************************
41 # Builds the SpreadSheet examples of the Developers Guide.
43 PRJ=../../../../../../../..
44 SETTINGS=$(PRJ)/settings
46 include $(SETTINGS)/settings.mk
47 include $(SETTINGS)/std.mk
48 include $(SETTINGS)/dk.mk
50 include ../../../../thumbs.mk
52 # Define non-platform/compiler specific settings
53 PACKAGE = org/openoffice/comp/test
55 SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
56 $(PATH_SEPARATOR)$(OUT_COMP_CLASS))
59 # Targets
60 .PHONY: ALL
61 ALL : $(REGISTERFLAG) \
62 $(APP1_JAR)
64 include $(SETTINGS)/stdtarget.mk
66 $(OUT_COMP_CLASS)/%.Manifest :
67 -$(MKDIR) $(subst /,$(PS),$(@D))
68 @echo UNO-Type-Path: $(basename $(notdir $*)).uno.jar> $@
69 @echo RegistrationClassName: $(subst /,.,$(PACKAGE)).$(basename $(basename $(@F)))>> $@
71 $(OUT_COMP_CLASS)/$(PACKAGE)/%.class : %.java
72 -$(MKDIR) $(subst /,$(PS),$(@D))
73 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $<
75 $(OUT_COMP_CLASS)/%.mf :
76 -$(MKDIR) $(subst /,$(PS),$(@D))
77 @echo Main-Class: com.sun.star.lib.loader.Loader> $@
78 $(ECHOLINE)>> $@
79 @echo Name: com/sun/star/lib/loader/Loader.class>> $@
80 @echo Application-Class: $(subst /,.,$(PACKAGE)).$*>> $@
82 # rule for component jar file
83 $(COMPONENT_JAR) : $(COMPONENT_MANIFESTFILE) $(OUT_COMP_CLASS)/$(PACKAGE)/$(COMPONENT_NAME).class
84 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
85 -$(MKDIR) $(subst /,$(PS),$(@D))
86 $(SDK_JAR) cvfm $@ $< -C $(OUT_COMP_CLASS) $(PACKAGE)/$(basename $(basename $(@F))).class $(patsubst %.class,-C $(OUT_COMP_CLASS) %.class,$(GENCLASSNAMES))
88 # rule for component package manifest
89 $(OUT_COMP_CLASS)/%/manifest.xml :
90 -$(MKDIR) $(subst /,$(PS),$(@D))
91 @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
92 @echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@
93 @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
94 @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@
95 @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@
96 @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
97 @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
98 @echo $(OSEP)/manifest:manifest$(CSEP) >> $@
100 # rule for component package file
101 $(COMPONENT_PACKAGE) : $(COMPONENT_RDB) $(COMPONENT_JAR) $(COMPONENT_UNOPKG_MANIFEST)
102 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
103 -$(MKDIR) $(subst /,$(PS),$(@D))
104 $(COPY) $(subst /,$(PS),$(COMPONENT_RDB)) $(subst /,$(PS),$(OUT_COMP_CLASS))
105 cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $(COMPONENT_RDB_NAME) $(COMPONENT_JAR_NAME)
106 cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
107 $(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_CLASS)/$(COMPONENT_RDB_NAME)))
109 $(APP1_JAR) : $(OUT_COMP_CLASS)/$(APP1_NAME).mf $(OUT_COMP_CLASS)/$(PACKAGE)/$(APP1_NAME).class
110 -$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@))
111 $(SDK_JAR) cvfm $@ $< -C $(OUT_COMP_CLASS) $(PACKAGE)/$(basename $(@F)).class $(patsubst %.class,-C $(OUT_COMP_CLASS) %.class,$(GENCLASSNAMES))
112 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
115 $(REGISTERFLAG) : $(COMPONENT_PACKAGE)
116 ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
117 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
118 -$(MKDIR) $(subst /,$(PS),$(@D))
119 $(DEPLOYTOOL) $(COMPONENT_PACKAGE_URL)
120 @echo flagged > $(subst /,$(PS),$@)
121 else
122 @echo --------------------------------------------------------------------------------
123 @echo If you want to install your component automatically, please set the environment
124 @echo variable SDK_AUTO_DEPLOYMENT = YES. But note that auto deployment is only
125 @echo possible if no office instance is running.
126 @echo --------------------------------------------------------------------------------
127 endif
129 .PHONY: clean
130 clean :
131 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL)))
132 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_JAR)))
133 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))
134 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(APP1_JAR)))