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