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_RDB_NAME
= $(COMP_NAME
).uno.rdb
48 COMP_RDB
= $(OUT_BIN
)/$(COMP_RDB_NAME
)
49 COMP_SERVICES
=$(SHAREDLIB_OUT
)/remoteclientsample.rdb
51 ENV_COMP_SERVICES
=-env
:URE_MORE_SERVICES
=$(URLPREFIX
)$(COMP_SERVICES
)
53 OUT_COMP_INC
=$(OUT_INC
)/$(COMP_NAME
)
54 OUT_COMP_GEN
=$(OUT_MISC
)/$(COMP_NAME
)
55 OUT_COMP_SLO
=$(OUT_SLO
)/$(COMP_NAME
)
57 COMP_TYPEFLAG
= $(OUT_MISC
)/cpp_
$(COMP_NAME
)_types.flag
59 CXXFILES
= remoteclient.
cxx
61 SLOFILES
= $(patsubst %.
cxx,$(OUT_COMP_SLO
)/%.
$(OBJ_EXT
),$(CXXFILES
))
68 include $(SETTINGS
)/stdtarget.mk
70 # This example type library will be extended by the URE types
72 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
73 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$@
))
74 $(REGMERGE
) $@
/ $(URE_TYPES
)
76 $(OUT_COMP_SLO
)/%.
$(OBJ_EXT
) : %.
cxx $(SDKTYPEFLAG
)
77 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
78 $(CC
) $(CC_FLAGS
) $(CC_INCLUDES
) -I
$(OUT_COMP_INC
) $(CC_DEFINES
) $(CC_OUTPUT_SWITCH
)$(subst /,$(PS
),$@
) $<
81 $(SHAREDLIB_OUT
)/%.
$(SHAREDLIB_EXT
) : $(SLOFILES
)
82 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
83 -$(MKDIR
) $(subst /,$(PS
),$(OUT_COMP_GEN
))
84 $(LINK
) $(COMP_LINK_FLAGS
) /OUT
:$@ \
85 /MAP
:$(OUT_COMP_GEN
)/$(subst $(SHAREDLIB_EXT
),map
,$(@F
)) $(SLOFILES
) \
86 $(CPPUHELPERLIB
) $(CPPULIB
) $(SALLIB
) msvcprt.lib
$(LIBO_SDK_LDFLAGS_STDLIBS
)
89 $(SHAREDLIB_OUT
)/%.
$(SHAREDLIB_EXT
) : $(SLOFILES
)
90 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
91 $(LINK
) $(COMP_LINK_FLAGS
) $(LINK_LIBS
) -o
$@
$(SLOFILES
) \
92 $(CPPUHELPERLIB
) $(CPPULIB
) $(SALLIB
) $(STC
++LIB
)
94 $(INSTALL_NAME_URELIBS
) $@
99 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
100 @echo
$(OSEP
)?xml version
="$(QM)1.0$(QM)" encoding
="$(QM)UTF-8$(QM)"?
$(CSEP
) > $@
101 @echo
$(OSEP
)components xmlns
="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP
) >> $@
102 @echo
$(SQM
) $(SQM
)$(OSEP
)component loader
="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri
="$(QM)$(COMP_IMPL_NAME)$(QM)"$(CSEP
) >> $@
103 @echo
$(SQM
) $(SQM
)$(OSEP
)implementation name
="$(QM)com.sun.star.comp.product.example.RemoteClientSample$(QM)"$(CSEP
) >> $@
104 @echo
$(SQM
) $(SQM
)$(OSEP
)service name
="$(QM)com.sun.star.bridge.example.RemoteClientSample$(QM)"/$(CSEP
) >> $@
105 @echo
$(SQM
) $(SQM
)$(OSEP
)/implementation
$(CSEP
) >> $@
106 @echo
$(SQM
) $(SQM
)$(OSEP
)/component
$(CSEP
) >> $@
107 @echo
$(OSEP
)/components
$(CSEP
) >> $@
110 #CppClientExample : $(COMP_IMPL) $(COMP_ENV_FLAG)
111 CppClientExample
: $(COMP_IMPL
) $(COMP_SERVICES
)
112 @echo
--------------------------------------------------------------------------------
113 @echo The remoteclient C
++ component can be used by using the uno binary. Use the
114 @echo the following command to start the example. The run target starts a remote
115 @echo server and connect with the client to this server.
117 @echo
$(MAKE
) remoteclient.run
119 @echo NOTE
: The example uses the
$(QM
)uno
$(QM
) tool to prepare a working UNO environment.
120 @echo
$(SQM
) $(SQM
)The example component is made available via
-env
:URE_MORE_SERVICES
=...
121 @echo
$(SQM
) $(SQM
)Please
check the generated
$(QM
)$(COMP_SERVICES
)$(QM
) to see how you can specify your own components in such an environment
122 @echo
$(SQM
) $(SQM
)and how to use the passive UNO registration.
123 @echo
--------------------------------------------------------------------------------
126 @echo Start the remote server process ...
129 start uno
$(ENV_COMP_SERVICES
) --singleaccept
-s com.sun.star.io.Pipe \
130 -u
"uno:socket,host=localhost,port=2083;urp;MyPipe"
132 uno
$(ENV_COMP_SERVICES
) --singleaccept
-s com.sun.star.io.Pipe \
133 -u
"uno:socket,host=localhost,port=2083;urp;MyPipe" &
134 @echo waiting on the server process ...
138 @echo ... remote server process runs ...
140 @echo Start remote client process ...
142 uno
$(ENV_COMP_SERVICES
) -s com.sun.star.bridge.example.RemoteClientSample \
143 -- "uno:socket,host=localhost,port=2083;urp;MyPipe"
148 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_INC
))
149 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_GEN
))
150 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_SLO
))
151 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$(COMP_TYPEFLAG
)))
152 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$(COMP_SERVICES
)))
153 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$(SHAREDLIB_OUT
)/$(COMP_NAME
).
*))
154 # -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/remoteserver.rdb))