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 ProfUNO interprocess example of the Developers Guide.
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=ProfUNOInterprocessExamples
33OUT_APP_CLASS=$(OUT_CLASS)/$(EXAMPLE_NAME)
34
35JAVAFILES  = \
36	ConnectionAwareClient.java \
37	UrlResolver.java
38
39CLASSFILES = $(patsubst %.java,$(OUT_APP_CLASS)/%.class,$(JAVAFILES))
40
41SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
42		$(PATH_SEPARATOR)$(OUT_APP_CLASS))
43
44
45# Targets
46.PHONY: ALL
47ALL : $(EXAMPLE_NAME)
48
49include $(SETTINGS)/stdtarget.mk
50
51$(OUT_APP_CLASS)/%.class : %.java
52	-$(MKDIR) $(subst /,$(PS),$(@D))
53	$(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_APP_CLASS) $<
54
55$(EXAMPLE_NAME) : $(CLASSFILES)
56	@echo --------------------------------------------------------------------------------
57	@echo Note: For these examples you need a running office listening on port 2083.
58	@echo $(SQM)      $(SQM)Before you run these examples you have to start your office with
59	@echo -
60	@echo $(SQM)  $(SQM)soffice "$(QM)-accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager$(QM)"
61	@echo -----
62	@echo Please use one of the following commands to execute the examples!
63	@echo -
64	@echo $(MAKE) ConnectionAwareClient.run
65	@echo $(MAKE) UrlResolver.run
66	@echo --------------------------------------------------------------------------------
67
68%.run: $(OUT_APP_CLASS)/%.class
69	$(SDK_JAVA) -classpath "$(SDK_CLASSPATH)" $(basename $@) "uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager"
70
71.PHONY: clean
72clean :
73	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_CLASS))
74