1 #*************************************************************************
3 # The Contents of this file are made available subject to the terms of
6 # Copyright 2000, 2010 Oracle and/or its affiliates.
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions
12 # 1. Redistributions of source code must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
14 # 2. Redistributions in binary form must reproduce the above copyright
15 # notice, this list of conditions and the following disclaimer in the
16 # documentation and/or other materials provided with the distribution.
17 # 3. Neither the name of Sun Microsystems, Inc. nor the names of its
18 # contributors may be used to endorse or promote products derived
19 # from this software without specific prior written permission.
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
30 # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
31 # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #**************************************************************************
35 # Builds the C++ remoteclient example of the SDK.
38 SETTINGS
=$(PRJ
)/settings
40 include $(SETTINGS
)/settings.mk
41 include $(SETTINGS
)/std.mk
43 # Define non-platform/compiler specific settings
44 COMP_NAME
=remoteclientsample
45 COMP_IMPL_NAME
=$(COMP_NAME
).uno.
$(SHAREDLIB_EXT
)
46 COMP_IMPL
=$(SHAREDLIB_OUT
)/$(COMP_IMPL_NAME
)
47 COMP_SERVICES
=$(SHAREDLIB_OUT
)/remoteclientsample.rdb
49 ENV_COMP_SERVICES
=-env
:URE_MORE_SERVICES
=$(URLPREFIX
)$(COMP_SERVICES
)
51 OUT_COMP_INC
=$(OUT_INC
)/$(COMP_NAME
)
52 OUT_COMP_GEN
=$(OUT_MISC
)/$(COMP_NAME
)
53 OUT_COMP_SLO
=$(OUT_SLO
)/$(COMP_NAME
)
55 COMP_TYPEFLAG
= $(OUT_MISC
)/cpp_
$(COMP_NAME
)_types.flag
57 CXXFILES
= remoteclient.
cxx
59 SLOFILES
= $(patsubst %.
cxx,$(OUT_COMP_SLO
)/%.
$(OBJ_EXT
),$(CXXFILES
))
66 include $(SETTINGS
)/stdtarget.mk
68 $(OUT_COMP_SLO
)/%.
$(OBJ_EXT
) : %.
cxx $(SDKTYPEFLAG
)
69 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
70 $(CC
) $(CC_FLAGS
) $(CC_INCLUDES
) -I
$(OUT_COMP_INC
) $(CC_DEFINES
) $(CC_OUTPUT_SWITCH
)$(subst /,$(PS
),$@
) $<
73 $(SHAREDLIB_OUT
)/%.
$(SHAREDLIB_EXT
) : $(SLOFILES
)
74 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
75 -$(MKDIR
) $(subst /,$(PS
),$(OUT_COMP_GEN
))
76 $(LINK
) $(COMP_LINK_FLAGS
) /OUT
:$@ \
77 /MAP
:$(OUT_COMP_GEN
)/$(subst $(SHAREDLIB_EXT
),map
,$(@F
)) $(SLOFILES
) \
78 $(CPPUHELPERLIB
) $(CPPULIB
) $(SALLIB
) msvcprt.lib
$(LIBO_SDK_LDFLAGS_STDLIBS
)
81 $(SHAREDLIB_OUT
)/%.
$(SHAREDLIB_EXT
) : $(SLOFILES
)
82 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
83 $(LINK
) $(COMP_LINK_FLAGS
) $(LINK_LIBS
) -o
$@
$(SLOFILES
) \
84 $(CPPUHELPERLIB
) $(CPPULIB
) $(SALLIB
) $(STC
++LIB
)
86 $(INSTALL_NAME_URELIBS
) $@
91 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
92 @echo
$(OSEP
)?xml version
="$(QM)1.0$(QM)" encoding
="$(QM)UTF-8$(QM)"?
$(CSEP
) > $@
93 @echo
$(OSEP
)components xmlns
="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP
) >> $@
94 @echo
$(SQM
) $(SQM
)$(OSEP
)component loader
="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri
="$(QM)$(COMP_IMPL_NAME)$(QM)"$(CSEP
) >> $@
95 @echo
$(SQM
) $(SQM
)$(OSEP
)implementation name
="$(QM)com.sun.star.comp.product.example.RemoteClientSample$(QM)"$(CSEP
) >> $@
96 @echo
$(SQM
) $(SQM
)$(OSEP
)service name
="$(QM)com.sun.star.bridge.example.RemoteClientSample$(QM)"/$(CSEP
) >> $@
97 @echo
$(SQM
) $(SQM
)$(OSEP
)/implementation
$(CSEP
) >> $@
98 @echo
$(SQM
) $(SQM
)$(OSEP
)/component
$(CSEP
) >> $@
99 @echo
$(OSEP
)/components
$(CSEP
) >> $@
102 #CppClientExample : $(COMP_IMPL) $(COMP_ENV_FLAG)
103 CppClientExample
: $(COMP_IMPL
) $(COMP_SERVICES
)
104 @echo
--------------------------------------------------------------------------------
105 @echo The remoteclient C
++ component can be used by using the uno binary. Use the
106 @echo the following command to start the example. The run target starts a remote
107 @echo server and connect with the client to this server.
109 @echo
$(MAKE
) remoteclient.run
111 @echo NOTE
: The example uses the
$(QM
)uno
$(QM
) tool to prepare a working UNO environment.
112 @echo
$(SQM
) $(SQM
)The example component is made available via
-env
:URE_MORE_SERVICES
=...
113 @echo
$(SQM
) $(SQM
)Please
check the generated
$(QM
)$(COMP_SERVICES
)$(QM
) to see how you can specify your own components in such an environment
114 @echo
$(SQM
) $(SQM
)and how to use the passive UNO registration.
115 @echo
--------------------------------------------------------------------------------
118 @echo Start the remote server process ...
121 start uno
$(ENV_COMP_SERVICES
) --singleaccept
-s com.sun.star.io.Pipe \
122 -u
"uno:socket,host=localhost,port=2083;urp;MyPipe"
124 uno
$(ENV_COMP_SERVICES
) --singleaccept
-s com.sun.star.io.Pipe \
125 -u
"uno:socket,host=localhost,port=2083;urp;MyPipe" &
126 @echo waiting on the server process ...
130 @echo ... remote server process runs ...
132 @echo Start remote client process ...
134 uno
$(ENV_COMP_SERVICES
) -s com.sun.star.bridge.example.RemoteClientSample \
135 -- "uno:socket,host=localhost,port=2083;urp;MyPipe"
140 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_INC
))
141 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_GEN
))
142 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_SLO
))
143 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$(COMP_TYPEFLAG
)))
144 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$(COMP_SERVICES
)))
145 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$(SHAREDLIB_OUT
)/$(COMP_NAME
).
*))
146 # -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/remoteserver.rdb))