Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / odk / examples / DevelopersGuide / ProfUNO / SimpleBootstrap_cpp / Makefile
blobde4604e82bc6128ba21d8c617e7121c418b50735
1 #*************************************************************************
3 # The Contents of this file are made available subject to the terms of
4 # the BSD license.
5 #
6 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # All rights reserved.
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions
11 # are met:
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 SimpleBootstrap_cpp example of the SDK.
37 PRJ=../../../..
38 SETTINGS=$(PRJ)/settings
40 include $(SETTINGS)/settings.mk
41 include $(SETTINGS)/std.mk
43 # Define non-platform/compiler specific settings
44 APP_NAME=SimpleBootstrap_cpp
46 OUT_APP_INC = $(OUT_INC)/$(APP_NAME)
47 OUT_APP_GEN = $(OUT_MISC)/$(APP_NAME)
48 OUT_APP_OBJ=$(OUT_OBJ)/$(APP_NAME)
50 CXXFILES = SimpleBootstrap_cpp.cxx
52 OBJFILES = $(patsubst %.cxx,$(OUT_SLO_COMP)/%.$(OBJ_EXT),$(CXXFILES))
54 # Targets
55 .PHONY: ALL
56 ALL : \
57 SimpleBootstrapCppExample
59 include $(SETTINGS)/stdtarget.mk
61 $(OUT_APP_OBJ)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
62 -$(MKDIR) $(subst /,$(PS),$(@D))
63 $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_APP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
65 $(OUT_BIN)/_$(APP_NAME)$(EXE_EXT) : $(OUT_APP_OBJ)/$(APP_NAME).$(OBJ_EXT)
66 -$(MKDIR) $(subst /,$(PS),$(@D))
67 -$(MKDIR) $(subst /,$(PS),$(OUT_APP_GEN))
68 ifeq "$(OS)" "WIN"
69 $(LINK) $(EXE_LINK_FLAGS) /OUT:$@ /MAP:$(OUT_APP_GEN)/$(basename $(@F)).map \
70 $< $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB)
71 else
72 $(LINK) $(EXE_LINK_FLAGS) $(LINK_LIBS) -o $@ $< \
73 $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STDC++LIB)
74 ifeq "$(OS)" "MACOSX"
75 $(INSTALL_NAME_URELIBS_BIN) $@
76 endif
77 endif
79 $(OUT_BIN)/$(APP_NAME)$(EXE_EXT) : $(OUT_BIN)/_$(APP_NAME)$(EXE_EXT)
80 -$(MKDIR) $(subst /,$(PS),$(@D))
81 $(COPY) $(subst /,$(PS),$(BIN_DIR)/unoapploader$(EXE_EXT)) $(subst /,$(PS),$@)
82 # workaround for touch problem under Windows with full qualified paths
83 make -t $@
85 SimpleBootstrapCppExample : $(OUT_BIN)/$(APP_NAME)$(EXE_EXT)
86 @echo --------------------------------------------------------------------------------
87 @echo Please use the following command to execute the example!
88 @echo -
89 @echo $(MAKE) SimpleBootstrap_cpp.run
90 @echo --------------------------------------------------------------------------------
92 %.run: $(OUT_BIN)/SimpleBootstrap_cpp$(EXE_EXT)
93 cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@)
95 .PHONY: clean
96 clean :
97 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_INC))
98 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_GEN))
99 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_OBJ))
100 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/*SimpleBootstrap*))