xref: /aoo41x/main/odk/examples/java/Text/Makefile (revision 122c3632)
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# Builds the Java Text examples of the SDK.
23
24PRJ=../../..
25SETTINGS=$(PRJ)/settings
26
27include $(SETTINGS)/settings.mk
28include $(SETTINGS)/std.mk
29include $(SETTINGS)/dk.mk
30
31# Define non-platform/compiler specific settings
32EXAMPLE_NAME=JavaTextExamples
33OUT_APP_CLASS = $(OUT_CLASS)/$(EXAMPLE_NAME)
34
35APP1_NAME=BookmarkInsertion
36APP1_JAR=$(OUT_APP_CLASS)/$(APP1_NAME).jar
37APP2_NAME=HardFormatting
38APP2_JAR=$(OUT_APP_CLASS)/$(APP2_NAME).jar
39APP3_NAME=StyleCreation
40APP3_JAR=$(OUT_APP_CLASS)/$(APP3_NAME).jar
41APP4_NAME=StyleInitialization
42APP4_JAR=$(OUT_APP_CLASS)/$(APP4_NAME).jar
43APP5_NAME=SWriter
44APP5_JAR=$(OUT_APP_CLASS)/$(APP5_NAME).jar
45APP6_NAME=TextDocumentStructure
46APP6_JAR=$(OUT_APP_CLASS)/$(APP6_NAME).jar
47APP7_NAME=TextReplace
48APP7_JAR=$(OUT_APP_CLASS)/$(APP7_NAME).jar
49APP8_NAME=WriterSelector
50APP8_JAR=$(OUT_APP_CLASS)/$(APP8_NAME).jar
51APP9_NAME=GraphicsInserter
52APP9_JAR=$(OUT_APP_CLASS)/$(APP9_NAME).jar
53
54SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
55		$(PATH_SEPARATOR)$(OUT_APP_CLASS))
56
57# Targets
58.PHONY: ALL
59ALL : \
60    $(EXAMPLE_NAME)
61
62include $(SETTINGS)/stdtarget.mk
63
64$(OUT_APP_CLASS)/%.class : %.java
65	-$(MKDIR) $(subst /,$(PS),$(@D))
66	$(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_APP_CLASS) $<
67
68$(OUT_APP_CLASS)/%.mf :
69	-$(MKDIR) $(subst /,$(PS),$(@D))
70	@echo Main-Class: com.sun.star.lib.loader.Loader> $@
71	$(ECHOLINE)>> $@
72	@echo Name: com/sun/star/lib/loader/Loader.class>> $@
73	@echo Application-Class: $*>> $@
74
75$(OUT_APP_CLASS)/%.jar : $(OUT_APP_CLASS)/%.mf $(OUT_APP_CLASS)/%.class
76	-$(MKDIR) $(subst /,$(PS),$(@D))
77	+cd $(subst /,$(PS),$(OUT_APP_CLASS)) && $(SDK_JAR) cvfm $(@F) $*.mf $*.class
78	+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
79
80
81$(APP1_JAR) : $(OUT_APP_CLASS)/$(APP1_NAME).mf $(OUT_APP_CLASS)/$(APP1_NAME).class
82$(APP2_JAR) : $(OUT_APP_CLASS)/$(APP2_NAME).mf $(OUT_APP_CLASS)/$(APP2_NAME).class
83$(APP3_JAR) : $(OUT_APP_CLASS)/$(APP3_NAME).mf $(OUT_APP_CLASS)/$(APP3_NAME).class
84$(APP4_JAR) : $(OUT_APP_CLASS)/$(APP4_NAME).mf $(OUT_APP_CLASS)/$(APP4_NAME).class
85$(APP5_JAR) : $(OUT_APP_CLASS)/$(APP5_NAME).mf $(OUT_APP_CLASS)/$(APP5_NAME).class
86$(APP6_JAR) : $(OUT_APP_CLASS)/$(APP6_NAME).mf $(OUT_APP_CLASS)/$(APP6_NAME).class
87$(APP7_JAR) : $(OUT_APP_CLASS)/$(APP7_NAME).mf $(OUT_APP_CLASS)/$(APP7_NAME).class
88$(APP8_JAR) : $(OUT_APP_CLASS)/$(APP8_NAME).mf $(OUT_APP_CLASS)/$(APP8_NAME).class
89$(APP9_JAR) : $(OUT_APP_CLASS)/$(APP9_NAME).mf $(OUT_APP_CLASS)/$(APP9_NAME).class
90
91$(EXAMPLE_NAME) : $(APP1_JAR) $(APP2_JAR) $(APP3_JAR) $(APP4_JAR) $(APP5_JAR) $(APP6_JAR) $(APP7_JAR) $(APP8_JAR) $(APP9_JAR)
92	@echo --------------------------------------------------------------------------------
93	@echo The GraphicsInserter example loads the graphic "$(QM)./oo_smiley.gif$(QM)" into a
94	@echo new document.
95	@echo -
96	@echo Please use one of the following commands to execute the examples!
97	@echo ------
98	@echo $(MAKE) BookmarkInsertion.run
99	@echo $(MAKE) HardFormatting.run
100	@echo $(MAKE) StyleCreation.run
101	@echo $(MAKE) StyleInitialization.run
102	@echo $(MAKE) SWriter.run
103	@echo $(MAKE) TextDocumentStructure.run
104	@echo $(MAKE) TextReplace.run
105	@echo $(MAKE) WriterSelector.run
106	@echo $(MAKE) GraphicsInserter.run
107	@echo --------
108	@echo The GraphicsInserter needs parameters. Please use the following command to
109	@echo start the demo if you do not want the default parameters specified in the
110	@echo this makefile. Starting without parameters print a command line help:
111	@echo --- GraphicsInserter ---
112	@echo java -jar GraphicsInserter.jar "$(QM)graphic Url|path$(QM)"
113	@echo --------------------------------------------------------------------------------
114
115%.run: $(OUT_APP_CLASS)/%.jar
116	$(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $<
117
118GraphicsInserter.run: $(OUT_APP_CLASS)/GraphicsInserter.jar
119	$(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $< oo_smiley.gif
120
121.PHONY: clean
122clean :
123	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_CLASS))
124