merge the formfield patch from ooo-build
[ooovba.git] / odk / examples / DevelopersGuide / Forms / Makefile
blobb461e92a07da17f5c11c05a053a6e38fff4cb232
1 #*************************************************************************
3 # $RCSfile: Makefile,v $
5 # $Revision: 1.6 $
7 # last change: $Author: rt $ $Date: 2005-03-29 12:10:19 $
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 Forms example 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=FormsExamples
52 SAMPLE_CLASS_OUT=$(OUT_CLASS)/$(SAMPLE_NAME)
53 SAMPLE_GEN_OUT=$(OUT_MISC)/$(SAMPLE_NAME)
55 APP1_NAME=DataAwareness
56 APP1_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP1_NAME)
57 APP1_JAR=$(SAMPLE_CLASS_OUT)/$(APP1_NAME).jar
58 APP2_NAME=ValueBinding
59 APP2_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP2_NAME)
60 APP2_JAR=$(SAMPLE_CLASS_OUT)/$(APP2_NAME).jar
61 APP3_NAME=SpreadsheetValueBinding
62 APP3_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP3_NAME)
63 APP3_JAR=$(SAMPLE_CLASS_OUT)/$(APP3_NAME).jar
64 APP4_NAME=ControlValidation
65 APP4_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP4_NAME)
66 APP4_JAR=$(SAMPLE_CLASS_OUT)/$(APP4_NAME).jar
68 COMMON_CLASS_OUT = $(SAMPLE_CLASS_OUT)/common
69 COMMON_JAVAFILES = \
70 ButtonOperator.java \
71 ComponentTreeTraversal.java \
72 ControlLock.java \
73 DocumentHelper.java \
74 DocumentType.java \
75 DocumentViewHelper.java \
76 FLTools.java \
77 FormLayer.java \
78 GridFieldValidator.java \
79 InteractionRequest.java \
80 KeyGenerator.java \
81 SalesFilter.java \
82 UNO.java \
83 SpreadsheetView.java \
84 WaitForInput.java \
85 DocumentBasedExample.java \
86 TableCellTextBinding.java \
87 SpreadsheetDocument.java \
88 NumericValidator.java \
89 TextValidator.java \
90 BooleanValidator.java \
91 ListSelectionValidator.java \
92 DateValidator.java \
93 TimeValidator.java \
94 ControlValidator.java \
95 SingleControlValidation.java \
96 HsqlDatabase.java \
97 RowSet.java \
98 URLHelper.java
100 COMMON_CLASSFILES = $(patsubst %.java,$(COMMON_CLASS_OUT)/%.class,$(COMMON_JAVAFILES))
102 SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
103 $(PATH_SEPARATOR)$(SAMPLE_CLASS_OUT)\
104 $(PATH_SEPARATOR)$(COMMON_CLASS_OUT))
107 # Targets
108 .PHONY: ALL
109 ALL : \
110 FormsExample
112 include $(SETTINGS)/stdtarget.mk
114 $(COMMON_CLASSFILES) : $(COMMON_JAVAFILES)
115 -$(MKDIR) $(subst /,$(PS),$(@D))
116 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(COMMON_CLASS_OUT) $^
118 # rule for client/example application manifest file
119 $(SAMPLE_GEN_OUT)/%.mf :
120 -$(MKDIR) $(subst /,$(PS),$(@D))
121 @echo Main-Class: com.sun.star.lib.loader.Loader> $@
122 $(ECHOLINE)>> $@
123 @echo Name: com/sun/star/lib/loader/Loader.class>> $@
124 @echo Application-Class: $*>> $@
126 $(APP1_CLASS_OUT)/$(APP1_NAME).class : $(APP1_NAME).java $(COMMON_CLASSFILES)
127 -$(MKDIR) $(subst /,$(PS),$(@D))
128 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(APP1_CLASS_OUT) $<
130 $(APP2_CLASS_OUT)/$(APP2_NAME).class : $(APP2_NAME).java $(COMMON_CLASSFILES)
131 -$(MKDIR) $(subst /,$(PS),$(@D))
132 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(APP2_CLASS_OUT) $<
134 $(APP3_CLASS_OUT)/$(APP3_NAME).class : $(APP3_NAME).java $(COMMON_CLASSFILES)
135 -$(MKDIR) $(subst /,$(PS),$(@D))
136 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(APP3_CLASS_OUT) $<
138 $(APP4_CLASS_OUT)/$(APP4_NAME).class : $(APP4_NAME).java $(COMMON_CLASSFILES)
139 -$(MKDIR) $(subst /,$(PS),$(@D))
140 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(APP4_CLASS_OUT) $<
142 $(APP1_JAR) : $(SAMPLE_GEN_OUT)/$(APP1_NAME).mf $(APP1_CLASS_OUT)/$(APP1_NAME).class $(COMMON_CLASSFILES)
143 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
144 -$(MKDIR) $(subst /,$(PS),$(@D))
145 +$(SDK_JAR) cvfm $@ $< -C $(APP1_CLASS_OUT) .
146 +$(SDK_JAR) uvf $@ -C $(COMMON_CLASS_OUT) .
147 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
149 $(APP2_JAR) : $(SAMPLE_GEN_OUT)/$(APP2_NAME).mf $(APP2_CLASS_OUT)/$(APP2_NAME).class $(COMMON_CLASSFILES)
150 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
151 -$(MKDIR) $(subst /,$(PS),$(@D))
152 +$(SDK_JAR) cvfm $@ $< -C $(APP2_CLASS_OUT) .
153 +$(SDK_JAR) uvf $@ -C $(COMMON_CLASS_OUT) .
154 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
156 $(APP3_JAR) : $(SAMPLE_GEN_OUT)/$(APP3_NAME).mf $(APP3_CLASS_OUT)/$(APP3_NAME).class $(COMMON_CLASSFILES)
157 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
158 -$(MKDIR) $(subst /,$(PS),$(@D))
159 +$(SDK_JAR) cvfm $@ $< -C $(APP3_CLASS_OUT) .
160 +$(SDK_JAR) uvf $@ -C $(COMMON_CLASS_OUT) .
161 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
163 $(APP4_JAR) : $(SAMPLE_GEN_OUT)/$(APP4_NAME).mf $(APP4_CLASS_OUT)/$(APP4_NAME).class $(COMMON_CLASSFILES)
164 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
165 -$(MKDIR) $(subst /,$(PS),$(@D))
166 +$(SDK_JAR) cvfm $@ $< -C $(APP4_CLASS_OUT) .
167 +$(SDK_JAR) uvf $@ -C $(COMMON_CLASS_OUT) .
168 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
170 FormsExample : $(APP1_JAR) $(APP2_JAR) $(APP3_JAR) $(APP4_JAR)
171 @echo --------------------------------------------------------------------------------
172 @echo "$(QM)$(APP1_NAME)$(QM)" demonstrates various things around data aware controls.
173 @echo "$(QM)$(APP2_NAME)$(QM)" demonstrates the use of value bindings for form controls.
174 @echo "$(QM)$(APP3_NAME)$(QM)" demonstrates the usage of the com.sun.star.table.CellValueBinding service
175 @echo "$(QM)$(APP4_NAME)$(QM)" demonstrates the form control validation API
177 @echo Please use one of the following commands to run an example:
178 @echo -
179 @echo $(MAKE) $(APP1_NAME).run
180 @echo $(MAKE) $(APP2_NAME).run
181 @echo $(MAKE) $(APP3_NAME).run
182 @echo $(MAKE) $(APP4_NAME).run
183 @echo -
184 @echo Note: The data awareness example needs a running data source whith name
185 @echo $(SQM) $(SQM)"$(QM)OO_SDK_Demo_DB$(QM)". Make sure that you have created such a data source,
186 @echo -
187 @echo The document "$(QM)ProgrammaticScriptAssignment.odt$(QM)" demonstrates
188 @echo how you can programmatically create form controls, and associated
189 @echo scripts with certain events.
190 @echo -
191 @echo $(MAKE) ProgrammaticScriptAssignment.odt.load
192 @echo --------------------------------------------------------------------------------
194 ProgrammaticScriptAssignment.odt.load : $(COMP_REGISTERFLAG)
195 "$(OFFICE_PROGRAM_PATH)$(PS)soffice" $(basename $@)
197 %.run: $(SAMPLE_CLASS_OUT)/%.jar
198 $(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $<
200 .PHONY: clean
201 clean :
202 -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_CLASS_OUT))
203 -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_GEN_OUT))