Branch libreoffice-5-0-4
[LibreOffice.git] / odk / examples / DevelopersGuide / GUI / Makefile
blob6eb18efdc7f6d2d428fc8bd326a625c36db6f547
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 GUI 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 SAMPLE_NAME=GUIExamples
45 SAMPLE_CLASS_OUT = $(OUT_CLASS)/$(SAMPLE_NAME)
46 SAMPLE_GEN_OUT = $(OUT_MISC)/$(SAMPLE_NAME)
49 APP1_NAME=DialogDocument
50 APP1_JAR=$(SAMPLE_CLASS_OUT)/$(APP1_NAME).jar
51 APP2_NAME=MessageBox
52 APP2_JAR=$(SAMPLE_CLASS_OUT)/$(APP2_NAME).jar
53 APP3_NAME=UnoDialogSample
54 APP3_JAR=$(SAMPLE_CLASS_OUT)/$(APP3_NAME).jar
55 APP4_NAME=UnoDialogSample2
56 APP4_JAR=$(SAMPLE_CLASS_OUT)/$(APP4_NAME).jar
57 APP5_NAME=UnoMenu
58 APP5_JAR=$(SAMPLE_CLASS_OUT)/$(APP5_NAME).jar
59 APP6_NAME=UnoMenu2
60 APP6_JAR=$(SAMPLE_CLASS_OUT)/$(APP6_NAME).jar
61 APP7_NAME=ImageControlSample
62 APP7_JAR=$(SAMPLE_CLASS_OUT)/$(APP7_NAME).jar
64 APP_JAVAFILES = \
65 RoadmapItemStateChangeListener.java \
66 UnoDialogSample.java \
67 UnoMenu.java
69 APP_CLASSFILES = $(patsubst %.java,$(SAMPLE_CLASS_OUT)/%.class,$(APP_JAVAFILES))
70 # $(SAMPLE_CLASS_OUT)/UnoDialogSample\&RoadmapItemStateChangeListener.class
72 APP_CLASSNAMES = $(patsubst %.java,%.class,$(APP_JAVAFILES))
73 #APP_CLASSNAMES = $(patsubst $(SAMPLE_CLASS_OUT)/%.class,%.class,$(APP_CLASSFILES))
76 SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
77 $(PATH_SEPARATOR)$(SAMPLE_CLASS_OUT))
80 # Targets
81 .PHONY: ALL
82 ALL : \
83 GUIExamples
86 include $(SETTINGS)/stdtarget.mk
89 $(APP_CLASSFILES) : $(APP_JAVAFILES)
90 -$(MKDIR) $(subst /,$(PS),$(@D))
91 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(SAMPLE_CLASS_OUT) $(APP_JAVAFILES)
93 $(SAMPLE_CLASS_OUT)/%.class : %.java $(APP_CLASSFILES)
94 -$(MKDIR) $(subst /,$(PS),$(@D))
95 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(SAMPLE_CLASS_OUT) $<
97 $(SAMPLE_CLASS_OUT)/%.mf :
98 -$(MKDIR) $(subst /,$(PS),$(@D))
99 @echo Main-Class: com.sun.star.lib.loader.Loader> $@
100 $(ECHOLINE)>> $@
101 @echo Name: com/sun/star/lib/loader/Loader.class>> $@
102 @echo Application-Class: $*>> $@
104 $(SAMPLE_CLASS_OUT)/%.jar : $(SAMPLE_CLASS_OUT)/%.mf $(SAMPLE_CLASS_OUT)/%.class $(APP_CLASSFILES)
105 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
106 -$(MKDIR) $(subst /,$(PS),$(@D))
107 +cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_JAR) cvfm $(@F) $*.mf $*.class $(APP_CLASSNAMES)
108 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
110 $(APP1_JAR) : $(SAMPLE_CLASS_OUT)/$(APP1_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP1_NAME).class
111 $(APP2_JAR) : $(SAMPLE_CLASS_OUT)/$(APP2_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP2_NAME).class
112 $(APP3_JAR) : $(SAMPLE_CLASS_OUT)/$(APP3_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP3_NAME).class
113 $(APP4_JAR) : $(SAMPLE_CLASS_OUT)/$(APP4_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP4_NAME).class
114 $(APP5_JAR) : $(SAMPLE_CLASS_OUT)/$(APP5_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP5_NAME).class
115 $(APP6_JAR) : $(SAMPLE_CLASS_OUT)/$(APP6_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP6_NAME).class
116 $(APP7_JAR) : $(SAMPLE_CLASS_OUT)/$(APP7_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP7_NAME).class
118 GUIExamples : $(APP1_JAR) $(APP2_JAR) $(APP3_JAR) $(APP4_JAR) $(APP5_JAR) $(APP6_JAR) $(APP7_JAR)
119 @echo --------------------------------------------------------------------------------
120 @echo Please use one of the following commands to execute the examples!
121 @echo -
122 @echo $(MAKE) $(APP1_NAME).run
123 @echo $(MAKE) $(APP2_NAME).run
124 @echo $(MAKE) $(APP3_NAME).run
125 @echo $(MAKE) $(APP4_NAME).run
126 @echo $(MAKE) $(APP5_NAME).run
127 @echo $(MAKE) $(APP6_NAME).run
128 @echo $(MAKE) $(APP7_NAME).run
129 @echo --------
131 %.run: $(SAMPLE_CLASS_OUT)/%.jar
132 $(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $<
134 $(APP7_NAME).run: $(SAMPLE_CLASS_OUT)/$(APP7_NAME).jar
135 $(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $< .$(PS)oologo.gif
138 .PHONY: clean
139 clean :
140 -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_CLASS_OUT))
141 -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_GEN_OUT))