xref: /aoo41x/main/odk/examples/java/Text/Makefile (revision 122c3632)
1*122c3632SJürgen Schmidt#**************************************************************
2*122c3632SJürgen Schmidt#
3*122c3632SJürgen Schmidt#  Licensed to the Apache Software Foundation (ASF) under one
4*122c3632SJürgen Schmidt#  or more contributor license agreements.  See the NOTICE file
5*122c3632SJürgen Schmidt#  distributed with this work for additional information
6*122c3632SJürgen Schmidt#  regarding copyright ownership.  The ASF licenses this file
7*122c3632SJürgen Schmidt#  to you under the Apache License, Version 2.0 (the
8*122c3632SJürgen Schmidt#  "License"); you may not use this file except in compliance
9*122c3632SJürgen Schmidt#  with the License.  You may obtain a copy of the License at
10*122c3632SJürgen Schmidt#
11*122c3632SJürgen Schmidt#    http://www.apache.org/licenses/LICENSE-2.0
12*122c3632SJürgen Schmidt#
13*122c3632SJürgen Schmidt#  Unless required by applicable law or agreed to in writing,
14*122c3632SJürgen Schmidt#  software distributed under the License is distributed on an
15*122c3632SJürgen Schmidt#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*122c3632SJürgen Schmidt#  KIND, either express or implied.  See the License for the
17*122c3632SJürgen Schmidt#  specific language governing permissions and limitations
18*122c3632SJürgen Schmidt#  under the License.
19cdf0e10cSrcweir#
20*122c3632SJürgen Schmidt#**************************************************************
21cdf0e10cSrcweir
22cdf0e10cSrcweir# Builds the Java Text examples of the SDK.
23cdf0e10cSrcweir
24cdf0e10cSrcweirPRJ=../../..
25cdf0e10cSrcweirSETTINGS=$(PRJ)/settings
26cdf0e10cSrcweir
27cdf0e10cSrcweirinclude $(SETTINGS)/settings.mk
28cdf0e10cSrcweirinclude $(SETTINGS)/std.mk
29cdf0e10cSrcweirinclude $(SETTINGS)/dk.mk
30cdf0e10cSrcweir
31cdf0e10cSrcweir# Define non-platform/compiler specific settings
32cdf0e10cSrcweirEXAMPLE_NAME=JavaTextExamples
33cdf0e10cSrcweirOUT_APP_CLASS = $(OUT_CLASS)/$(EXAMPLE_NAME)
34cdf0e10cSrcweir
35cdf0e10cSrcweirAPP1_NAME=BookmarkInsertion
36cdf0e10cSrcweirAPP1_JAR=$(OUT_APP_CLASS)/$(APP1_NAME).jar
37cdf0e10cSrcweirAPP2_NAME=HardFormatting
38cdf0e10cSrcweirAPP2_JAR=$(OUT_APP_CLASS)/$(APP2_NAME).jar
39cdf0e10cSrcweirAPP3_NAME=StyleCreation
40cdf0e10cSrcweirAPP3_JAR=$(OUT_APP_CLASS)/$(APP3_NAME).jar
41cdf0e10cSrcweirAPP4_NAME=StyleInitialization
42cdf0e10cSrcweirAPP4_JAR=$(OUT_APP_CLASS)/$(APP4_NAME).jar
43cdf0e10cSrcweirAPP5_NAME=SWriter
44cdf0e10cSrcweirAPP5_JAR=$(OUT_APP_CLASS)/$(APP5_NAME).jar
45cdf0e10cSrcweirAPP6_NAME=TextDocumentStructure
46cdf0e10cSrcweirAPP6_JAR=$(OUT_APP_CLASS)/$(APP6_NAME).jar
47cdf0e10cSrcweirAPP7_NAME=TextReplace
48cdf0e10cSrcweirAPP7_JAR=$(OUT_APP_CLASS)/$(APP7_NAME).jar
49cdf0e10cSrcweirAPP8_NAME=WriterSelector
50cdf0e10cSrcweirAPP8_JAR=$(OUT_APP_CLASS)/$(APP8_NAME).jar
51cdf0e10cSrcweirAPP9_NAME=GraphicsInserter
52cdf0e10cSrcweirAPP9_JAR=$(OUT_APP_CLASS)/$(APP9_NAME).jar
53cdf0e10cSrcweir
54cdf0e10cSrcweirSDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
55cdf0e10cSrcweir		$(PATH_SEPARATOR)$(OUT_APP_CLASS))
56cdf0e10cSrcweir
57cdf0e10cSrcweir# Targets
58cdf0e10cSrcweir.PHONY: ALL
59cdf0e10cSrcweirALL : \
60cdf0e10cSrcweir    $(EXAMPLE_NAME)
61cdf0e10cSrcweir
62cdf0e10cSrcweirinclude $(SETTINGS)/stdtarget.mk
63cdf0e10cSrcweir
64cdf0e10cSrcweir$(OUT_APP_CLASS)/%.class : %.java
65cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
66cdf0e10cSrcweir	$(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_APP_CLASS) $<
67cdf0e10cSrcweir
68cdf0e10cSrcweir$(OUT_APP_CLASS)/%.mf :
69cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
70cdf0e10cSrcweir	@echo Main-Class: com.sun.star.lib.loader.Loader> $@
71cdf0e10cSrcweir	$(ECHOLINE)>> $@
72cdf0e10cSrcweir	@echo Name: com/sun/star/lib/loader/Loader.class>> $@
73cdf0e10cSrcweir	@echo Application-Class: $*>> $@
74cdf0e10cSrcweir
75cdf0e10cSrcweir$(OUT_APP_CLASS)/%.jar : $(OUT_APP_CLASS)/%.mf $(OUT_APP_CLASS)/%.class
76cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
77cdf0e10cSrcweir	+cd $(subst /,$(PS),$(OUT_APP_CLASS)) && $(SDK_JAR) cvfm $(@F) $*.mf $*.class
78cdf0e10cSrcweir	+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
79cdf0e10cSrcweir
80cdf0e10cSrcweir
81cdf0e10cSrcweir$(APP1_JAR) : $(OUT_APP_CLASS)/$(APP1_NAME).mf $(OUT_APP_CLASS)/$(APP1_NAME).class
82cdf0e10cSrcweir$(APP2_JAR) : $(OUT_APP_CLASS)/$(APP2_NAME).mf $(OUT_APP_CLASS)/$(APP2_NAME).class
83cdf0e10cSrcweir$(APP3_JAR) : $(OUT_APP_CLASS)/$(APP3_NAME).mf $(OUT_APP_CLASS)/$(APP3_NAME).class
84cdf0e10cSrcweir$(APP4_JAR) : $(OUT_APP_CLASS)/$(APP4_NAME).mf $(OUT_APP_CLASS)/$(APP4_NAME).class
85cdf0e10cSrcweir$(APP5_JAR) : $(OUT_APP_CLASS)/$(APP5_NAME).mf $(OUT_APP_CLASS)/$(APP5_NAME).class
86cdf0e10cSrcweir$(APP6_JAR) : $(OUT_APP_CLASS)/$(APP6_NAME).mf $(OUT_APP_CLASS)/$(APP6_NAME).class
87cdf0e10cSrcweir$(APP7_JAR) : $(OUT_APP_CLASS)/$(APP7_NAME).mf $(OUT_APP_CLASS)/$(APP7_NAME).class
88cdf0e10cSrcweir$(APP8_JAR) : $(OUT_APP_CLASS)/$(APP8_NAME).mf $(OUT_APP_CLASS)/$(APP8_NAME).class
89cdf0e10cSrcweir$(APP9_JAR) : $(OUT_APP_CLASS)/$(APP9_NAME).mf $(OUT_APP_CLASS)/$(APP9_NAME).class
90cdf0e10cSrcweir
91cdf0e10cSrcweir$(EXAMPLE_NAME) : $(APP1_JAR) $(APP2_JAR) $(APP3_JAR) $(APP4_JAR) $(APP5_JAR) $(APP6_JAR) $(APP7_JAR) $(APP8_JAR) $(APP9_JAR)
92cdf0e10cSrcweir	@echo --------------------------------------------------------------------------------
93cdf0e10cSrcweir	@echo The GraphicsInserter example loads the graphic "$(QM)./oo_smiley.gif$(QM)" into a
94cdf0e10cSrcweir	@echo new document.
95cdf0e10cSrcweir	@echo -
96cdf0e10cSrcweir	@echo Please use one of the following commands to execute the examples!
97cdf0e10cSrcweir	@echo ------
98cdf0e10cSrcweir	@echo $(MAKE) BookmarkInsertion.run
99cdf0e10cSrcweir	@echo $(MAKE) HardFormatting.run
100cdf0e10cSrcweir	@echo $(MAKE) StyleCreation.run
101cdf0e10cSrcweir	@echo $(MAKE) StyleInitialization.run
102cdf0e10cSrcweir	@echo $(MAKE) SWriter.run
103cdf0e10cSrcweir	@echo $(MAKE) TextDocumentStructure.run
104cdf0e10cSrcweir	@echo $(MAKE) TextReplace.run
105cdf0e10cSrcweir	@echo $(MAKE) WriterSelector.run
106cdf0e10cSrcweir	@echo $(MAKE) GraphicsInserter.run
107cdf0e10cSrcweir	@echo --------
108cdf0e10cSrcweir	@echo The GraphicsInserter needs parameters. Please use the following command to
109cdf0e10cSrcweir	@echo start the demo if you do not want the default parameters specified in the
110cdf0e10cSrcweir	@echo this makefile. Starting without parameters print a command line help:
111cdf0e10cSrcweir	@echo --- GraphicsInserter ---
112cdf0e10cSrcweir	@echo java -jar GraphicsInserter.jar "$(QM)graphic Url|path$(QM)"
113cdf0e10cSrcweir	@echo --------------------------------------------------------------------------------
114cdf0e10cSrcweir
115cdf0e10cSrcweir%.run: $(OUT_APP_CLASS)/%.jar
116cdf0e10cSrcweir	$(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $<
117cdf0e10cSrcweir
118cdf0e10cSrcweirGraphicsInserter.run: $(OUT_APP_CLASS)/GraphicsInserter.jar
119cdf0e10cSrcweir	$(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $< oo_smiley.gif
120cdf0e10cSrcweir
121cdf0e10cSrcweir.PHONY: clean
122cdf0e10cSrcweirclean :
123cdf0e10cSrcweir	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_CLASS))
124