Update ooo320-m1
[ooovba.git] / odk / examples / cpp / DocumentLoader / Makefile
blob344eedc6e6935bc51f9e5ad1660b93127472fdd9
1 #*************************************************************************
3 # $RCSfile: Makefile,v $
5 # $Revision: 1.18 $
7 # last change: $Author: rt $ $Date: 2008-07-11 14:25:54 $
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++ DocumentLoader 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 COMPONENT_NAME=DocumentLoader
52 COMPONENT_RDB_NAME = $(COMPONENT_NAME).rdb
53 COMPONENT_RDB = $(OUT_BIN)/$(COMPONENT_RDB_NAME)
55 OUT_COMP_INC = $(OUT_INC)/$(COMPONENT_NAME)
56 OUT_COMP_GEN = $(OUT_MISC)/$(COMPONENT_NAME)
57 OUT_COMP_OBJ=$(OUT_OBJ)/$(COMPONENT_NAME)
59 COMPOENNT_ENV_FLAG = $(OUT_MISC)/cpp_$(COMPONENT_NAME)_prepare_env.flag
61 CXXFILES = DocumentLoader.cxx
63 OBJFILES = $(patsubst %.cxx,$(OUT_SLO_COMP)/%.$(OBJ_EXT),$(CXXFILES))
65 # Targets
66 .PHONY: ALL
67 ALL : \
68 CppDocumentLoaderExample
70 include $(SETTINGS)/stdtarget.mk
72 # This example type library will be extended by the URE and office types
73 $(OUT_BIN)/%.rdb :
74 -$(MKDIR) $(subst /,$(PS),$(@D))
75 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
76 $(REGMERGE) $@ / $(URE_TYPES) $(OFFICE_TYPES)
78 $(OUT_COMP_OBJ)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
79 -$(MKDIR) $(subst /,$(PS),$(@D))
80 $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
82 $(OUT_BIN)/DocumentLoader$(EXE_EXT) : $(OUT_COMP_OBJ)/DocumentLoader.$(OBJ_EXT)
83 -$(MKDIR) $(subst /,$(PS),$(@D))
84 -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN))
85 ifeq "$(OS)" "WIN"
86 $(LINK) $(EXE_LINK_FLAGS) /OUT:$@ /MAP:$(OUT_COMP_GEN)/$(basename $(@F)).map \
87 $< $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STLPORTLIB)
88 else
89 $(LINK) $(EXE_LINK_FLAGS) $(LINK_LIBS) -o $@ $< \
90 $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STLPORTLIB) $(STDC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALHELPERDYLIB) $(SALDYLIB)
91 ifeq "$(OS)" "MACOSX"
92 $(INSTALL_NAME_URELIBS_BIN) $@
93 endif
94 endif
96 $(COMPOENNT_ENV_FLAG) : $(COMPONENT_RDB)
97 -$(MKDIR) $(subst /,$(PS),$(@D))
98 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
99 @echo --------------------------------------------------------------------------------
100 @echo Register necessary runtime components in the DocumentLoader.rdb
101 @echo --------------------------------------------------------------------------------
102 $(REGCOMP) -register -r $(COMPONENT_RDB) -c connector.uno.$(SHAREDLIB_EXT)
103 $(REGCOMP) -register -r $(COMPONENT_RDB) -c remotebridge.uno.$(SHAREDLIB_EXT)
104 $(REGCOMP) -register -r $(COMPONENT_RDB) -c bridgefac.uno.$(SHAREDLIB_EXT)
105 $(REGCOMP) -register -r $(COMPONENT_RDB) -c uuresolver.uno.$(SHAREDLIB_EXT)
106 @echo bla > $@
108 CppDocumentLoaderExample : $(OUT_BIN)/DocumentLoader$(EXE_EXT) $(COMPOENNT_ENV_FLAG)
109 @echo --------------------------------------------------------------------------------
110 @echo The example loads the "$(QM)test.odt$(QM)" document in the DocumentLoader example directory.
111 @echo I you want to load your own document, please use: DocumentLoader "$(QM)filename$(QM)" [connection_url]
112 @echo -
113 @echo Use the following command to execute the example!
114 @echo -
115 @echo $(MAKE) DocumentLoader.run
116 @echo -
117 @echo NOTE: This example does not use the new UNO bootstrap mechanism, it uses still a socket
118 @echo $(SQM) $(SQM)connection. Before you can run this example you have to start your office in listening mode.
119 @echo -
120 @echo $(SQM) $(SQM)soffice "$(QM)-accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager$(QM)"
121 @echo --------------------------------------------------------------------------------
123 %.run: $(OUT_BIN)/DocumentLoader$(EXE_EXT)
124 cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@) $(subst \\,/,$(subst /,$(PS),"$(OO_SDK_HOME)/examples/cpp/DocumentLoader/test.odt"))
126 .PHONY: clean
127 clean :
128 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC))
129 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
130 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_OBJ))
131 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPOENNT_ENV_FLAG)))
132 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_RDB)))
133 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/DocumentLoader*))