merge the formfield patch from ooo-build
[ooovba.git] / odk / examples / DevelopersGuide / Drawing / Makefile
blobb6351d740cc617173553b9805340a1510d8875d1
1 #*************************************************************************
3 # $RCSfile: Makefile,v $
5 # $Revision: 1.6 $
7 # last change: $Author: rt $ $Date: 2005-03-29 12:09:50 $
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 Drawing 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 # Define non-platform/compiler specific settings
51 SAMPLE_NAME=DrawingExamples
52 SAMPLE_CLASS_OUT = $(OUT_CLASS)/$(SAMPLE_NAME)
53 SAMPLE_GEN_OUT = $(OUT_MISC)/$(SAMPLE_NAME)
55 APP1_NAME=ChangeOrderDemo
56 APP1_JAR=$(SAMPLE_CLASS_OUT)/$(APP1_NAME).jar
57 APP2_NAME=ControlAndSelectDemo
58 APP2_JAR=$(SAMPLE_CLASS_OUT)/$(APP2_NAME).jar
59 APP3_NAME=CustomShowDemo
60 APP3_JAR=$(SAMPLE_CLASS_OUT)/$(APP3_NAME).jar
61 APP4_NAME=DrawingDemo
62 APP4_JAR=$(SAMPLE_CLASS_OUT)/$(APP4_NAME).jar
63 APP5_NAME=DrawViewDemo
64 APP5_JAR=$(SAMPLE_CLASS_OUT)/$(APP5_NAME).jar
65 APP6_NAME=FillAndLineStyleDemo
66 APP6_JAR=$(SAMPLE_CLASS_OUT)/$(APP6_NAME).jar
67 APP7_NAME=GluePointDemo
68 APP7_JAR=$(SAMPLE_CLASS_OUT)/$(APP7_NAME).jar
69 APP8_NAME=GraphicExportDemo
70 APP8_JAR=$(SAMPLE_CLASS_OUT)/$(APP8_NAME).jar
71 APP9_NAME=LayerDemo
72 APP9_JAR=$(SAMPLE_CLASS_OUT)/$(APP9_NAME).jar
73 APP10_NAME=ObjectTransformationDemo
74 APP10_JAR=$(SAMPLE_CLASS_OUT)/$(APP10_NAME).jar
75 APP11_NAME=Organigram
76 APP11_JAR=$(SAMPLE_CLASS_OUT)/$(APP11_NAME).jar
77 APP12_NAME=PresentationDemo
78 APP12_JAR=$(SAMPLE_CLASS_OUT)/$(APP12_NAME).jar
79 APP13_NAME=StyleDemo
80 APP13_JAR=$(SAMPLE_CLASS_OUT)/$(APP13_NAME).jar
81 APP14_NAME=TextDemo
82 APP14_JAR=$(SAMPLE_CLASS_OUT)/$(APP14_NAME).jar
84 APP_JAVAFILES = \
85 Helper.java \
86 PageHelper.java \
87 ShapeHelper.java
89 APP_CLASSFILES = $(patsubst %.java,$(SAMPLE_CLASS_OUT)/%.class,$(APP_JAVAFILES))
90 APP_CLASSNAMES = $(patsubst %.java,%.class,$(APP_JAVAFILES))
92 SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
93 $(PATH_SEPARATOR)$(SAMPLE_CLASS_OUT))
96 # Targets
97 .PHONY: ALL
98 ALL : \
99 DrawingExamples
101 include $(SETTINGS)/stdtarget.mk
103 $(APP_CLASSFILES) : $(APP_JAVAFILES)
104 -$(MKDIR) $(subst /,$(PS),$(@D))
105 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(SAMPLE_CLASS_OUT) $(APP_JAVAFILES)
107 $(SAMPLE_CLASS_OUT)/%.class : %.java $(APP_CLASSFILES)
108 -$(MKDIR) $(subst /,$(PS),$(@D))
109 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(SAMPLE_CLASS_OUT) $<
111 $(SAMPLE_CLASS_OUT)/%.mf :
112 -$(MKDIR) $(subst /,$(PS),$(@D))
113 @echo Main-Class: com.sun.star.lib.loader.Loader> $@
114 $(ECHOLINE)>> $@
115 @echo Name: com/sun/star/lib/loader/Loader.class>> $@
116 @echo Application-Class: $*>> $@
118 $(SAMPLE_CLASS_OUT)/%.jar : $(SAMPLE_CLASS_OUT)/%.mf $(SAMPLE_CLASS_OUT)/%.class $(APP_CLASSFILES)
119 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
120 -$(MKDIR) $(subst /,$(PS),$(@D))
121 +cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_JAR) cvfm $(@F) $*.mf $*.class $(APP_CLASSNAMES)
122 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
124 $(APP1_JAR) : $(SAMPLE_CLASS_OUT)/$(APP1_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP1_NAME).class
125 $(APP2_JAR) : $(SAMPLE_CLASS_OUT)/$(APP2_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP2_NAME).class
126 $(APP3_JAR) : $(SAMPLE_CLASS_OUT)/$(APP3_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP3_NAME).class
127 $(APP4_JAR) : $(SAMPLE_CLASS_OUT)/$(APP4_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP4_NAME).class
128 $(APP5_JAR) : $(SAMPLE_CLASS_OUT)/$(APP5_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP5_NAME).class
129 $(APP6_JAR) : $(SAMPLE_CLASS_OUT)/$(APP6_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP6_NAME).class
130 $(APP7_JAR) : $(SAMPLE_CLASS_OUT)/$(APP7_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP7_NAME).class
131 $(APP8_JAR) : $(SAMPLE_CLASS_OUT)/$(APP8_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP8_NAME).class
132 $(APP9_JAR) : $(SAMPLE_CLASS_OUT)/$(APP9_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP9_NAME).class
133 $(APP10_JAR) : $(SAMPLE_CLASS_OUT)/$(APP10_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP10_NAME).class
134 $(APP11_JAR) : $(SAMPLE_CLASS_OUT)/$(APP11_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP11_NAME).class
135 $(APP12_JAR) : $(SAMPLE_CLASS_OUT)/$(APP12_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP12_NAME).class
136 $(APP13_JAR) : $(SAMPLE_CLASS_OUT)/$(APP13_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP13_NAME).class
137 $(APP14_JAR) : $(SAMPLE_CLASS_OUT)/$(APP14_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP14_NAME).class
139 DrawingExamples : $(APP1_JAR) $(APP2_JAR) $(APP3_JAR) $(APP4_JAR) $(APP5_JAR) $(APP6_JAR) $(APP7_JAR) $(APP8_JAR) $(APP9_JAR) $(APP10_JAR) $(APP11_JAR) $(APP12_JAR) $(APP13_JAR) $(APP14_JAR)
140 @echo --------------------------------------------------------------------------------
141 @echo Please use one of the following commands to execute the examples!
142 @echo -
143 @echo $(MAKE) $(APP1_NAME).run
144 @echo $(MAKE) $(APP2_NAME).run
145 @echo $(MAKE) $(APP3_NAME).run
146 @echo $(MAKE) $(APP4_NAME).run
147 @echo $(MAKE) $(APP5_NAME).run
148 @echo $(MAKE) $(APP6_NAME).run
149 @echo $(MAKE) $(APP7_NAME).run
150 @echo $(MAKE) $(APP8_NAME).run
151 @echo $(MAKE) $(APP9_NAME).run
152 @echo $(MAKE) $(APP10_NAME).run
153 @echo $(MAKE) $(APP11_NAME).run
154 @echo $(MAKE) $(APP12_NAME).run
155 @echo $(MAKE) $(APP13_NAME).run
156 @echo $(MAKE) $(APP14_NAME).run
157 @echo --------
158 @echo The $(APP5_NAME) and the $(APP8_NAME) needs parameters. Please use the
159 @echo following command to start the demo if you do not want the default parameters
160 @echo specified in the this makefile:
161 @echo --- $(APP5_NAME) ---
162 @echo java -Dcom.sun.star.lib.loader.unopath="$(QM)$(OFFICE_PROGRAM_PATH)$(QM)" -jar $(APP5_NAME).jar "$(QM)SourceUrl$(QM)"
163 @echo --- $(APP8_NAME) ---
164 @echo java -Dcom.sun.star.lib.loader.unopath="$(QM)$(OFFICE_PROGRAM_PATH)$(QM)" -jar $(APP8_NAME).jar "$(QM)SourceUrl$(QM)" "$(QM)DestinationUrl$(QM)" "$(QM)index$(QM)"
165 @echo --------------------------------------------------------------------------------
167 %.run: $(SAMPLE_CLASS_OUT)/%.jar
168 $(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $<
170 $(APP5_NAME).run: $(APP5_JAR)
171 $(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $< SimplePresentation.odp
173 $(APP8_NAME).run: $(APP8_JAR)
174 -$(MKDIR) $(subst /,$(PS),$(SAMPLE_GEN_OUT)/export)
175 $(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $< SimplePresentation.odp "$(SAMPLE_GEN_OUT)/export/MyTestExport.gif" 2
178 .PHONY: clean
179 clean :
180 -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_CLASS_OUT))
181 -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_GEN_OUT))