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