Branch libreoffice-5-0-4
[LibreOffice.git] / odk / examples / OLE / activex / Makefile
blob15167bc93ba4cbaf040c83c00d9895b47b3a9c1a
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 OLE activex C++ component 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 COMPONENT_NAME=so_activex
45 COMPONENT_IMPL_NAME=$(SHAREDLIB_PRE)$(COMPONENT_NAME).$(SHAREDLIB_EXT)
46 COMPONENT_IMPL=$(SHAREDLIB_OUT)/$(SHAREDLIB_PRE)$(COMPONENT_NAME).$(SHAREDLIB_EXT)
47 OUT_COMP_INC = $(OUT_INC)/$(COMPONENT_NAME)
48 OUT_COMP_GEN = $(OUT_MISC)/$(COMPONENT_NAME)
49 OUT_COMP_SLO=$(OUT_SLO)/$(COMPONENT_NAME)
51 MIDLFILES = so_activex.idl
53 CXXFILES = SOActiveX.cpp \
54 SOComWindowPeer.cpp \
55 so_activex.cpp \
56 StdAfx2.cpp
58 SLOFILES = $(patsubst %.cpp,$(OUT_COMP_SLO)/%.$(OBJ_EXT),$(CXXFILES))
60 # Targets
61 .PHONY: ALL
62 ALL : \
63 OleActvieXComponentExample
65 include $(SETTINGS)/stdtarget.mk
67 # Attention: so_activex.idl is no UNOIDL file!
68 $(OUT_COMP_INC)/so_activex.h : so_activex.idl
69 -$(MKDIR) $(subst /,$(PS),$(@D))
70 -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN))
71 midl.exe /tlb $(OUT_COMP_GEN)/so_activex.tlb /h $(OUT_COMP_INC)/so_activex.h \
72 /iid $(OUT_COMP_INC)/so_activex_i.c /proxy $(OUT_COMP_INC)/so_activex_p.c \
73 /dlldata $(OUT_COMP_INC)/dlldata.c /Oicf $<
75 $(OUT_COMP_GEN)/so_activex.res : so_activex.rc $(OUT_COMP_INC)/so_activex.h
76 -$(MKDIR) $(subst /,$(PS),$(@D))
77 rc $(CC_INCLUDES) /R /FO$@ so_activex.rc
79 $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cpp
80 -$(MKDIR) $(subst /,$(PS),$(@D))
81 $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
84 # Note: If you don't use the MS Visual Studio .Net, please comment out the next line.
85 CL_NEW_LIB=atls.lib
87 $(SHAREDLIB_OUT)/$(SHAREDLIB_PRE)%.$(SHAREDLIB_EXT) : $(SLOFILES) $(OUT_COMP_GEN)/so_activex.res so_activex.def
88 -$(MKDIR) $(subst /,$(PS),$(@D))
89 -$(MKDIR) $(subst /,$(PS),$(OUT_LIB))
90 @echo .
91 @echo -----------------------------------------------------------------------------------
92 @echo ATTENTION: If you have problems with linking the library and if you do not use the
93 @echo MS .Net compiler please check the makefile and comment out the variable CL_NEW_LIB.
94 @echo -----------------------------------------------------------------------------------
95 @echo .
96 $(LINK) $(LIBRARY_LINK_FLAGS) /OUT:$@ /MAP:$(OUT_COMP_GEN)/$(subst $(SHAREDLIB_EXT),map,$(@F)) \
97 /DEF:so_activex.def /IMPLIB:$(OUT_LIB)/iso_activex.lib $(SLOFILES) \
98 $(LIBO_SDK_LDFLAGS_STDLIBS) user32.lib uuid.lib advapi32.lib ole32.lib oleaut32.lib gdi32.lib \
99 urlmon.lib Shlwapi.lib oldnames.lib $(CL_NEW_LIB) $(OUT_COMP_GEN)/so_activex.res
100 $(LINK_MANIFEST)
102 ifeq "$(OS)" "WIN"
103 OleActvieXComponentExample : $(COMPONENT_IMPL)
104 @echo --------------------------------------------------------------------------------
105 @echo The activex control was created, please load the "$(QM)example.html$(QM)" file
106 @echo in your InternetExplorer to use the activex control.
107 @echo --------------------------------------------------------------------------------
108 else
109 OleActvieXComponentExample :
110 @echo --------------------------------------------------------------------------------
111 @echo This example works only under Windows!
112 @echo --------------------------------------------------------------------------------
113 endif
115 .PHONY: clean
116 clean :
117 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC))
118 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
119 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_SLO))
120 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_LIB)/*$(COMPONENT_NAME).*))
121 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(SHAREDLIB_OUT)/$(SHAREDLIB_PRE)$(COMPONENT_NAME).*))