xref: /trunk/main/cli_ure/source/native/makefile.mk (revision 91144cd0085a7583d2099b982122deb2184ab956)
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 "$(COMEX)"=="14"
80# /clr:oldSyntax went away after VS2015; these sources are C++/CLI now.
81CFLAGSCXX += -clr -AI $(BIN) -wd4339
82.ELIF "$(CCNUMVER)" >= "001399999999"
83CFLAGSCXX += -clr:oldSyntax -AI $(BIN) -wd4339
84.ELSE
85CFLAGSCXX += -clr -AI $(BIN) -wd4339
86#see  Microsoft Knowledge Base Article - 814472
87LINKFLAGS += -NOENTRY -NODEFAULTLIB:nochkclr.obj -INCLUDE:__DllMainCRTStartup@12
88.ENDIF
89
90SLOFILES = \
91    $(SLO)$/native_bootstrap.obj \
92    $(SLO)$/path.obj \
93    $(SLO)$/assembly_cppuhelper.obj
94
95
96SHL1OBJS = $(SLOFILES)
97
98SHL1TARGET = $(TARGET)
99
100SHL1STDLIBS = \
101    $(CPPUHELPERLIB) \
102    $(CPPULIB)      \
103    $(SALLIB)       \
104    delayimp.lib \
105    advapi32.lib \
106    mscoree.lib \
107    Advapi32.lib
108
109.IF "$(CCNUMVER)" >= "001399999999"
110SHL1STDLIBS += \
111    msvcmrt.lib
112.ENDIF
113
114SHL1VERSIONMAP = msvc.map
115
116SHL1DEF = $(MISC)$/$(SHL1TARGET).def
117DEF1NAME = $(SHL1TARGET)
118
119
120.INCLUDE : $(PRJ)$/util$/target.pmk
121.INCLUDE : target.mk
122
123SIGN= $(MISC)$/cppuhelper_is_signed_flag
124
125ALLTAR: \
126    $(POLICY_ASSEMBLY_FILE) \
127    $(SIGN)
128
129
130
131.IF "$(COMEX)"=="14"
132CFLAGSCXX += -clr
133.ELIF "$(CCNUMVER)" >= "001399999999"
134CFLAGSCXX += -clr:oldSyntax
135.ENDIF
136
137$(ASSEMBLY_ATTRIBUTES) : assembly.cxx $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk
138    @echo $(ASSEMBLY_KEY_X)
139    $(GNUCOPY) -p assembly.cxx $@
140    echo \
141    '[assembly:System::Reflection::AssemblyVersion( "$(CLI_CPPUHELPER_NEW_VERSION)" )];' \
142    >> $(OUT)$/misc$/assembly_cppuhelper.cxx
143    echo \
144    '[assembly:System::Reflection::AssemblyKeyFile($(ASSEMBLY_KEY_X))];' \
145    >> $(OUT)$/misc$/assembly_cppuhelper.cxx
146
147
148
149#make sure we build cli_cppuhelper after the version changed
150$(SHL1OBJS) : $(BIN)$/cli_cppuhelper.config
151
152
153
154$(SIGN): $(SHL1TARGETN)
155    $(WRAPCMD) sn.exe -R $(BIN)$/$(TARGET).dll  $(BIN)$/cliuno.snk   && $(TOUCH) $@
156
157#do not forget to deliver cli_cppuhelper.config. It is NOT embedded in the policy file.
158.IF "$(CCNUMVER)" >= "001399999999"
159#.NET 2 and higher
160# If the x86 switch is omitted then the system assumes the assembly to be MSIL.
161# The policy file is still found when an application tries to load an older
162# cli_cppuhelper.dll but the system cannot locate it. It possibly assumes that the
163# assembly is also 'MSIL'  like its policy file.
164$(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_cppuhelper.config
165    $(WRAPCMD) AL.exe -out:$@ \
166            -version:$(CLI_CPPUHELPER_POLICY_VERSION) \
167            -keyfile:$(BIN)$/cliuno.snk \
168            -link:$(BIN)$/cli_cppuhelper.config \
169            -platform:x86
170.ELSE
171#.NET 1.1: platform flag not needed
172$(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_cppuhelper.config
173    $(WRAPCMD) AL.exe -out:$@ \
174            -version:$(CLI_CPPUHELPER_POLICY_VERSION) \
175            -keyfile:$(BIN)$/cliuno.snk \
176            -link:$(BIN)$/cli_cppuhelper.config
177.ENDIF
178
179#Create the config file that is used with the policy assembly
180$(BIN)$/cli_cppuhelper.config: cli_cppuhelper_config $(BIN)$/cliureversion.mk
181    $(PERL) $(SOLARENV)$/bin$/clipatchconfig.pl \
182    $< $@
183
184.ENDIF          # "$(BUILD_FOR_CLI)" != ""
185