Update ooo320-m1
[ooovba.git] / odk / examples / DevelopersGuide / ProfUNO / SimpleBootstrap_cpp / Makefile
blob89a35614620835aef6c20514a571b3a252be4aab
1 #*************************************************************************
3 # $RCSfile: Makefile,v $
5 # $Revision: 1.6 $
7 # last change: $Author: rt $ $Date: 2008-07-11 14:25:00 $
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 SimpleBootstrap_cpp 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 APP_NAME=SimpleBootstrap_cpp
53 OUT_APP_INC = $(OUT_INC)/$(APP_NAME)
54 OUT_APP_GEN = $(OUT_MISC)/$(APP_NAME)
55 OUT_APP_OBJ=$(OUT_OBJ)/$(APP_NAME)
57 CXXFILES = SimpleBootstrap_cpp.cxx
59 OBJFILES = $(patsubst %.cxx,$(OUT_SLO_COMP)/%.$(OBJ_EXT),$(CXXFILES))
61 # Targets
62 .PHONY: ALL
63 ALL : \
64 SimpleBootstrapCppExample
66 include $(SETTINGS)/stdtarget.mk
68 $(OUT_APP_OBJ)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
69 -$(MKDIR) $(subst /,$(PS),$(@D))
70 $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_APP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
72 $(OUT_BIN)/_$(APP_NAME)$(EXE_EXT) : $(OUT_APP_OBJ)/$(APP_NAME).$(OBJ_EXT)
73 -$(MKDIR) $(subst /,$(PS),$(@D))
74 -$(MKDIR) $(subst /,$(PS),$(OUT_APP_GEN))
75 ifeq "$(OS)" "WIN"
76 $(LINK) $(EXE_LINK_FLAGS) /OUT:$@ /MAP:$(OUT_APP_GEN)/$(basename $(@F)).map \
77 $< $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STLPORTLIB)
78 else
79 $(LINK) $(EXE_LINK_FLAGS) $(LINK_LIBS) -o $@ $< \
80 $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STLPORTLIB) $(STDC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALHELPERDYLIB) $(SALDYLIB)
81 ifeq "$(OS)" "MACOSX"
82 $(INSTALL_NAME_URELIBS_BIN) $@
83 endif
84 endif
86 $(OUT_BIN)/$(APP_NAME)$(EXE_EXT) : $(OUT_BIN)/_$(APP_NAME)$(EXE_EXT)
87 -$(MKDIR) $(subst /,$(PS),$(@D))
88 $(COPY) $(subst /,$(PS),$(BIN_DIR)/unoapploader$(EXE_EXT)) $(subst /,$(PS),$@)
89 # workaround for touch problem under Windows with full qualified paths
90 make -t $@
92 SimpleBootstrapCppExample : $(OUT_BIN)/$(APP_NAME)$(EXE_EXT)
93 @echo --------------------------------------------------------------------------------
94 @echo Please use the following command to execute the example!
95 @echo -
96 @echo $(MAKE) SimpleBootstrap_cpp.run
97 @echo --------------------------------------------------------------------------------
99 %.run: $(OUT_BIN)/SimpleBootstrap_cpp$(EXE_EXT)
100 cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@)
102 .PHONY: clean
103 clean :
104 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_INC))
105 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_GEN))
106 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_OBJ))
107 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/*SimpleBootstrap*))