Update ooo320-m1
[ooovba.git] / odk / examples / DevelopersGuide / OfficeDev / DesktopEnvironment / Makefile
blob5faa381b140a51a48e2fb14a9829d0a242b36b7b
1 #*************************************************************************
3 # $RCSfile: Makefile,v $
5 # $Revision: 1.6 $
7 # last change: $Author: rt $ $Date: 2005-03-29 12:11:20 $
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 OfficeDevDestopEnvironment 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 EXAMPLE_NAME=OfficeDevDesktopEnv
52 OUT_APP_CLASS = $(OUT_CLASS)/$(EXAMPLE_NAME)
54 APP1_NAME=DesktopExample
55 APP1_JAR=$(OUT_APP_CLASS)/$(APP1_NAME).jar
57 APP1_JAVAFILES = \
58 CustomizeView.java \
59 Desk.java \
60 DocumentView.java \
61 FunctionHelper.java \
62 Interceptor.java \
63 IOnewayLink.java \
64 IShutdownListener.java \
65 JavaWindowPeerFake.java \
66 NativeView.java \
67 OfficeConnect.java \
68 OnewayExecutor.java \
69 StatusListener.java \
70 StatusView.java \
71 ViewContainer.java
73 APP1_CLASSFILES = $(patsubst %.java,$(OUT_APP_CLASS)/%.class,$(APP1_JAVAFILES))
74 APP1_CLASSNAMES = $(patsubst %.java,%.class,$(APP1_JAVAFILES)) \
75 CustomizeView$(QUOTE)$$ClickListener.class \
76 DocumentView$(QUOTE)$$1.class \
77 DocumentView$(QUOTE)$$Reactor.class
80 SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
81 $(PATH_SEPARATOR)$(OUT_APP_CLASS))
83 ifeq "$(OS)" "WIN"
84 SUBDIR= nativelib/windows
85 else
86 SUBDIR= nativelib/unix
87 endif
89 # Targets
90 .PHONY: ALL
91 ALL : $(SUBDIR) \
92 $(EXAMPLE_NAME)
94 include $(SETTINGS)/stdtarget.mk
96 .PHONY : $(SUBDIR)
97 $(SUBDIR) :
98 $(MAKE) -C $@
100 $(APP1_CLASSFILES) : $(APP1_JAVAFILES)
101 -$(MKDIR) $(subst /,$(PS),$(@D))
102 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_APP_CLASS) $(APP1_JAVAFILES)
104 $(OUT_APP_CLASS)/$(APP1_NAME).mf :
105 -$(MKDIR) $(subst /,$(PS),$(@D))
106 @echo Main-Class: com.sun.star.lib.loader.Loader> $@
107 $(ECHOLINE)>> $@
108 @echo Name: com/sun/star/lib/loader/Loader.class>> $@
109 @echo Application-Class: Desk>> $@
111 $(APP1_JAR) : $(OUT_APP_CLASS)/$(APP1_NAME).mf $(APP1_CLASSFILES)
112 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
113 -$(MKDIR) $(subst /,$(PS),$(@D))
114 +cd $(subst /,$(PS),$(OUT_APP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(basename $(@F)).mf $(APP1_CLASSNAMES)
115 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
117 $(EXAMPLE_NAME) : $(APP1_JAR)
118 @echo --------------------------------------------------------------------------------
119 @echo Please use the following command to execute the example!
120 @echo -
121 @echo $(MAKE) DesktopExample.run
122 @echo ------
123 @echo If you want to run the $(JAR1_JAR) file please set your
124 @echo CLASSPATH = $(SDK_CLASSPATH)
125 @echo Start the example with jar -jar $(JAR1_JAR)
126 @echo --------------------------------------------------------------------------------
128 %.run: $(OUT_APP_CLASS)/%.jar
129 $(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $<
131 .PHONY: clean
132 clean :
133 $(MAKE) -C $(SUBDIR) clean
134 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_CLASS))