merge the formfield patch from ooo-build
[ooovba.git] / cli_ure / source / native / makefile.mk
blob6a2963eb549661dc1271f393947e252bea56c8c1
1 #*************************************************************************
2 #
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
6 #
7 # OpenOffice.org - a multi-platform office productivity suite
8 #
9 # $RCSfile: makefile.mk,v $
10 # $Revision: 1.26.8.1 $
12 # This file is part of OpenOffice.org.
14 # OpenOffice.org is free software: you can redistribute it and/or modify
15 # it under the terms of the GNU Lesser General Public License version 3
16 # only, as published by the Free Software Foundation.
18 # OpenOffice.org is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU Lesser General Public License version 3 for more details
22 # (a copy is included in the LICENSE file that accompanied this code).
24 # You should have received a copy of the GNU Lesser General Public License
25 # version 3 along with OpenOffice.org. If not, see
26 # <http://www.openoffice.org/license.html>
27 # for a copy of the LGPLv3 License.
29 # ************************************************************************/
32 PRJ = ..$/..
33 PRJNAME = cli_ure
35 TARGET = cli_cppuhelper
36 NO_BSYMBOLIC = TRUE
37 ENABLE_EXCEPTIONS = TRUE
38 LIBTARGET = NO
39 USE_DEFFILE = TRUE
41 # disable caching to avoid stale objects
42 # on version changes
43 CCACHE_DISABLE=TRUE
44 .EXPORT : CCACHE_DISABLE
46 .INCLUDE : settings.mk
47 .INCLUDE : $(PRJ)$/util$/makefile.pmk
49 use_shl_versions=
51 .IF "$(USE_SHELL)"!="4nt"
52 ECHOQUOTE='
53 .ELSE
54 ECHOQUOTE=
55 .ENDIF
58 .IF "$(BUILD_FOR_CLI)" == ""
59 #do not even build the cxx files because they contain cli cpp
60 all:
61 .ELSE
63 .INCLUDE : $(BIN)$/cliureversion.mk
65 ASSEMBLY_KEY="$(BIN)$/cliuno.snk"
67 ASSEMBLY_ATTRIBUTES = $(MISC)$/assembly_cppuhelper.cxx
69 POLICY_ASSEMBLY_FILE=$(BIN)$/$(CLI_CPPUHELPER_POLICY_ASSEMBLY).dll
71 ASSEMBLY_KEY_X=$(subst,\,\\ $(ASSEMBLY_KEY))
74 LINKFLAGS += /delayload:cppuhelper3MSC.dll \
75 /delayload:cppu3.dll \
76 /delayload:sal3.dll
78 UWINAPILIB=
80 NO_OFFUH=TRUE
81 CPPUMAKERFLAGS =
82 UNOTYPES = \
83 com.sun.star.lang.XSingleComponentFactory \
84 com.sun.star.loader.CannotActivateFactoryException \
85 com.sun.star.container.XHierarchicalNameAccess \
86 com.sun.star.registry.CannotRegisterImplementationException \
87 com.sun.star.registry.XRegistryKey \
88 com.sun.star.registry.XSimpleRegistry
90 #loader lock was solved as of VS 2005 (CCNUMVER = 0014..)
91 # When compiling for CLR, disable "warning C4339: use of undefined type detected
92 # in CLR meta-data - use of this type may lead to a runtime exception":
93 .IF "$(CCNUMVER)" >= "001399999999"
94 CFLAGSCXX += -clr:oldSyntax -AI $(BIN) -wd4339
95 .ELSE
96 CFLAGSCXX += -clr -AI $(BIN) -wd4339
97 #see Microsoft Knowledge Base Article - 814472
98 LINKFLAGS += -NOENTRY -NODEFAULTLIB:nochkclr.obj -INCLUDE:__DllMainCRTStartup@12
99 .ENDIF
101 SLOFILES = \
102 $(SLO)$/native_bootstrap.obj \
103 $(SLO)$/path.obj \
104 $(SLO)$/assembly_cppuhelper.obj
107 SHL1OBJS = $(SLOFILES)
109 SHL1TARGET = $(TARGET)
111 SHL1STDLIBS = \
112 $(CPPUHELPERLIB) \
113 $(CPPULIB) \
114 $(SALLIB) \
115 delayimp.lib \
116 advapi32.lib \
117 mscoree.lib \
118 Advapi32.lib
120 .IF "$(CCNUMVER)" >= "001399999999"
121 SHL1STDLIBS += \
122 msvcmrt.lib
123 .ENDIF
125 SHL1VERSIONMAP = msvc.map
127 SHL1DEF = $(MISC)$/$(SHL1TARGET).def
128 DEF1NAME = $(SHL1TARGET)
131 .INCLUDE : $(PRJ)$/util$/target.pmk
132 .INCLUDE : target.mk
134 SIGN= $(MISC)$/cppuhelper_is_signed_flag
136 ALLTAR: \
137 $(POLICY_ASSEMBLY_FILE) \
138 $(SIGN)
142 .IF "$(CCNUMVER)" >= "001399999999"
143 CFLAGSCXX += -clr:oldSyntax
144 .ENDIF
146 $(ASSEMBLY_ATTRIBUTES) : assembly.cxx $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk
147 @echo $(ASSEMBLY_KEY_X)
148 $(GNUCOPY) -p assembly.cxx $@
149 echo $(ECHOQUOTE) \
150 [assembly:System::Reflection::AssemblyVersion( "$(CLI_CPPUHELPER_NEW_VERSION)" )]; $(ECHOQUOTE) \
151 >> $(OUT)$/misc$/assembly_cppuhelper.cxx
152 echo $(ECHOQUOTE) \
153 [assembly:System::Reflection::AssemblyKeyFile($(ASSEMBLY_KEY_X))]; $(ECHOQUOTE) \
154 >> $(OUT)$/misc$/assembly_cppuhelper.cxx
158 #make sure we build cli_cppuhelper after the version changed
159 $(SHL1OBJS) : $(BIN)$/cli_cppuhelper.config
163 $(SIGN): $(SHL1TARGETN)
164 $(WRAPCMD) sn.exe -R $(BIN)$/$(TARGET).dll $(BIN)$/cliuno.snk && $(TOUCH) $@
166 #do not forget to deliver cli_cppuhelper.config. It is NOT embedded in the policy file.
167 .IF "$(CCNUMVER)" >= "001399999999"
168 #.NET 2 and higher
169 # If the x86 switch is ommitted then the system assumes the assembly to be MSIL.
170 # The policy file is still found when an application tries to load an older
171 # cli_cppuhelper.dll but the system cannot locate it. It possibly assumes that the
172 # assembly is also 'MSIL' like its policy file.
173 $(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_cppuhelper.config
174 $(WRAPCMD) $(AL) -out:$@ \
175 -version:$(CLI_CPPUHELPER_POLICY_VERSION) \
176 -keyfile:$(BIN)$/cliuno.snk \
177 -link:cli_cppuhelper.config,$(BIN)$/cli_cppuhelper.config \
178 -platform:x86
179 .ELSE
180 #.NET 1.1: platform flag not needed
181 $(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_cppuhelper.config
182 $(WRAPCMD) $(AL) -out:$@ \
183 -version:$(CLI_CPPUHELPER_POLICY_VERSION) \
184 -keyfile:$(BIN)$/cliuno.snk \
185 -link:cli_cppuhelper.config,$(BIN)$/cli_cppuhelper.config
186 .ENDIF
188 #Create the config file that is used with the policy assembly
189 $(BIN)$/cli_cppuhelper.config: cli_cppuhelper_config $(BIN)$/cliureversion.mk
190 $(PERL) $(SOLARENV)$/bin$/clipatchconfig.pl \
191 $< $@
193 .ENDIF # "$(BUILD_FOR_CLI)" != ""