1 #*************************************************************************
3 # $RCSfile: Makefile,v $
7 # last change: $Author: rt $ $Date: 2004-05-18 13:29:10 $
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 OLE activex C++ component example of the SDK.
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
=so_activex
52 COMPONENT_IMPL_NAME
=$(SHAREDLIB_PRE
)$(COMPONENT_NAME
).
$(SHAREDLIB_EXT
)
53 COMPONENT_IMPL
=$(SHAREDLIB_OUT
)/$(SHAREDLIB_PRE
)$(COMPONENT_NAME
).
$(SHAREDLIB_EXT
)
54 OUT_COMP_INC
= $(OUT_INC
)/$(COMPONENT_NAME
)
55 OUT_COMP_GEN
= $(OUT_MISC
)/$(COMPONENT_NAME
)
56 OUT_COMP_SLO
=$(OUT_SLO
)/$(COMPONENT_NAME
)
58 MIDLFILES
= so_activex.idl
60 CXXFILES
= SOActiveX.
cpp \
65 SLOFILES
= $(patsubst %.
cpp,$(OUT_COMP_SLO
)/%.
$(OBJ_EXT
),$(CXXFILES
))
70 OleActvieXComponentExample
72 include $(SETTINGS
)/stdtarget.mk
74 # Attention: so_activex.idl is no UNOIDL file!
75 $(OUT_COMP_INC
)/so_activex.h
: so_activex.idl
76 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
77 -$(MKDIR
) $(subst /,$(PS
),$(OUT_COMP_GEN
))
78 midl.exe
/tlb
$(OUT_COMP_GEN
)/so_activex.tlb
/h
$(OUT_COMP_INC
)/so_activex.h \
79 /iid
$(OUT_COMP_INC
)/so_activex_i.c
/proxy
$(OUT_COMP_INC
)/so_activex_p.c \
80 /dlldata
$(OUT_COMP_INC
)/dlldata.c
/Oicf
$<
82 $(OUT_COMP_GEN
)/so_activex.res
: so_activex.rc
$(OUT_COMP_INC
)/so_activex.h
83 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
84 rc
$(CC_INCLUDES
) /R
/FO
$@ so_activex.rc
86 $(OUT_COMP_SLO
)/%.
$(OBJ_EXT
) : %.
cpp
87 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
88 $(CC
) $(CC_FLAGS
) $(CC_INCLUDES
) -I
$(OUT_COMP_INC
) $(CC_DEFINES
) $(CC_OUTPUT_SWITCH
)$(subst /,$(PS
),$@
) $<
91 # Note: If you don't use the MS Visual Studio .Net, please comment out the next line.
94 $(SHAREDLIB_OUT
)/$(SHAREDLIB_PRE
)%.
$(SHAREDLIB_EXT
) : $(SLOFILES
) $(OUT_COMP_GEN
)/so_activex.res so_activex.def
95 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
96 -$(MKDIR
) $(subst /,$(PS
),$(OUT_LIB
))
98 @echo
-----------------------------------------------------------------------------------
99 @echo ATTENTION
: If you have problems with linking the library and if you do not use the
100 @echo MS .Net compiler please
check the makefile and comment out the variable CL_NEW_LIB.
101 @echo
-----------------------------------------------------------------------------------
103 $(LINK
) $(LIBRARY_LINK_FLAGS
) /OUT
:$@
/MAP
:$(OUT_COMP_GEN
)/$(subst $(SHAREDLIB_EXT
),map
,$(@F
)) \
104 /DEF
:so_activex.def
/IMPLIB
:$(OUT_LIB
)/iso_activex.lib
$(SLOFILES
) \
105 msvcrt.lib kernel32.lib user32.lib uuid.lib advapi32.lib ole32.lib oleaut32.lib gdi32.lib \
106 urlmon.lib Shlwapi.lib oldnames.lib
$(CL_NEW_LIB
) $(OUT_COMP_GEN
)/so_activex.res
109 OleActvieXComponentExample
: $(COMPONENT_IMPL
)
110 @echo
--------------------------------------------------------------------------------
111 @echo The activex control was created
, please load the
"$(QM)example.html$(QM)" file
112 @echo in your InternetExplorer to use the activex control.
113 @echo
--------------------------------------------------------------------------------
115 OleActvieXComponentExample
:
116 @echo
--------------------------------------------------------------------------------
117 @echo This example works only under Windows
!
118 @echo
--------------------------------------------------------------------------------
123 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_INC
))
124 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_GEN
))
125 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_SLO
))
126 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$(OUT_LIB
)/*$(COMPONENT_NAME
).
*))
127 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$(SHAREDLIB_OUT
)/$(SHAREDLIB_PRE
)$(COMPONENT_NAME
).
*))