merge the formfield patch from ooo-build
[ooovba.git] / odk / examples / DevelopersGuide / ProfUNO / CppBinding / Makefile
blobdaaad4aaa4d6f941433156b95b8c14c31694999e
1 #*************************************************************************
3 # $RCSfile: Makefile,v $
5 # $Revision: 1.8 $
7 # last change: $Author: rt $ $Date: 2008-07-11 14:24:18 $
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 ProfUNO cpp binding example of the Developers Guide
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 SAMPLE_NAME=ProfUnoCppBinding
52 SAMPLE_INC_OUT = $(OUT_INC)/$(SAMPLE_NAME)
53 SAMPLE_GEN_OUT = $(OUT_MISC)/$(SAMPLE_NAME)
54 SAMPLE_OBJ_OUT=$(OUT_OBJ)/$(SAMPLE_NAME)
56 APP1_NAME=office_connect
57 APP1_BINARY=$(OUT_BIN)/$(APP1_NAME)$(EXE_EXT)
58 APP1_RDB=$(OUT_BIN)/office_connect.rdb
59 APP1_ENV_FLAG = $(SAMPLE_GEN_OUT)/cpp_$(SAMPLE_NAME)_prepare_env.flag
61 APP2_NAME=string_samples
62 APP2_BINARY=$(OUT_BIN)/$(APP2_NAME)$(EXE_EXT)
64 ifeq "$(OS)" "WIN"
65 INI_EXTENSION=.ini
66 else
67 INI_EXTENSION=rc
68 endif
70 CXXFILES = \
71 office_connect.cxx \
72 string_samples.cxx
74 # Targets
75 .PHONY: ALL
76 ALL : \
77 ProUNOCppBindingExample
79 include $(SETTINGS)/stdtarget.mk
81 $(OUT_BIN)/%$(INI_EXTENSION) : %$(INI_EXTENSION)
82 -$(MKDIR) $(subst /,$(PS),$(@D))
83 $(COPY) $< $(subst /,$(PS),$@)
85 $(OUT_BIN)/%.rdb :
86 -$(MKDIR) $(subst /,$(PS),$(@D))
87 $(REGMERGE) $@ / $(URE_TYPES) $(OFFICE_TYPES)
89 $(SAMPLE_OBJ_OUT)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
90 -$(MKDIR) $(subst /,$(PS),$(@D))
91 $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(SAMPLE_INC_OUT) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
93 $(OUT_BIN)/%$(EXE_EXT) : $(SAMPLE_OBJ_OUT)/%.$(OBJ_EXT)
94 -$(MKDIR) $(subst /,$(PS),$(@D))
95 -$(MKDIR) $(subst /,$(PS),$(SAMPLE_GEN_OUT))
96 ifeq "$(OS)" "WIN"
97 $(LINK) $(EXE_LINK_FLAGS) /OUT:$@ /MAP:$(SAMPLE_GEN_OUT)/$(subst $(EXE_EXT),.map,$(@F)) \
98 $< $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STLPORTLIB)
99 else
100 $(LINK) $(EXE_LINK_FLAGS) $(LINK_LIBS) -o $@ $< \
101 $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STLPORTLIB) $(STDC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALHELPERDYLIB) $(SALDYLIB)
102 ifeq "$(OS)" "MACOSX"
103 $(INSTALL_NAME_URELIBS_BIN) $@
104 endif
105 endif
107 $(OUT_BIN)/office_connect$(EXE_EXT) : $(APP1_ENV_FLAG) $(OUT_BIN)/office_connect$(INI_EXTENSION) $(SAMPLE_OBJ_OUT)/office_connect.$(OBJ_EXT)
109 $(OUT_BIN)/string_samples$(EXE_EXT) : $(SAMPLE_OBJ_OUT)/string_samples.$(OBJ_EXT)
111 $(APP1_ENV_FLAG) : $(APP1_RDB)
112 -$(MKDIR) $(subst /,$(PS),$(@D))
113 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
114 @echo --------------------------------------------------------------------------------
115 @echo Register necessary runtime components in $(APP1_RDB)
116 @echo --------------------------------------------------------------------------------
117 $(REGCOMP) -register -r $(APP1_RDB) -c connector.uno.$(SHAREDLIB_EXT)
118 $(REGCOMP) -register -r $(APP1_RDB) -c remotebridge.uno.$(SHAREDLIB_EXT)
119 $(REGCOMP) -register -r $(APP1_RDB) -c bridgefac.uno.$(SHAREDLIB_EXT)
120 $(REGCOMP) -register -r $(APP1_RDB) -c uuresolver.uno.$(SHAREDLIB_EXT)
121 @echo bla > $@
124 ProUNOCppBindingExample : $(APP1_BINARY) $(APP2_BINARY)
125 @echo --------------------------------------------------------------------------------
126 @echo Note: For the "$(QM)$(APP1_NAME)$(QM)" example you need a running office listening
127 @echo $(SQM) $(SQM)on port 2083. Before you run the example you have to start your office with
128 @echo -
129 @echo $(SQM) $(SQM)soffice "$(QM)-accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager$(QM)"
130 @echo -----
131 @echo Please use one of the following commands to execute the examples!
132 @echo -
133 @echo $(MAKE) $(APP1_NAME).run
134 @echo $(MAKE) $(APP2_NAME).run
135 @echo --------------------------------------------------------------------------------
137 %.run: $(OUT_BIN)/%$(EXE_EXT)
138 cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@)
140 .PHONY: clean
141 clean :
142 -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_INC_OUT))
143 -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_GEN_OUT))
144 -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_OBJ_OUT))
145 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/$(APP1_NAME)*))
146 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/$(APP2_NAME)*))