1 #*************************************************************************
3 # $RCSfile: Makefile,v $
7 # last change: $Author: hr $ $Date: 2007-07-31 13:55:00 $
9 # The Contents of this file are made available subject to the terms of
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
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 GUI examples of the Developers Guide.
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
=GUIExamples
52 SAMPLE_CLASS_OUT
= $(OUT_CLASS
)/$(SAMPLE_NAME
)
53 SAMPLE_GEN_OUT
= $(OUT_MISC
)/$(SAMPLE_NAME
)
56 APP1_NAME
=DialogDocument
57 APP1_JAR
=$(SAMPLE_CLASS_OUT
)/$(APP1_NAME
).jar
59 APP2_JAR
=$(SAMPLE_CLASS_OUT
)/$(APP2_NAME
).jar
60 APP3_NAME
=UnoDialogSample
61 APP3_JAR
=$(SAMPLE_CLASS_OUT
)/$(APP3_NAME
).jar
62 APP4_NAME
=UnoDialogSample2
63 APP4_JAR
=$(SAMPLE_CLASS_OUT
)/$(APP4_NAME
).jar
65 APP5_JAR
=$(SAMPLE_CLASS_OUT
)/$(APP5_NAME
).jar
67 APP6_JAR
=$(SAMPLE_CLASS_OUT
)/$(APP6_NAME
).jar
68 APP7_NAME
=ImageControlSample
69 APP7_JAR
=$(SAMPLE_CLASS_OUT
)/$(APP7_NAME
).jar
72 RoadmapItemStateChangeListener.java \
73 UnoDialogSample.java \
76 APP_CLASSFILES
= $(patsubst %.java
,$(SAMPLE_CLASS_OUT
)/%.class
,$(APP_JAVAFILES
))
77 # $(SAMPLE_CLASS_OUT)/UnoDialogSample\&RoadmapItemStateChangeListener.class
79 APP_CLASSNAMES
= $(patsubst %.java
,%.class
,$(APP_JAVAFILES
))
80 #APP_CLASSNAMES = $(patsubst $(SAMPLE_CLASS_OUT)/%.class,%.class,$(APP_CLASSFILES))
83 SDK_CLASSPATH
= $(subst $(EMPTYSTRING
) $(PATH_SEPARATOR
),$(PATH_SEPARATOR
),$(CLASSPATH
)\
84 $(PATH_SEPARATOR
)$(SAMPLE_CLASS_OUT
))
93 include $(SETTINGS
)/stdtarget.mk
96 $(APP_CLASSFILES
) : $(APP_JAVAFILES
)
97 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
98 $(SDK_JAVAC
) $(JAVAC_FLAGS
) -classpath
"$(SDK_CLASSPATH)" -d
$(SAMPLE_CLASS_OUT
) $(APP_JAVAFILES
)
100 $(SAMPLE_CLASS_OUT
)/%.class
: %.java
$(APP_CLASSFILES
)
101 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
102 $(SDK_JAVAC
) $(JAVAC_FLAGS
) -classpath
"$(SDK_CLASSPATH)" -d
$(SAMPLE_CLASS_OUT
) $<
104 $(SAMPLE_CLASS_OUT
)/%.mf
:
105 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
106 @echo Main-Class
: com.sun.star.lib.loader.Loader
> $@
108 @echo Name
: com
/sun
/star
/lib
/loader
/Loader.class
>> $@
109 @echo Application-Class
: $*>> $@
111 $(SAMPLE_CLASS_OUT
)/%.jar
: $(SAMPLE_CLASS_OUT
)/%.mf
$(SAMPLE_CLASS_OUT
)/%.class
$(APP_CLASSFILES
)
112 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$@
))
113 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
114 +cd
$(subst /,$(PS
),$(SAMPLE_CLASS_OUT
)) && $(SDK_JAR
) cvfm
$(@F
) $*.mf
$*.class
$(APP_CLASSNAMES
)
115 +$(SDK_JAR
) uvf
$@
$(SDK_JAVA_UNO_BOOTSTRAP_FILES
)
117 $(APP1_JAR
) : $(SAMPLE_CLASS_OUT
)/$(APP1_NAME
).mf
$(SAMPLE_CLASS_OUT
)/$(APP1_NAME
).class
118 $(APP2_JAR
) : $(SAMPLE_CLASS_OUT
)/$(APP2_NAME
).mf
$(SAMPLE_CLASS_OUT
)/$(APP2_NAME
).class
119 $(APP3_JAR
) : $(SAMPLE_CLASS_OUT
)/$(APP3_NAME
).mf
$(SAMPLE_CLASS_OUT
)/$(APP3_NAME
).class
120 $(APP4_JAR
) : $(SAMPLE_CLASS_OUT
)/$(APP4_NAME
).mf
$(SAMPLE_CLASS_OUT
)/$(APP4_NAME
).class
121 $(APP5_JAR
) : $(SAMPLE_CLASS_OUT
)/$(APP5_NAME
).mf
$(SAMPLE_CLASS_OUT
)/$(APP5_NAME
).class
122 $(APP6_JAR
) : $(SAMPLE_CLASS_OUT
)/$(APP6_NAME
).mf
$(SAMPLE_CLASS_OUT
)/$(APP6_NAME
).class
123 $(APP7_JAR
) : $(SAMPLE_CLASS_OUT
)/$(APP7_NAME
).mf
$(SAMPLE_CLASS_OUT
)/$(APP7_NAME
).class
125 GUIExamples
: $(APP1_JAR
) $(APP2_JAR
) $(APP3_JAR
) $(APP4_JAR
) $(APP5_JAR
) $(APP6_JAR
) $(APP7_JAR
)
126 @echo
--------------------------------------------------------------------------------
127 @echo Please use one of the following commands to execute the examples
!
129 @echo
$(MAKE
) $(APP1_NAME
).run
130 @echo
$(MAKE
) $(APP2_NAME
).run
131 @echo
$(MAKE
) $(APP3_NAME
).run
132 @echo
$(MAKE
) $(APP4_NAME
).run
133 @echo
$(MAKE
) $(APP5_NAME
).run
134 @echo
$(MAKE
) $(APP6_NAME
).run
135 @echo
$(MAKE
) $(APP7_NAME
).run
138 %.run
: $(SAMPLE_CLASS_OUT
)/%.jar
139 $(SDK_JAVA
) -Dcom.sun.star.lib.loader.unopath
="$(OFFICE_PROGRAM_PATH)" -jar
$<
141 $(APP7_NAME
).run
: $(SAMPLE_CLASS_OUT
)/$(APP7_NAME
).jar
142 $(SDK_JAVA
) -Dcom.sun.star.lib.loader.unopath
="$(OFFICE_PROGRAM_PATH)" -jar
$< .
$(PS
)oologo.gif
147 -$(DELRECURSIVE
) $(subst /,$(PS
),$(SAMPLE_CLASS_OUT
))
148 -$(DELRECURSIVE
) $(subst /,$(PS
),$(SAMPLE_GEN_OUT
))