xref: /aoo41x/main/solenv/gbuild/platform/windows.mk (revision 5f9a7a39)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2011 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28GUI := WNT
29COM := MSC
30
31# set tmpdir to some mixed case path, suitable for native tools
32gb_TMPDIR:=$(if $(TMPDIR),$(shell cygpath -m $(TMPDIR)),$(shell cygpath -m /tmp))
33gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX
34
35gb_CC := cl
36gb_CXX := cl
37gb_LINK := link
38gb_AWK := awk
39gb_CLASSPATHSEP := ;
40gb_RC := rc
41
42# use CC/CXX if they are nondefaults
43ifneq ($(origin CC),default)
44gb_CC := $(CC)
45gb_GCCP := $(CC)
46endif
47ifneq ($(origin CXX),default)
48gb_CXX := $(CXX)
49endif
50
51gb_OSDEFS := \
52	-DWINVER=0x0500 \
53	-D_WIN32_IE=0x0500 \
54	-DNT351 \
55	-DWIN32 \
56	-DWNT \
57
58gb_COMPILERDEFS := \
59	-DMSC \
60	-D_CRT_NON_CONFORMING_SWPRINTFS \
61	-D_CRT_NONSTDC_NO_DEPRECATE \
62	-D_CRT_SECURE_NO_DEPRECATE \
63	-D_MT \
64	-DBOOST_MEM_FN_ENABLE_CDECL \
65	-DCPPU_ENV=msci \
66	-DFULL_DESK \
67	-DM1500 \
68
69gb_CPUDEFS := -DINTEL -D_X86_=1
70
71gb_RCDEFS := \
72     -DWINVER=0x0400 \
73	 -DWIN32 \
74
75gb_RCFLAGS := \
76     -V
77
78gb_CFLAGS := \
79	-Gd \
80	-GR \
81	-Gs \
82	-GS \
83	-Gy \
84	-nologo \
85	-Wall \
86	-wd4005 \
87	-wd4061 \
88	-wd4127 \
89	-wd4180 \
90	-wd4189 \
91	-wd4191 \
92	-wd4217 \
93	-wd4250 \
94	-wd4251 \
95	-wd4255 \
96	-wd4275 \
97	-wd4290 \
98	-wd4294 \
99	-wd4350 \
100	-wd4355 \
101	-wd4365 \
102	-wd4503 \
103	-wd4505 \
104	-wd4511 \
105	-wd4512 \
106	-wd4514 \
107	-wd4611 \
108	-wd4619 \
109	-wd4625 \
110	-wd4626 \
111	-wd4640 \
112	-wd4668 \
113	-wd4675 \
114	-wd4692 \
115	-wd4710 \
116	-wd4711 \
117	-wd4738 \
118	-wd4786 \
119	-wd4800 \
120	-wd4820 \
121	-wd4826 \
122	-Zc:forScope,wchar_t- \
123	-Zm500 \
124
125gb_CXXFLAGS := \
126	-Gd \
127	-GR \
128	-Gs \
129	-GS \
130	-Gy \
131	-nologo \
132	-Wall \
133	-wd4005 \
134	-wd4061 \
135	-wd4127 \
136	-wd4180 \
137	-wd4189 \
138	-wd4191 \
139	-wd4217 \
140	-wd4250 \
141	-wd4251 \
142	-wd4275 \
143	-wd4290 \
144	-wd4294 \
145	-wd4350 \
146	-wd4355 \
147	-wd4365 \
148	-wd4503 \
149	-wd4505 \
150	-wd4511 \
151	-wd4512 \
152	-wd4514 \
153	-wd4611 \
154	-wd4619 \
155	-wd4625 \
156	-wd4626 \
157	-wd4640 \
158	-wd4668 \
159	-wd4675 \
160	-wd4692 \
161	-wd4710 \
162	-wd4711 \
163	-wd4738 \
164	-wd4786 \
165	-wd4800 \
166	-wd4820 \
167	-wd4826 \
168	-Zc:forScope,wchar_t- \
169	-Zm500 \
170
171gb_STDLIBS := \
172    uwinapi \
173    kernel32 \
174    msvcrt \
175    oldnames \
176
177ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
178gb_CFLAGS_WERROR := -WX
179gb_CXXFLAGS_WERROR := -WX
180endif
181
182gb_LinkTarget_EXCEPTIONFLAGS := \
183	-DEXCEPTIONS_ON \
184	-EHa \
185
186gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS)
187
188
189gb_LinkTarget_NOEXCEPTIONFLAGS := \
190	-DEXCEPTIONS_OFF \
191
192gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS := $(gb_LinkTarget_NOEXCEPTIONFLAGS)
193
194gb_LinkTarget_LDFLAGS := \
195	-MACHINE:IX86 \
196	-NODEFAULTLIB \
197	-OPT:NOREF \
198	-SUBSYSTEM:CONSOLE \
199	-safeseh \
200	-nxcompat \
201	-dynamicbase \
202	$(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
203
204ifneq ($(ENABLE_CRASHDUMP),)
205gb_LinkTarget_LDFLAGS += -DEBUG
206gb_CFLAGS+=-Zi
207gb_CXXFLAGS+=-Zi
208endif
209
210ifeq ($(gb_DEBUGLEVEL),2)
211gb_CXXFLAGS +=-Zi
212gb_CFLAGS +=-Zi
213gb_COMPILEROPTFLAGS :=
214gb_LinkTarget_LDFLAGS += -DEBUG
215else
216gb_COMPILEROPTFLAGS := -Ob1 -Oxs -Oy-
217endif
218
219gb_COMPILERNOOPTFLAGS := -Od
220
221
222# Helper class
223gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
224gb_Helper_WORKDIR_NATIVE := $(shell cygpath -m $(WORKDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
225gb_Helper_OUTDIR_NATIVE := $(shell cygpath -m $(OUTDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
226gb_Helper_REPODIR_NATIVE := $(shell cygpath -m $(REPODIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
227
228define gb_Helper_abbreviate_dirs_native
229R=$(gb_Helper_REPODIR_NATIVE) && $(subst $(REPODIR)/,$$R/,$(subst $(gb_Helper_REPODIR_NATIVE)/,$$R/,O=$(gb_Helper_OUTDIR_NATIVE) && W=$(gb_Helper_WORKDIR_NATIVE) && S=$(gb_Helper_SRCDIR_NATIVE))) && \
230$(subst $(REPODIR)/,$$R/,$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,$(subst $(WORKDIR)/,$$W/,$(subst $(gb_Helper_REPODIR_NATIVE)/,$$R/,$(subst $(gb_Helper_SRCDIR_NATIVE)/,$$S/,$(subst $(gb_Helper_OUTDIR_NATIVE)/,$$O/,$(subst $(gb_Helper_WORKDIR_NATIVE)/,$$W/,$(1)))))))))
231endef
232
233# convert parametters filesystem root to native notation
234# does some real work only on windows, make sure not to
235# break the dummy implementations on unx*
236define gb_Helper_convert_native
237$(patsubst -I$(OUTDIR)%,-I$(gb_Helper_OUTDIR_NATIVE)%, \
238$(patsubst $(OUTDIR)%,$(gb_Helper_OUTDIR_NATIVE)%, \
239$(patsubst $(WORKDIR)%,$(gb_Helper_WORKDIR_NATIVE)%, \
240$(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \
241$(1)))))
242endef
243
244
245# CObject class
246
247ifeq ($(gb_FULLDEPS),$(true))
248define gb_CObject__command_deponcompile
249$(call gb_Helper_abbreviate_dirs_native,\
250	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
251		$(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
252		-I$(dir $(3)) \
253		$(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME)%,$(6)) \
254		$(3) \
255		-f - \
256	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
257		-v OBJECTFILE=$(1) \
258		-v OUTDIR=$(OUTDIR)/ \
259		-v WORKDIR=$(WORKDIR)/ \
260		-v SRCDIR=$(SRCDIR)/ \
261		-v REPODIR=$(REPODIR)/ \
262	> $(call gb_CObject_get_dep_target,$(2)))
263endef
264else
265CObject__command_deponcompile =
266endif
267
268define gb_CObject__command
269$(call gb_Output_announce,$(2),$(true),C  ,3)
270$(call gb_Helper_abbreviate_dirs_native,\
271	mkdir -p $(dir $(1)) && \
272	unset INCLUDE && \
273	$(gb_CC) \
274		$(DEFS) $(CFLAGS)  -Fd$(PDBFILE) \
275        $(PCHFLAGS) \
276		-I$(dir $(3)) \
277		$(INCLUDE) \
278		-c $(3) \
279		-Fo$(1))
280$(call gb_CObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(CFLAGS),$(INCLUDE))
281endef
282
283
284# CxxObject class
285
286ifeq ($(gb_FULLDEPS),$(true))
287define gb_CxxObject__command_deponcompile
288$(call gb_Helper_abbreviate_dirs_native,\
289	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
290		$(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
291		-I$(dir $(3)) \
292		$(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME)%,$(6)) \
293		$(3) \
294		-f - \
295	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
296		-v OBJECTFILE=$(1) \
297		-v OUTDIR=$(OUTDIR)/ \
298		-v WORKDIR=$(WORKDIR)/ \
299		-v SRCDIR=$(SRCDIR)/ \
300		-v REPODIR=$(REPODIR)/ \
301	> $(call gb_CxxObject_get_dep_target,$(2)))
302 endef
303else
304gb_CxxObject__command_deponcompile =
305endif
306
307define gb_CxxObject__command
308$(call gb_Output_announce,$(2),$(true),CXX,3)
309$(call gb_Helper_abbreviate_dirs_native,\
310	mkdir -p $(dir $(1)) && \
311	unset INCLUDE && \
312	$(gb_CXX) \
313		$(DEFS) $(CXXFLAGS) -Fd$(PDBFILE)\
314        $(PCHFLAGS) \
315		-I$(dir $(3)) \
316		$(INCLUDE_STL) $(INCLUDE) \
317		-c $(3) \
318		-Fo$(1))
319$(call gb_CxxObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(CFLAGS),$(INCLUDE))
320endef
321
322
323# PrecompiledHeader class
324
325gb_PrecompiledHeader_get_enableflags = -Yu$(1).hxx \
326									   -Fp$(call gb_PrecompiledHeader_get_target,$(1))
327
328ifeq ($(gb_FULLDEPS),$(true))
329define gb_PrecompiledHeader__command_deponcompile
330$(call gb_Helper_abbreviate_dirs_native,\
331	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
332		$(4) $(5) \
333		-I$(dir $(3)) \
334		$(filter-out -I$(COMPATH)% -I$(JAVA_HOME)%,$(6)) \
335		$(3) \
336		-f - \
337	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
338		-v OBJECTFILE=$(1) \
339		-v OUTDIR=$(OUTDIR)/ \
340		-v WORKDIR=$(WORKDIR)/ \
341		-v SRCDIR=$(SRCDIR)/ \
342		-v REPODIR=$(REPODIR)/ \
343	> $(call gb_PrecompiledHeader_get_dep_target,$(2)))
344endef
345else
346gb_PrecompiledHeader__command_deponcompile =
347endif
348
349
350define gb_PrecompiledHeader__command
351$(call gb_Output_announce,$(2),$(true),PCH,1)
352$(call gb_Helper_abbreviate_dirs_native,\
353	mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2))) && \
354	unset INCLUDE && \
355	$(gb_CXX) \
356		$(4) $(5) -Fd$(PDBFILE) \
357		-I$(dir $(3)) \
358		$(6) \
359		-c $(3) \
360		-Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj)
361$(call gb_PrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
362endef
363
364# NoexPrecompiledHeader class
365
366gb_NoexPrecompiledHeader_get_enableflags = -Yu$(1).hxx \
367										   -Fp$(call gb_NoexPrecompiledHeader_get_target,$(1))
368
369ifeq ($(gb_FULLDEPS),$(true))
370define gb_NoexPrecompiledHeader__command_deponcompile
371$(call gb_Helper_abbreviate_dirs_native,\
372	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
373		$(4) $(5) \
374		-I$(dir $(3)) \
375		$(filter-out -I$(COMPATH)% -I$(JAVA_HOME)%,$(6)) \
376		$(3) \
377		-f - \
378	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
379		-v OBJECTFILE=$(1) \
380		-v OUTDIR=$(OUTDIR)/ \
381		-v WORKDIR=$(WORKDIR)/ \
382		-v SRCDIR=$(SRCDIR)/ \
383		-v REPODIR=$(REPODIR)/ \
384	> $(call gb_NoexPrecompiledHeader_get_dep_target,$(2)))
385endef
386else
387gb_NoexPrecompiledHeader__command_deponcompile =
388endif
389
390
391define gb_NoexPrecompiledHeader__command
392$(call gb_Output_announce,$(2),$(true),PCH,1)
393$(call gb_Helper_abbreviate_dirs_native,\
394	mkdir -p $(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) && \
395	unset INCLUDE && \
396	$(gb_CXX) \
397		$(4) $(5) -Fd$(PDBFILE) \
398		-I$(dir $(3)) \
399		$(6) \
400		-c $(3) \
401		-Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj)
402$(call gb_NoexPrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
403endef
404
405# LinkTarget class
406
407gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_COMPILEROPTFLAGS)
408gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
409
410gb_LinkTarget_INCLUDE :=\
411	$(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \
412	$(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \
413
414gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
415
416gb_LinkTarget_get_pdbfile = $(call gb_LinkTarget_get_target,)pdb/$(1).pdb
417
418define gb_LinkTarget__command
419$(call gb_Output_announce,$(2),$(true),LNK,4)
420$(call gb_Helper_abbreviate_dirs_native,\
421	mkdir -p $(dir $(1)) && \
422	rm -f $(1) && \
423	RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100, \
424	    $(call gb_Helper_convert_native,$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
425		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
426		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
427		$(PCHOBJS) $(NATIVERES))) && \
428	$(gb_LINK) \
429		$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
430		$(if $(filter StaticLibrary,$(TARGETTYPE)),$(gb_StaticLibrary_TARGETTYPEFLAGS)) \
431		$(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
432		$(LDFLAGS) \
433		@$${RESPONSEFILE} \
434		$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib))) \
435		$(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_filename,$(lib))) \
436		$(if $(DLLTARGET),-out:$(DLLTARGET) -implib:$(1),-out:$(1)); RC=$$?; rm $${RESPONSEFILE} \
437	$(if $(DLLTARGET),; if [ ! -f $(DLLTARGET) ]; then rm -f $(1) && false; fi) ; exit $$RC)
438endef
439
440
441# Library class
442
443gb_Library_DEFS := -D_DLL
444gb_Library_TARGETTYPEFLAGS := -DLL
445gb_Library_get_rpath :=
446
447gb_Library_SYSPRE := i
448gb_Library_PLAINEXT := .lib
449
450gb_Library_PLAINLIBS_NONE += \
451	advapi32 \
452	gdi32 \
453	gdiplus \
454	gnu_getopt \
455	imm32\
456	kernel32 \
457	msimg32 \
458	msvcrt \
459	mpr \
460	oldnames \
461	ole32 \
462	oleaut32 \
463	shell32 \
464	unicows \
465	user32 \
466	uuid \
467	uwinapi \
468	winspool \
469	z \
470
471gb_Library_LAYER := \
472	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
473	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \
474	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
475	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
476	$(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
477	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
478	$(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \
479	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
480	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
481	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
482
483gb_Library_FILENAMES :=\
484	$(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
485
486gb_Library_DLLEXT := .dll
487gb_Library_MAJORVER := 3
488gb_Library_RTEXT := MSC$(gb_Library_DLLEXT)
489ifeq ($(gb_PRODUCT),$(true))
490gb_Library_STLEXT := port_vc7145$(gb_Library_DLLEXT)
491else
492gb_Library_STLEXT := port_vc7145_stldebug$(gb_Library_DLLEXT)
493endif
494gb_Library_OOOEXT := $(gb_Library_DLLEXT)
495gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT)
496gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT)
497gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT)
498
499gb_Library_DLLFILENAMES :=\
500	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
501	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
502	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
503	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
504	$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
505	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
506	$(foreach lib,$(gb_Library_STLLIBS),$(lib):$(lib)$(gb_Library_STLEXT)) \
507	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
508	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
509	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
510
511define gb_Library_Library_platform
512$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
513
514$(call gb_LinkTarget_set_auxtargets,$(2),\
515	$(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
516	$(3).manifest \
517	$(call gb_LinkTarget_get_pdbfile,$(2)) \
518	$(patsubst %.dll,%.pdb,$(3)) \
519	$(patsubst %.dll,%.ilk,$(3)) \
520)
521
522$(call gb_Library_get_target,$(1)) \
523$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3))
524
525ifneq ($(ENABLE_CRASHDUMP),)
526$(call gb_Library_get_target,$(1)) \
527$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS +=  \
528		$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))) \
529		$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))) \
530
531$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))),$(patsubst %.dll,%.pdb,$(3)))
532$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))),$(patsubst %.dll,%.ilk,$(3)))
533endif
534
535$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3))
536
537$(call gb_LinkTarget_get_target,$(2)) \
538$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
539
540endef
541
542define gb_Library_add_default_nativeres
543$(call gb_WinResTarget_WinResTarget_init,$(1)/$(2))
544$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo)
545$(call gb_WinResTarget_set_defs,$(1)/$(2),\
546        $$(DEFS) \
547		-DADDITIONAL_VERINFO1 \
548		-DADDITIONAL_VERINFO2 \
549		-DADDITIONAL_VERINFO3 \
550)
551$(call gb_Library_add_nativeres,$(1),$(2))
552$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2))
553
554endef
555
556define gb_Library_add_nativeres
557$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : $(call gb_WinResTarget_get_target,$(1)/$(2))
558$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : NATIVERES += $(call gb_WinResTarget_get_target,$(1)/$(2))
559
560endef
561
562define gb_Library_get_dllname
563$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES)))
564endef
565
566
567# StaticLibrary class
568
569gb_StaticLibrary_DEFS :=
570gb_StaticLibrary_TARGETTYPEFLAGS := -LIB
571gb_StaticLibrary_SYSPRE :=
572gb_StaticLibrary_PLAINEXT := .lib
573gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
574
575gb_StaticLibrary_FILENAMES := \
576	$(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
577	$(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
578
579gb_StaticLibrary_FILENAMES := $(patsubst salcpprt:salcpprt%,salcpprt:cpprtl%,$(gb_StaticLibrary_FILENAMES))
580
581define gb_StaticLibrary_StaticLibrary_platform
582$(call gb_LinkTarget_get_target,$(2)) \
583$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
584
585$(call gb_LinkTarget_set_auxtargets,$(2),\
586	$(call gb_LinkTarget_get_pdbfile,$(2)) \
587)
588
589endef
590
591# Executable class
592
593gb_Executable_EXT := .exe
594gb_Executable_TARGETTYPEFLAGS := -RELEASE -BASE:0x1b000000 -OPT:NOREF -INCREMENTAL:NO -DEBUG
595gb_Executable_get_rpath :=
596
597define gb_Executable_Executable_platform
598$(call gb_LinkTarget_set_auxtargets,$(2),\
599	$(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \
600	$(call gb_LinkTarget_get_pdbfile,$(2)) \
601	$(call gb_LinkTarget_get_target,$(2)).manifest \
602)
603
604$(call gb_Executable_get_target,$(1)) \
605$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Executable_get_target,$(1)).manifest
606$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)).manifest,$(call gb_LinkTarget_get_target,$(2)).manifest)
607
608$(call gb_LinkTarget_get_target,$(2)) \
609$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
610
611endef
612
613# CppunitTest class
614
615gb_CppunitTest_CPPTESTPRECOMMAND :=
616gb_CppunitTest_SYSPRE := itest_
617gb_CppunitTest_EXT := .lib
618gb_CppunitTest_get_filename = $(gb_CppunitTest_SYSPRE)$(1)$(gb_CppunitTest_EXT)
619gb_CppunitTest_get_libfilename = test_$(1).dll
620
621define gb_CppunitTest_CppunitTest_platform
622$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
623
624$(call gb_LinkTarget_set_auxtargets,$(2),\
625	$(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
626	$(3).manifest \
627	$(patsubst %.dll,%.pdb,$(3)) \
628	$(call gb_LinkTarget_get_pdbfile,$(2)) \
629	$(patsubst %.dll,%.ilk,$(3)) \
630)
631
632$(call gb_LinkTarget_get_target,$(2)) \
633$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
634
635endef
636
637# JunitTest class
638
639gb_defaultlangiso := en-US
640gb_smoketest_instset := $(SRCDIR)/instsetoo_native/$(INPATH)/OpenOffice/archive/install/$(gb_defaultlangiso)/OOo_*_install-arc_$(gb_defaultlangiso).zip
641
642ifeq ($(OOO_TEST_SOFFICE),)
643
644
645# Work around Windows problems with long pathnames (see issue 50885) by
646# installing into the temp directory instead of the module output tree (in which
647# case $(target).instpath contains the path to the temp installation,
648# which is removed after smoketest); can be removed once issue 50885 is fixed;
649# on other platforms, a single installation to solver is created in
650# smoketestoo_native.
651
652# for now, no dependency on $(shell ls $(gb_smoketest_instset))
653# because that doesn't work before the instset is built
654# and there is not much of a benefit anyway (gbuild not knowing about smoketest)
655define gb_JunitTest_JunitTest_platform_longpathname_hack
656$(call gb_JunitTest_get_target,$(1)) : $(call gb_JunitTest_get_target,$(1)).instpath
657$(call gb_JunitTest_get_target,$(1)) : CLEAN_CMD = $(call gb_Helper_abbreviate_dirs,rm -rf `cat $$@.instpath` $$@.instpath)
658
659$(call gb_JunitTest_get_target,$(1)).instpath :
660	INST_DIR=$$$$(cygpath -m `mktemp -d -t testinst.XXXXXX`) \
661	&& unzip -d "$$$${INST_DIR}"  $$(gb_smoketest_instset) \
662	&& mv "$$$${INST_DIR}"/OOo_*_install-arc_$$(gb_defaultlangiso) "$$$${INST_DIR}"/opt\
663	&& mkdir -p $$(dir $$@) \
664	&& echo "$$$${INST_DIR}" > $$@
665
666endef
667else # OOO_TEST_SOFFICE
668gb_JunitTest_JunitTest_platform_longpathname_hack =
669endif # OOO_TEST_SOFFICE
670
671define gb_JunitTest_JunitTest_platform
672$(call gb_JunitTest_JunitTest_platform_longpathname_hack,$(1))
673
674$(call gb_JunitTest_get_target,$(1)) : DEFS := \
675	-Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:`cat $(call gb_JunitTest_get_target,$(1)).instpath`/opt/OpenOffice.org 3/program/soffice.exe}" \
676    -Dorg.openoffice.test.arg.env=PATH \
677    -Dorg.openoffice.test.arg.user=file:///$(call gb_JunitTest_get_userdir,$(1)) \
678
679endef
680
681
682# SdiTarget class
683
684gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
685
686# SrsPartMergeTarget
687
688gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
689
690# SrsPartTarget class
691
692gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe
693gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
694
695ifeq ($(gb_FULLDEPS),$(true))
696define gb_SrsPartTarget__command_dep
697$(call gb_Helper_abbreviate_dirs_native,\
698	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
699		$(INCLUDE) \
700		$(DEFS) \
701		$(2) \
702		-f - \
703	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
704		-v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
705		-v OUTDIR=$(OUTDIR)/ \
706		-v WORKDIR=$(WORKDIR)/ \
707		-v SRCDIR=$(SRCDIR)/ \
708		-v REPODIR=$(REPODIR)/ \
709	> $(call gb_SrsPartTarget_get_dep_target,$(1)))
710endef
711else
712gb_SrsPartTarget__command_dep =
713endif
714
715# WinResTarget class
716
717gb_WinResTarget_POSTFIX :=.res
718
719define gb_WinResTarget__command
720$(call gb_Output_announce,$(2),$(true),RES,3)
721$(call gb_Helper_abbreviate_dirs_native,\
722	mkdir -p $(dir $(1)) && \
723	$(gb_RC) \
724		$(DEFS) $(FLAGS) \
725		-I$(dir $(3)) \
726		$(INCLUDE) \
727		-Fo$(1) \
728        $(RCFILE) )
729endef
730
731$(eval $(call gb_Helper_make_dep_targets,\
732	WinResTarget \
733))
734
735ifeq ($(gb_FULLDEPS),$(true))
736define gb_WinResTarget__command_dep
737$(call gb_Helper_abbreviate_dirs_native,\
738	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
739		$(INCLUDE) \
740		$(DEFS) \
741		$(2) \
742		-f - \
743	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
744		-v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \
745		-v OUTDIR=$(OUTDIR)/ \
746		-v WORKDIR=$(WORKDIR)/ \
747		-v SRCDIR=$(SRCDIR)/ \
748		-v REPODIR=$(REPODIR)/ \
749	> $(call gb_WinResTarget_get_dep_target,$(1)))
750endef
751else
752gb_WinResTarget__command_dep =
753endif
754
755# ComponentTarget
756
757gb_XSLTPROCPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
758gb_Library_COMPONENTPREFIXES := \
759    OOO:vnd.sun.star.expand:\dBRAND_BASE_DIR/program/ \
760    URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
761
762# vim: set noet sw=4 ts=4:
763