Update ooo320-m1
[ooovba.git] / odk / examples / cpp / remoteclient / Makefile
blob4486a5ac9f0a5fda6a2ca43d205fbbe9567d4cb4
1 #*************************************************************************
3 # $RCSfile: Makefile,v $
5 # $Revision: 1.14 $
7 # last change: $Author: rt $ $Date: 2008-07-11 14:27:53 $
9 # The Contents of this file are made available subject to the terms of
10 # the BSD license.
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
17 # are met:
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 C++ remoteclient example of the SDK.
43 PRJ=../../..
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 COMP_NAME=remoteclientsample
52 COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
53 COMP_IMPL=$(SHAREDLIB_OUT)/$(COMP_IMPL_NAME)
54 COMP_RDB_NAME = $(COMP_NAME).uno.rdb
55 COMP_RDB = $(OUT_BIN)/$(COMP_RDB_NAME)
56 COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map
58 OUT_COMP_INC=$(OUT_INC)/$(COMP_NAME)
59 OUT_COMP_GEN=$(OUT_MISC)/$(COMP_NAME)
60 OUT_COMP_SLO=$(OUT_SLO)/$(COMP_NAME)
62 COMP_ENV_FLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_prepare_env.flag
63 COMP_TYPEFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_types.flag
65 CXXFILES = remoteclient.cxx
67 SLOFILES = $(patsubst %.cxx,$(OUT_COMP_SLO)/%.$(OBJ_EXT),$(CXXFILES))
69 # Targets
70 .PHONY: ALL
71 ALL : \
72 CppClientExample
74 include $(SETTINGS)/stdtarget.mk
76 # This example type library will be extended by the URE types
77 $(OUT_BIN)/%.rdb :
78 -$(MKDIR) $(subst /,$(PS),$(@D))
79 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
80 $(REGMERGE) $@ / $(URE_TYPES)
82 $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
83 -$(MKDIR) $(subst /,$(PS),$(@D))
84 $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
86 $(COMP_MAPFILE) : $(SLOFILES)
87 -$(MKDIR) $(subst /,$(PS),$(@D))
88 cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
89 ifeq "$(OS)" "MACOSX"
90 nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
91 endif
93 ifeq "$(OS)" "WIN"
94 $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
95 -$(MKDIR) $(subst /,$(PS),$(@D))
96 -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN))
97 $(LINK) $(COMP_LINK_FLAGS) /OUT:$@ \
98 /MAP:$(OUT_COMP_GEN)/$(subst $(SHAREDLIB_EXT),map,$(@F)) $(SLOFILES) \
99 $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib
100 $(LINK_MANIFEST_VC8_ONLY)
101 else
102 $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE)
103 -$(MKDIR) $(subst /,$(PS),$(@D))
104 $(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \
105 $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB)
106 ifeq "$(OS)" "MACOSX"
107 $(INSTALL_NAME_URELIBS) $@
108 endif
109 endif
111 $(COMP_ENV_FLAG) : $(COMP_RDB) $(OUT_BIN)/remoteserver.rdb
112 -$(MKDIR) $(subst /,$(PS),$(@D))
113 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
114 @echo --------------------------------------------------------------------------------
115 @echo Register necessary runtime components in remoteserver/remoteclientsample rdb
116 @echo --------------------------------------------------------------------------------
117 $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c connector.uno.$(SHAREDLIB_EXT)
118 $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c remotebridge.uno.$(SHAREDLIB_EXT)
119 $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c bridgefac.uno.$(SHAREDLIB_EXT)
120 $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c uuresolver.uno.$(SHAREDLIB_EXT)
121 $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c streams.uno.$(SHAREDLIB_EXT)
122 $(REGCOMP) -register -r $(COMP_RDB) -c connector.uno.$(SHAREDLIB_EXT)
123 $(REGCOMP) -register -r $(COMP_RDB) -c remotebridge.uno.$(SHAREDLIB_EXT)
124 $(REGCOMP) -register -r $(COMP_RDB) -c bridgefac.uno.$(SHAREDLIB_EXT)
125 $(REGCOMP) -register -r $(COMP_RDB) -c uuresolver.uno.$(SHAREDLIB_EXT)
126 @echo bla > $@
128 CppClientExample : $(COMP_IMPL) $(COMP_ENV_FLAG)
129 @echo --------------------------------------------------------------------------------
130 @echo The remoteclient C++ component can be used by using the uno binary. Use the
131 @echo the follwong command to start the example. The run target starts a remote
132 @echo server and connect with the client to this server.
133 @echo -
134 @echo $(MAKE) remoteclient.run
135 @echo --------------------------------------------------------------------------------
137 %.run: $(COMP_IMPL) $(COMP_ENV_FLAG)
138 @echo Start the remote server process ...
139 @echo -
140 ifeq "$(OS)" "WIN"
141 start uno -rw $(OUT_BIN)/remoteserver.rdb --singleaccept -s com.sun.star.io.Pipe \
142 -u "uno:socket,host=localhost,port=2083;urp;MyPipe"
143 else
144 uno -rw $(OUT_BIN)/remoteserver.rdb --singleaccept -s com.sun.star.io.Pipe \
145 -u "uno:socket,host=localhost,port=2083;urp;MyPipe" &
146 @echo waiting on the server process ...
147 sleep 5
148 endif
149 @echo -
150 @echo ... remote server process runs ...
151 @echo -
152 @echo Start remote client process ...
153 @echo -
154 uno -l $(COMP_IMPL) -c com.sun.star.comp.product.example.RemoteClientSample \
155 -rw $(COMP_RDB) -- "uno:socket,host=localhost,port=2083;urp;MyPipe"
156 @echo -
158 .PHONY: clean
159 clean :
160 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC))
161 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
162 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_SLO))
163 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_ENV_FLAG)))
164 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_TYPEFLAG)))
165 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(SHAREDLIB_OUT)/$(COMP_NAME).*))
166 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/remoteserver.rdb))