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++ DocumentLoader 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 COMPONENT_NAME
=DocumentLoader
46 OUT_COMP_INC
= $(OUT_INC
)/$(COMPONENT_NAME
)
47 OUT_COMP_GEN
= $(OUT_MISC
)/$(COMPONENT_NAME
)
48 OUT_COMP_OBJ
=$(OUT_OBJ
)/$(COMPONENT_NAME
)
50 CXXFILES
= DocumentLoader.
cxx
52 OBJFILES
= $(patsubst %.
cxx,$(OUT_SLO_COMP
)/%.
$(OBJ_EXT
),$(CXXFILES
))
54 ENV_OFFICE_TYPES
=-env
:URE_MORE_TYPES
=$(URLPREFIX
)$(OFFICE_TYPES
)
59 CppDocumentLoaderExample
61 include $(SETTINGS
)/stdtarget.mk
63 $(OUT_COMP_OBJ
)/%.
$(OBJ_EXT
) : %.
cxx $(SDKTYPEFLAG
)
64 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
65 $(CC
) $(CC_FLAGS
) $(CC_INCLUDES
) -I
$(OUT_COMP_INC
) $(CC_DEFINES
) $(CC_OUTPUT_SWITCH
)$(subst /,$(PS
),$@
) $<
67 $(OUT_BIN
)/DocumentLoader
$(EXE_EXT
) : $(OUT_COMP_OBJ
)/DocumentLoader.
$(OBJ_EXT
)
68 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
69 -$(MKDIR
) $(subst /,$(PS
),$(OUT_COMP_GEN
))
71 $(LINK
) $(EXE_LINK_FLAGS
) /OUT
:$@
/MAP
:$(OUT_COMP_GEN
)/$(basename $(@F
)).map \
72 $< $(CPPUHELPERLIB
) $(CPPULIB
) $(SALHELPERLIB
) $(SALLIB
)
74 $(LINK
) $(EXE_LINK_FLAGS
) $(LINK_LIBS
) -o
$@
$< \
75 $(CPPUHELPERLIB
) $(CPPULIB
) $(SALHELPERLIB
) $(SALLIB
) $(STDC
++LIB
)
77 $(INSTALL_NAME_URELIBS_BIN
) $@
81 CppDocumentLoaderExample
: $(OUT_BIN
)/DocumentLoader
$(EXE_EXT
)
82 @echo
--------------------------------------------------------------------------------
83 @echo The example loads the
"$(QM)test.odt$(QM)" document in the DocumentLoader example directory.
84 @echo If you want to load your own document
, please use
:
85 @echo
$(SQM
) $(SQM
)DocumentLoader
-env
:URE_MORE_TYPES
="$(QM)<fileurl_office_types_rdb>$(QM)" "$(QM)filename$(QM)" [connection_url
]
87 @echo Use the following command to execute the example
!
89 @echo
$(MAKE
) DocumentLoader.run
91 @echo NOTE
: This example does not use the new UNO bootstrap mechanism
, it uses still a socket
92 @echo
$(SQM
) $(SQM
)connection. The example use the defaultBootstrap_InitialComponentContext method and provides
93 @echo
$(SQM
) $(SQM
)the additional office types via the UNO environment variable
-env
:URE_MORE_TYPES
=...
94 @echo
$(SQM
) $(SQM
)Before you can run this example you have to start your office in listening mode.
96 @echo
$(SQM
) $(SQM
)soffice
"$(QM)--accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager$(QM)"
97 @echo
--------------------------------------------------------------------------------
99 %.run
: $(OUT_BIN
)/DocumentLoader
$(EXE_EXT
)
100 cd
$(subst /,$(PS
),$(OUT_BIN
)) && $(basename $@
) $(ENV_OFFICE_TYPES
) $(subst \\,/,$(subst /,$(PS
),"$(OO_SDK_HOME)/examples/cpp/DocumentLoader/test.odt"))
104 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_INC
))
105 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_GEN
))
106 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_OBJ
))
107 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$(OUT_BIN
)/DocumentLoader
*))