Get the style color and number just once
[LibreOffice.git] / odk / examples / DevelopersGuide / ProfUNO / Lifetime / Makefile
blob2b334745948c9d159286065aaebd903b54781a1c
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 ProfUNO lifetime example of the Developers Guide
37 PRJ=../../../..
38 SETTINGS=$(PRJ)/settings
40 include $(SETTINGS)/settings.mk
41 include $(SETTINGS)/std.mk
43 # Define non-platform/compiler specific settings
44 COMPONENT_NAME=ProfUnoLifetime
45 OUT_COMP_CLASS=$(OUT_CLASS)/$(COMPONENT_NAME)
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 JAVAFILES = \
51 MyUnoObject.java
53 CLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/JavaComp/%.class,$(JAVAFILES))
55 CXXFILES = object_lifetime.cxx
57 OBJFILES = $(patsubst %.cxx,$(OUT_COMP_OBJ)/%.$(OBJ_EXT),$(CXXFILES))
59 SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
60 $(PATH_SEPARATOR)$(OUT_COMP_CLASS))
63 # Targets
64 .PHONY: ALL
65 ALL : \
66 ProUNOLifetimeExamples
68 include $(SETTINGS)/stdtarget.mk
70 $(OUT_COMP_CLASS)/%.class : %.java
71 -$(MKDIR) $(subst /,$(PS),$(@D))
72 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $<
74 $(OUT_COMP_OBJ)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
75 -$(MKDIR) $(subst /,$(PS),$(@D))
76 $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
78 $(OUT_BIN)/$(COMPONENT_NAME)$(EXE_EXT) : $(OBJFILES)
79 -$(MKDIR) $(subst /,$(PS),$(@D))
80 -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN))
81 ifeq "$(OS)" "WIN"
82 $(LINK) $(EXE_LINK_FLAGS) /OUT:$@ /MAP:$(OUT_COMP_GEN)/$(subst $(EXE_EXT),.map,$(@F)) \
83 $(OBJFILES) $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB)
84 else
85 $(LINK) $(EXE_LINK_FLAGS) $(LINK_LIBS) -o $@ $(OBJFILES) \
86 $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STDC++LIB)
87 ifeq "$(OS)" "MACOSX"
88 $(INSTALL_NAME_URELIBS_BIN) $@
89 endif
90 endif
92 ProUNOLifetimeExamples : $(OUT_BIN)/$(COMPONENT_NAME)$(EXE_EXT) $(OUT_COMP_CLASS)/MyUnoObject.class
93 @echo --------------------------------------------------------------------------------
94 @echo Please use one of the following commands to execute the examples!
95 @echo -
96 @echo $(MAKE) MyUnoObject.run
97 @echo $(MAKE) ProfUnoLifetime.runexe
98 @echo --------------------------------------------------------------------------------
100 %.run: $(OUT_COMP_CLASS)/%.class
101 $(SDK_JAVA) -classpath "$(SDK_CLASSPATH)" $(basename $@)
103 %.runexe: $(OUT_BIN)/%$(EXE_EXT)
104 cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@)
106 .PHONY: clean
107 clean :
108 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC))
109 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS))
110 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
111 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_OBJ))
112 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/$(COMPONENT_NAME)$(EXE_EXT)))