1 #*************************************************************************
3 # $RCSfile: Makefile,v $
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
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
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
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
)
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
))
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
))
89 $(LINK
) $(EXE_LINK_FLAGS
) /OUT
:$@
/MAP
:$(OUT_COMP_GEN
)/$(subst $(EXE_EXT
),.map
,$(@F
)) \
90 $(OBJFILES
) $(CPPUHELPERLIB
) $(CPPULIB
) $(SALHELPERLIB
) $(SALLIB
) $(STLPORTLIB
)
92 $(LINK
) $(EXE_LINK_FLAGS
) $(LINK_LIBS
) -o
$@
$(OBJFILES
) \
93 $(CPPUHELPERLIB
) $(CPPULIB
) $(SALHELPERLIB
) $(SALLIB
) $(STLPORTLIB
) $(STDC
++LIB
) $(CPPUHELPERDYLIB
) $(CPPUDYLIB
) $(SALHELPERDYLIB
) $(SALDYLIB
)
95 $(INSTALL_NAME_URELIBS_BIN
) $@
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
!
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 $@
)
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
)))