xref: /AOO41X/main/odk/examples/DevelopersGuide/Accessibility/Makefile (revision 122c3632cd029f095ff191137a08f3f2ec2c3238)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22# Build the simple screen reader (SSR) described in the Developers
23# Guide Accessibility chapter.
24
25PRJ=../../..
26SETTINGS=$(PRJ)/settings
27
28include $(SETTINGS)/settings.mk
29include $(SETTINGS)/std.mk
30include $(SETTINGS)/dk.mk
31
32# Define non-platform/compiler specific settings
33EXAMPLE_NAME=DevGuideAccessibilityExample
34OUT_APP_CLASS = $(OUT_CLASS)/$(EXAMPLE_NAME)
35
36APP1_NAME =SSR
37APP1_JAR =$(OUT_APP_CLASS)/$(APP1_NAME).jar
38
39JAVAFILES = \
40        MessageArea.java \
41        ConnectionTask.java \
42        EventHandler.java \
43        EventListenerProxy.java \
44        GraphicalDisplay.java \
45        NameProvider.java \
46        IAccessibleObjectDisplay.java \
47        RegistrationThread.java \
48        SSR.java \
49        TextualDisplay.java
50
51APP1_CLASSFILES = $(patsubst %.java,$(OUT_APP_CLASS)/%.class,$(JAVAFILES))
52APP1_CLASSNAMES = $(patsubst %.java,%.class,$(JAVAFILES)) \
53     EventListenerProxy$(ICL)1.class \
54     EventListenerProxy$(ICL)2.class \
55     EventListenerProxy$(ICL)3.class \
56     EventListenerProxy$(ICL)4.class
57
58SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
59        $(PATH_SEPARATOR)$(OUT_APP_CLASS))
60
61
62# Targets
63.PHONY: ALL
64ALL : $(EXAMPLE_NAME)
65
66include $(SETTINGS)/stdtarget.mk
67
68$(OUT_APP_CLASS)/%.class : %.java
69    -$(MKDIR) $(subst /,$(PS),$(@D))
70    $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_APP_CLASS) $(JAVAFILES)
71
72$(OUT_APP_CLASS)/%.mf :
73    -$(MKDIR) $(subst /,$(PS),$(@D))
74    @echo Main-Class: com.sun.star.lib.loader.Loader> $@
75    $(ECHOLINE)>> $@
76    @echo Name: com/sun/star/lib/loader/Loader.class>> $@
77    @echo Application-Class: $*>> $@
78
79$(APP1_JAR) : $(OUT_APP_CLASS)/$(APP1_NAME).mf $(APP1_CLASSFILES)
80    -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
81    -$(MKDIR) $(subst /,$(PS),$(@D))
82    +cd $(subst /,$(PS),$(OUT_APP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(basename $(@F)).mf $(APP1_CLASSNAMES)
83    +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
84
85
86$(EXAMPLE_NAME) : $(APP1_JAR)
87    @echo --------------------------------------------------------------------------------
88    @echo Before you run this example you should start your office with at least a
89    @echo new empty document and you should have enabled the accessibility support.
90    @echo Please use the following command to execute the Simple Screen Reader example!
91    @echo -
92    @echo $(MAKE) $(APP1_NAME).run
93    @echo --------------------------------------------------------------------------------
94
95%.run: $(OUT_APP_CLASS)/%.jar
96    $(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $<
97
98.PHONY: clean
99clean :
100    -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_CLASS))
101