xref: /trunk/main/cli_ure/source/native/makefile.mk (revision 07a3d7f1)
1e3c01311SAndrew Rist#**************************************************************
2e3c01311SAndrew Rist#
3e3c01311SAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4e3c01311SAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5e3c01311SAndrew Rist#  distributed with this work for additional information
6e3c01311SAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7e3c01311SAndrew Rist#  to you under the Apache License, Version 2.0 (the
8e3c01311SAndrew Rist#  "License"); you may not use this file except in compliance
9e3c01311SAndrew Rist#  with the License.  You may obtain a copy of the License at
10e3c01311SAndrew Rist#
11e3c01311SAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12e3c01311SAndrew Rist#
13e3c01311SAndrew Rist#  Unless required by applicable law or agreed to in writing,
14e3c01311SAndrew Rist#  software distributed under the License is distributed on an
15e3c01311SAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16e3c01311SAndrew Rist#  KIND, either express or implied.  See the License for the
17e3c01311SAndrew Rist#  specific language governing permissions and limitations
18e3c01311SAndrew Rist#  under the License.
19e3c01311SAndrew Rist#
20e3c01311SAndrew Rist#**************************************************************
21e3c01311SAndrew Rist
22e3c01311SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir
25cdf0e10cSrcweirPRJ = ..$/..
26cdf0e10cSrcweirPRJNAME = cli_ure
27cdf0e10cSrcweir
28cdf0e10cSrcweirTARGET = cli_cppuhelper
29cdf0e10cSrcweirNO_BSYMBOLIC = TRUE
30cdf0e10cSrcweirENABLE_EXCEPTIONS = TRUE
31cdf0e10cSrcweirLIBTARGET = NO
32cdf0e10cSrcweirUSE_DEFFILE = TRUE
33cdf0e10cSrcweir
34cdf0e10cSrcweir# disable caching to avoid stale objects
35cdf0e10cSrcweir# on version changes
36cdf0e10cSrcweirCCACHE_DISABLE=TRUE
37cdf0e10cSrcweir.EXPORT : CCACHE_DISABLE
38cdf0e10cSrcweir
39cdf0e10cSrcweir.INCLUDE : settings.mk
40cdf0e10cSrcweir.INCLUDE : $(PRJ)$/util$/makefile.pmk
41cdf0e10cSrcweir
42cdf0e10cSrcweiruse_shl_versions=
43cdf0e10cSrcweir
44cdf0e10cSrcweir.IF "$(BUILD_FOR_CLI)" == ""
45cdf0e10cSrcweir#do not even build the cxx files because they contain cli cpp
46cdf0e10cSrcweirall:
47cdf0e10cSrcweir.ELSE
48cdf0e10cSrcweir
49cdf0e10cSrcweir.INCLUDE : $(BIN)$/cliureversion.mk
50cdf0e10cSrcweir
51cdf0e10cSrcweirASSEMBLY_KEY="$(BIN)$/cliuno.snk"
52cdf0e10cSrcweir
53cdf0e10cSrcweirASSEMBLY_ATTRIBUTES = $(MISC)$/assembly_cppuhelper.cxx
54cdf0e10cSrcweir
55cdf0e10cSrcweirPOLICY_ASSEMBLY_FILE=$(BIN)$/$(CLI_CPPUHELPER_POLICY_ASSEMBLY).dll
56cdf0e10cSrcweir
57cdf0e10cSrcweirASSEMBLY_KEY_X=$(subst,\,\\ $(ASSEMBLY_KEY))
58cdf0e10cSrcweir
59cdf0e10cSrcweir
60cdf0e10cSrcweirLINKFLAGS += /delayload:cppuhelper3MSC.dll \
61cdf0e10cSrcweir             /delayload:cppu3.dll \
62cdf0e10cSrcweir             /delayload:sal3.dll
63cdf0e10cSrcweir
64cdf0e10cSrcweirUWINAPILIB=
65cdf0e10cSrcweir
66cdf0e10cSrcweirNO_OFFUH=TRUE
67cdf0e10cSrcweirCPPUMAKERFLAGS =
68cdf0e10cSrcweirUNOTYPES = \
69cdf0e10cSrcweir	com.sun.star.lang.XSingleComponentFactory			\
70cdf0e10cSrcweir	com.sun.star.loader.CannotActivateFactoryException 		\
71cdf0e10cSrcweir	com.sun.star.container.XHierarchicalNameAccess		\
72cdf0e10cSrcweir	com.sun.star.registry.CannotRegisterImplementationException	\
73cdf0e10cSrcweir	com.sun.star.registry.XRegistryKey \
74cdf0e10cSrcweir	com.sun.star.registry.XSimpleRegistry
75cdf0e10cSrcweir
76cdf0e10cSrcweir#loader lock was solved as of VS 2005 (CCNUMVER = 0014..)
77cdf0e10cSrcweir# When compiling for CLR, disable "warning C4339: use of undefined type detected
78cdf0e10cSrcweir# in CLR meta-data - use of this type may lead to a runtime exception":
79cdf0e10cSrcweir.IF "$(CCNUMVER)" >= "001399999999"
80cdf0e10cSrcweirCFLAGSCXX += -clr:oldSyntax -AI $(BIN) -wd4339
81cdf0e10cSrcweir.ELSE
82cdf0e10cSrcweirCFLAGSCXX += -clr -AI $(BIN) -wd4339
83cdf0e10cSrcweir#see  Microsoft Knowledge Base Article - 814472
84cdf0e10cSrcweirLINKFLAGS += -NOENTRY -NODEFAULTLIB:nochkclr.obj -INCLUDE:__DllMainCRTStartup@12
85cdf0e10cSrcweir.ENDIF
86cdf0e10cSrcweir
87cdf0e10cSrcweirSLOFILES = \
88cdf0e10cSrcweir    $(SLO)$/native_bootstrap.obj \
89cdf0e10cSrcweir    $(SLO)$/path.obj \
90cdf0e10cSrcweir    $(SLO)$/assembly_cppuhelper.obj
91cdf0e10cSrcweir
92cdf0e10cSrcweir
93cdf0e10cSrcweirSHL1OBJS = $(SLOFILES)
94cdf0e10cSrcweir
95cdf0e10cSrcweirSHL1TARGET = $(TARGET)
96cdf0e10cSrcweir
97cdf0e10cSrcweirSHL1STDLIBS = \
98cdf0e10cSrcweir	$(CPPUHELPERLIB) \
99cdf0e10cSrcweir	$(CPPULIB)		\
100cdf0e10cSrcweir	$(SALLIB)		\
101cdf0e10cSrcweir	delayimp.lib \
102cdf0e10cSrcweir	advapi32.lib \
103cdf0e10cSrcweir	mscoree.lib \
104cdf0e10cSrcweir    Advapi32.lib
105cdf0e10cSrcweir
106cdf0e10cSrcweir.IF "$(CCNUMVER)" >= "001399999999"
107cdf0e10cSrcweirSHL1STDLIBS += \
108cdf0e10cSrcweir	msvcmrt.lib
109cdf0e10cSrcweir.ENDIF
110cdf0e10cSrcweir
111cdf0e10cSrcweirSHL1VERSIONMAP = msvc.map
112cdf0e10cSrcweir
113cdf0e10cSrcweirSHL1DEF = $(MISC)$/$(SHL1TARGET).def
114cdf0e10cSrcweirDEF1NAME = $(SHL1TARGET)
115cdf0e10cSrcweir
116cdf0e10cSrcweir
117cdf0e10cSrcweir.INCLUDE : $(PRJ)$/util$/target.pmk
118cdf0e10cSrcweir.INCLUDE : target.mk
119cdf0e10cSrcweir
120cdf0e10cSrcweirSIGN= $(MISC)$/cppuhelper_is_signed_flag
121cdf0e10cSrcweir
122cdf0e10cSrcweirALLTAR: \
123cdf0e10cSrcweir    $(POLICY_ASSEMBLY_FILE) \
124cdf0e10cSrcweir    $(SIGN)
125cdf0e10cSrcweir
126cdf0e10cSrcweir
127cdf0e10cSrcweir
128cdf0e10cSrcweir.IF "$(CCNUMVER)" >= "001399999999"
129cdf0e10cSrcweirCFLAGSCXX += -clr:oldSyntax
130cdf0e10cSrcweir.ENDIF
131cdf0e10cSrcweir
132cdf0e10cSrcweir$(ASSEMBLY_ATTRIBUTES) : assembly.cxx $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk
133cdf0e10cSrcweir	@echo $(ASSEMBLY_KEY_X)
134cdf0e10cSrcweir    $(GNUCOPY) -p assembly.cxx $@
135cdf0e10cSrcweir    echo \
136cdf0e10cSrcweir	'[assembly:System::Reflection::AssemblyVersion( "$(CLI_CPPUHELPER_NEW_VERSION)" )];' \
137cdf0e10cSrcweir	>> $(OUT)$/misc$/assembly_cppuhelper.cxx
138cdf0e10cSrcweir    echo \
139cdf0e10cSrcweir	'[assembly:System::Reflection::AssemblyKeyFile($(ASSEMBLY_KEY_X))];' \
140cdf0e10cSrcweir	>> $(OUT)$/misc$/assembly_cppuhelper.cxx
141cdf0e10cSrcweir
142cdf0e10cSrcweir
143cdf0e10cSrcweir
144cdf0e10cSrcweir#make sure we build cli_cppuhelper after the version changed
145cdf0e10cSrcweir$(SHL1OBJS) : $(BIN)$/cli_cppuhelper.config
146cdf0e10cSrcweir
147cdf0e10cSrcweir
148cdf0e10cSrcweir
149cdf0e10cSrcweir$(SIGN): $(SHL1TARGETN)
150cdf0e10cSrcweir	$(WRAPCMD) sn.exe -R $(BIN)$/$(TARGET).dll	$(BIN)$/cliuno.snk	 && $(TOUCH) $@
151cdf0e10cSrcweir
152cdf0e10cSrcweir#do not forget to deliver cli_cppuhelper.config. It is NOT embedded in the policy file.
153cdf0e10cSrcweir.IF "$(CCNUMVER)" >= "001399999999"
154cdf0e10cSrcweir#.NET 2 and higher
155*07a3d7f1SPedro Giffuni# If the x86 switch is omitted then the system assumes the assembly to be MSIL.
156cdf0e10cSrcweir# The policy file is still found when an application tries to load an older
157cdf0e10cSrcweir# cli_cppuhelper.dll but the system cannot locate it. It possibly assumes that the
158cdf0e10cSrcweir# assembly is also 'MSIL'  like its policy file.
159cdf0e10cSrcweir$(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_cppuhelper.config
160cdf0e10cSrcweir	$(WRAPCMD) AL.exe -out:$@ \
161cdf0e10cSrcweir			-version:$(CLI_CPPUHELPER_POLICY_VERSION) \
162cdf0e10cSrcweir			-keyfile:$(BIN)$/cliuno.snk \
163cdf0e10cSrcweir			-link:$(BIN)$/cli_cppuhelper.config \
164cdf0e10cSrcweir			-platform:x86
165cdf0e10cSrcweir.ELSE
166cdf0e10cSrcweir#.NET 1.1: platform flag not needed
167cdf0e10cSrcweir$(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_cppuhelper.config
168cdf0e10cSrcweir	$(WRAPCMD) AL.exe -out:$@ \
169cdf0e10cSrcweir			-version:$(CLI_CPPUHELPER_POLICY_VERSION) \
170cdf0e10cSrcweir			-keyfile:$(BIN)$/cliuno.snk \
171cdf0e10cSrcweir			-link:$(BIN)$/cli_cppuhelper.config
172cdf0e10cSrcweir.ENDIF
173cdf0e10cSrcweir
174cdf0e10cSrcweir#Create the config file that is used with the policy assembly
175cdf0e10cSrcweir$(BIN)$/cli_cppuhelper.config: cli_cppuhelper_config $(BIN)$/cliureversion.mk
176cdf0e10cSrcweir	$(PERL) $(SOLARENV)$/bin$/clipatchconfig.pl \
177cdf0e10cSrcweir	$< $@
178cdf0e10cSrcweir
179cdf0e10cSrcweir.ENDIF			# "$(BUILD_FOR_CLI)" != ""
180cdf0e10cSrcweir
181