merge the formfield patch from ooo-build
[ooovba.git] / odk / examples / DevelopersGuide / ProfUNO / Lifetime / Makefile
blobca9dde2cf365efc86b724ccf7fd1423ec5d9d3b7
1 #*************************************************************************
3 # $RCSfile: Makefile,v $
5 # $Revision: 1.8 $
7 # last change: $Author: rt $ $Date: 2008-07-11 14:24:47 $
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 lifetime 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 COMPONENT_NAME=ProfUnoLifetime
52 OUT_COMP_CLASS=$(OUT_CLASS)/$(COMPONENT_NAME)
53 OUT_COMP_INC=$(OUT_INC)/$(COMPONENT_NAME)
54 OUT_COMP_GEN=$(OUT_MISC)/$(COMPONENT_NAME)
55 OUT_COMP_OBJ=$(OUT_OBJ)/$(COMPONENT_NAME)
57 JAVAFILES = \
58 MyUnoObject.java
60 CLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/JavaComp/%.class,$(JAVAFILES))
62 CXXFILES = object_lifetime.cxx
64 OBJFILES = $(patsubst %.cxx,$(OUT_COMP_OBJ)/%.$(OBJ_EXT),$(CXXFILES))
66 SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
67 $(PATH_SEPARATOR)$(OUT_COMP_CLASS))
70 # Targets
71 .PHONY: ALL
72 ALL : \
73 ProUNOLifetimeExamples
75 include $(SETTINGS)/stdtarget.mk
77 $(OUT_COMP_CLASS)/%.class : %.java
78 -$(MKDIR) $(subst /,$(PS),$(@D))
79 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $<
81 $(OUT_COMP_OBJ)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
82 -$(MKDIR) $(subst /,$(PS),$(@D))
83 $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
85 $(OUT_BIN)/$(COMPONENT_NAME)$(EXE_EXT) : $(OBJFILES)
86 -$(MKDIR) $(subst /,$(PS),$(@D))
87 -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN))
88 ifeq "$(OS)" "WIN"
89 $(LINK) $(EXE_LINK_FLAGS) /OUT:$@ /MAP:$(OUT_COMP_GEN)/$(subst $(EXE_EXT),.map,$(@F)) \
90 $(OBJFILES) $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STLPORTLIB)
91 else
92 $(LINK) $(EXE_LINK_FLAGS) $(LINK_LIBS) -o $@ $(OBJFILES) \
93 $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STLPORTLIB) $(STDC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALHELPERDYLIB) $(SALDYLIB)
94 ifeq "$(OS)" "MACOSX"
95 $(INSTALL_NAME_URELIBS_BIN) $@
96 endif
97 endif
99 ProUNOLifetimeExamples : $(OUT_BIN)/$(COMPONENT_NAME)$(EXE_EXT) $(OUT_COMP_CLASS)/MyUnoObject.class
100 @echo --------------------------------------------------------------------------------
101 @echo Please use one of the following commands to execute the examples!
102 @echo -
103 @echo $(MAKE) MyUnoObject.run
104 @echo $(MAKE) ProfUnoLifetime.runexe
105 @echo --------------------------------------------------------------------------------
107 %.run: $(OUT_COMP_CLASS)/%.class
108 $(SDK_JAVA) -classpath "$(SDK_CLASSPATH)" $(basename $@)
110 %.runexe: $(OUT_BIN)/%$(EXE_EXT)
111 cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@)
113 .PHONY: clean
114 clean :
115 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC))
116 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS))
117 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
118 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_OBJ))
119 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/$(COMPONENT_NAME)$(EXE_EXT)))