xref: /aoo41x/main/odk/examples/OLE/activex/Makefile (revision 122c3632)
1*122c3632SJürgen Schmidt#**************************************************************
2*122c3632SJürgen Schmidt#
3*122c3632SJürgen Schmidt#  Licensed to the Apache Software Foundation (ASF) under one
4*122c3632SJürgen Schmidt#  or more contributor license agreements.  See the NOTICE file
5*122c3632SJürgen Schmidt#  distributed with this work for additional information
6*122c3632SJürgen Schmidt#  regarding copyright ownership.  The ASF licenses this file
7*122c3632SJürgen Schmidt#  to you under the Apache License, Version 2.0 (the
8*122c3632SJürgen Schmidt#  "License"); you may not use this file except in compliance
9*122c3632SJürgen Schmidt#  with the License.  You may obtain a copy of the License at
10*122c3632SJürgen Schmidt#
11*122c3632SJürgen Schmidt#    http://www.apache.org/licenses/LICENSE-2.0
12*122c3632SJürgen Schmidt#
13*122c3632SJürgen Schmidt#  Unless required by applicable law or agreed to in writing,
14*122c3632SJürgen Schmidt#  software distributed under the License is distributed on an
15*122c3632SJürgen Schmidt#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*122c3632SJürgen Schmidt#  KIND, either express or implied.  See the License for the
17*122c3632SJürgen Schmidt#  specific language governing permissions and limitations
18*122c3632SJürgen Schmidt#  under the License.
19cdf0e10cSrcweir#
20*122c3632SJürgen Schmidt#**************************************************************
21cdf0e10cSrcweir
22cdf0e10cSrcweir# Builds the OLE activex C++ component example of the SDK.
23cdf0e10cSrcweir
24cdf0e10cSrcweirPRJ=../../..
25cdf0e10cSrcweirSETTINGS=$(PRJ)/settings
26cdf0e10cSrcweir
27cdf0e10cSrcweirinclude $(SETTINGS)/settings.mk
28cdf0e10cSrcweirinclude $(SETTINGS)/std.mk
29cdf0e10cSrcweirinclude $(SETTINGS)/dk.mk
30cdf0e10cSrcweir
31cdf0e10cSrcweir# Define non-platform/compiler specific settings
32cdf0e10cSrcweirCOMPONENT_NAME=so_activex
33cdf0e10cSrcweirCOMPONENT_IMPL_NAME=$(SHAREDLIB_PRE)$(COMPONENT_NAME).$(SHAREDLIB_EXT)
34cdf0e10cSrcweirCOMPONENT_IMPL=$(SHAREDLIB_OUT)/$(SHAREDLIB_PRE)$(COMPONENT_NAME).$(SHAREDLIB_EXT)
35cdf0e10cSrcweirOUT_COMP_INC = $(OUT_INC)/$(COMPONENT_NAME)
36cdf0e10cSrcweirOUT_COMP_GEN = $(OUT_MISC)/$(COMPONENT_NAME)
37cdf0e10cSrcweirOUT_COMP_SLO=$(OUT_SLO)/$(COMPONENT_NAME)
38cdf0e10cSrcweir
39cdf0e10cSrcweirMIDLFILES = so_activex.idl
40cdf0e10cSrcweir
41cdf0e10cSrcweirCXXFILES = SOActiveX.cpp \
42cdf0e10cSrcweir	 SOComWindowPeer.cpp \
43cdf0e10cSrcweir	 so_activex.cpp \
44cdf0e10cSrcweir	 StdAfx2.cpp
45cdf0e10cSrcweir
46cdf0e10cSrcweirSLOFILES = $(patsubst %.cpp,$(OUT_COMP_SLO)/%.$(OBJ_EXT),$(CXXFILES))
47cdf0e10cSrcweir
48cdf0e10cSrcweir# Targets
49cdf0e10cSrcweir.PHONY: ALL
50cdf0e10cSrcweirALL : \
51cdf0e10cSrcweir	OleActvieXComponentExample
52cdf0e10cSrcweir
53cdf0e10cSrcweirinclude $(SETTINGS)/stdtarget.mk
54cdf0e10cSrcweir
55cdf0e10cSrcweir# Attention: so_activex.idl is no UNOIDL file!
56cdf0e10cSrcweir$(OUT_COMP_INC)/so_activex.h : so_activex.idl
57cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
58cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN))
59cdf0e10cSrcweir	midl.exe /tlb $(OUT_COMP_GEN)/so_activex.tlb /h $(OUT_COMP_INC)/so_activex.h \
60cdf0e10cSrcweir	/iid $(OUT_COMP_INC)/so_activex_i.c /proxy $(OUT_COMP_INC)/so_activex_p.c \
61cdf0e10cSrcweir	/dlldata $(OUT_COMP_INC)/dlldata.c /Oicf $<
62cdf0e10cSrcweir
63cdf0e10cSrcweir$(OUT_COMP_GEN)/so_activex.res : so_activex.rc $(OUT_COMP_INC)/so_activex.h
64cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
65cdf0e10cSrcweir	rc $(CC_INCLUDES) /R /FO$@ so_activex.rc
66cdf0e10cSrcweir
67cdf0e10cSrcweir$(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cpp
68cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
69cdf0e10cSrcweir	$(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
70cdf0e10cSrcweir
71cdf0e10cSrcweir
72cdf0e10cSrcweir# Note: If you don't use the MS Visual Studio .Net, please comment out the next line.
73cdf0e10cSrcweirCL_NEW_LIB=atls.lib
74cdf0e10cSrcweir
75cdf0e10cSrcweir$(SHAREDLIB_OUT)/$(SHAREDLIB_PRE)%.$(SHAREDLIB_EXT) : $(SLOFILES) $(OUT_COMP_GEN)/so_activex.res so_activex.def
76cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
77cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(OUT_LIB))
78cdf0e10cSrcweir	@echo .
79cdf0e10cSrcweir	@echo -----------------------------------------------------------------------------------
80cdf0e10cSrcweir	@echo ATTENTION: If you have problems with linking the library and if you do not use the
81cdf0e10cSrcweir	@echo MS .Net compiler please check the makefile and comment out the variable CL_NEW_LIB.
82cdf0e10cSrcweir	@echo -----------------------------------------------------------------------------------
83cdf0e10cSrcweir	@echo .
84cdf0e10cSrcweir	$(LINK) $(LIBRARY_LINK_FLAGS) /OUT:$@ /MAP:$(OUT_COMP_GEN)/$(subst $(SHAREDLIB_EXT),map,$(@F)) \
85cdf0e10cSrcweir	/DEF:so_activex.def /IMPLIB:$(OUT_LIB)/iso_activex.lib $(SLOFILES) \
86cdf0e10cSrcweir	msvcrt.lib kernel32.lib user32.lib uuid.lib advapi32.lib ole32.lib oleaut32.lib gdi32.lib \
87cdf0e10cSrcweir	urlmon.lib Shlwapi.lib oldnames.lib $(CL_NEW_LIB) $(OUT_COMP_GEN)/so_activex.res
88cdf0e10cSrcweir	$(LINK_MANIFEST)
89cdf0e10cSrcweir
90cdf0e10cSrcweirifeq "$(OS)" "WIN"
91cdf0e10cSrcweirOleActvieXComponentExample : $(COMPONENT_IMPL)
92cdf0e10cSrcweir	@echo --------------------------------------------------------------------------------
93cdf0e10cSrcweir	@echo The activex control was created, please load the "$(QM)example.html$(QM)" file
94cdf0e10cSrcweir	@echo in your InternetExplorer to use the activex control.
95cdf0e10cSrcweir	@echo --------------------------------------------------------------------------------
96cdf0e10cSrcweirelse
97cdf0e10cSrcweirOleActvieXComponentExample :
98cdf0e10cSrcweir	@echo --------------------------------------------------------------------------------
99cdf0e10cSrcweir	@echo This example works only under Windows!
100cdf0e10cSrcweir	@echo --------------------------------------------------------------------------------
101cdf0e10cSrcweirendif
102cdf0e10cSrcweir
103cdf0e10cSrcweir.PHONY: clean
104cdf0e10cSrcweirclean :
105cdf0e10cSrcweir	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC))
106cdf0e10cSrcweir	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
107cdf0e10cSrcweir	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_SLO))
108cdf0e10cSrcweir	-$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_LIB)/*$(COMPONENT_NAME).*))
109cdf0e10cSrcweir	-$(DEL) $(subst \\,\,$(subst /,$(PS),$(SHAREDLIB_OUT)/$(SHAREDLIB_PRE)$(COMPONENT_NAME).*))
110