xref: /trunk/main/solenv/gbuild/platform/windows.mk (revision 70f497fb4451dd853e622598505702a3cb5381a8)
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    user32 \
465    uuid \
466    uwinapi \
467    winspool \
468    z \
469
470gb_Library_LAYER := \
471    $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
472    $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \
473    $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
474    $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
475    $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
476    $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
477    $(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \
478    $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
479    $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
480    $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
481
482gb_Library_FILENAMES :=\
483    $(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
484
485gb_Library_DLLEXT := .dll
486gb_Library_MAJORVER := 3
487gb_Library_RTEXT := MSC$(gb_Library_DLLEXT)
488ifeq ($(gb_PRODUCT),$(true))
489gb_Library_STLEXT := port_vc7145$(gb_Library_DLLEXT)
490else
491gb_Library_STLEXT := port_vc7145_stldebug$(gb_Library_DLLEXT)
492endif
493gb_Library_OOOEXT := $(gb_Library_DLLEXT)
494gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT)
495gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT)
496gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT)
497
498gb_Library_DLLFILENAMES :=\
499    $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
500    $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
501    $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
502    $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
503    $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
504    $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
505    $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(lib)$(gb_Library_STLEXT)) \
506    $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
507    $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
508    $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
509
510define gb_Library_Library_platform
511$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
512
513$(call gb_LinkTarget_set_auxtargets,$(2),\
514    $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
515    $(3).manifest \
516    $(call gb_LinkTarget_get_pdbfile,$(2)) \
517    $(patsubst %.dll,%.pdb,$(3)) \
518    $(patsubst %.dll,%.ilk,$(3)) \
519)
520
521$(call gb_Library_get_target,$(1)) \
522$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3))
523
524ifneq ($(ENABLE_CRASHDUMP),)
525$(call gb_Library_get_target,$(1)) \
526$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS +=  \
527        $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))) \
528        $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))) \
529
530$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))),$(patsubst %.dll,%.pdb,$(3)))
531$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))),$(patsubst %.dll,%.ilk,$(3)))
532endif
533
534$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3))
535
536$(call gb_LinkTarget_get_target,$(2)) \
537$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
538
539endef
540
541define gb_Library_add_default_nativeres
542$(call gb_WinResTarget_WinResTarget_init,$(1)/$(2))
543$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo)
544$(call gb_WinResTarget_set_defs,$(1)/$(2),\
545        $$(DEFS) \
546        -DADDITIONAL_VERINFO1 \
547        -DADDITIONAL_VERINFO2 \
548        -DADDITIONAL_VERINFO3 \
549)
550$(call gb_Library_add_nativeres,$(1),$(2))
551$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2))
552
553endef
554
555define gb_Library_add_nativeres
556$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : $(call gb_WinResTarget_get_target,$(1)/$(2))
557$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : NATIVERES += $(call gb_WinResTarget_get_target,$(1)/$(2))
558
559endef
560
561define gb_Library_get_dllname
562$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES)))
563endef
564
565
566# StaticLibrary class
567
568gb_StaticLibrary_DEFS :=
569gb_StaticLibrary_TARGETTYPEFLAGS := -LIB
570gb_StaticLibrary_SYSPRE :=
571gb_StaticLibrary_PLAINEXT := .lib
572gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
573
574gb_StaticLibrary_FILENAMES := \
575    $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
576    $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
577
578gb_StaticLibrary_FILENAMES := $(patsubst salcpprt:salcpprt%,salcpprt:cpprtl%,$(gb_StaticLibrary_FILENAMES))
579
580define gb_StaticLibrary_StaticLibrary_platform
581$(call gb_LinkTarget_get_target,$(2)) \
582$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
583
584$(call gb_LinkTarget_set_auxtargets,$(2),\
585    $(call gb_LinkTarget_get_pdbfile,$(2)) \
586)
587
588endef
589
590# Executable class
591
592gb_Executable_EXT := .exe
593gb_Executable_TARGETTYPEFLAGS := -RELEASE -BASE:0x1b000000 -OPT:NOREF -INCREMENTAL:NO -DEBUG
594gb_Executable_get_rpath :=
595
596define gb_Executable_Executable_platform
597$(call gb_LinkTarget_set_auxtargets,$(2),\
598    $(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \
599    $(call gb_LinkTarget_get_pdbfile,$(2)) \
600    $(call gb_LinkTarget_get_target,$(2)).manifest \
601)
602
603$(call gb_Executable_get_target,$(1)) \
604$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Executable_get_target,$(1)).manifest
605$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)).manifest,$(call gb_LinkTarget_get_target,$(2)).manifest)
606
607$(call gb_LinkTarget_get_target,$(2)) \
608$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
609
610endef
611
612# CppunitTest class
613
614gb_CppunitTest_CPPTESTPRECOMMAND :=
615gb_CppunitTest_SYSPRE := itest_
616gb_CppunitTest_EXT := .lib
617gb_CppunitTest_get_filename = $(gb_CppunitTest_SYSPRE)$(1)$(gb_CppunitTest_EXT)
618gb_CppunitTest_get_libfilename = test_$(1).dll
619
620define gb_CppunitTest_CppunitTest_platform
621$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
622
623$(call gb_LinkTarget_set_auxtargets,$(2),\
624    $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
625    $(3).manifest \
626    $(patsubst %.dll,%.pdb,$(3)) \
627    $(call gb_LinkTarget_get_pdbfile,$(2)) \
628    $(patsubst %.dll,%.ilk,$(3)) \
629)
630
631$(call gb_LinkTarget_get_target,$(2)) \
632$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
633
634endef
635
636# JunitTest class
637
638gb_defaultlangiso := en-US
639gb_smoketest_instset := $(SRCDIR)/instsetoo_native/$(INPATH)/OpenOffice/archive/install/$(gb_defaultlangiso)/OOo_*_install-arc_$(gb_defaultlangiso).zip
640
641ifeq ($(OOO_TEST_SOFFICE),)
642
643
644# Work around Windows problems with long pathnames (see issue 50885) by
645# installing into the temp directory instead of the module output tree (in which
646# case $(target).instpath contains the path to the temp installation,
647# which is removed after smoketest); can be removed once issue 50885 is fixed;
648# on other platforms, a single installation to solver is created in
649# smoketestoo_native.
650
651# for now, no dependency on $(shell ls $(gb_smoketest_instset))
652# because that doesn't work before the instset is built
653# and there is not much of a benefit anyway (gbuild not knowing about smoketest)
654define gb_JunitTest_JunitTest_platform_longpathname_hack
655$(call gb_JunitTest_get_target,$(1)) : $(call gb_JunitTest_get_target,$(1)).instpath
656$(call gb_JunitTest_get_target,$(1)) : CLEAN_CMD = $(call gb_Helper_abbreviate_dirs,rm -rf `cat $$@.instpath` $$@.instpath)
657
658$(call gb_JunitTest_get_target,$(1)).instpath :
659    INST_DIR=$$$$(cygpath -m `mktemp -d -t testinst.XXXXXX`) \
660    && unzip -d "$$$${INST_DIR}"  $$(gb_smoketest_instset) \
661    && mv "$$$${INST_DIR}"/OOo_*_install-arc_$$(gb_defaultlangiso) "$$$${INST_DIR}"/opt\
662    && mkdir -p $$(dir $$@) \
663    && echo "$$$${INST_DIR}" > $$@
664
665endef
666else # OOO_TEST_SOFFICE
667gb_JunitTest_JunitTest_platform_longpathname_hack =
668endif # OOO_TEST_SOFFICE
669
670define gb_JunitTest_JunitTest_platform
671$(call gb_JunitTest_JunitTest_platform_longpathname_hack,$(1))
672
673$(call gb_JunitTest_get_target,$(1)) : DEFS := \
674    -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:`cat $(call gb_JunitTest_get_target,$(1)).instpath`/opt/OpenOffice.org 3/program/soffice.exe}" \
675    -Dorg.openoffice.test.arg.env=PATH \
676    -Dorg.openoffice.test.arg.user=file:///$(call gb_JunitTest_get_userdir,$(1)) \
677
678endef
679
680
681# SdiTarget class
682
683gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
684
685# SrsPartMergeTarget
686
687gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
688
689# SrsPartTarget class
690
691gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe
692gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
693
694ifeq ($(gb_FULLDEPS),$(true))
695define gb_SrsPartTarget__command_dep
696$(call gb_Helper_abbreviate_dirs_native,\
697    $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
698        $(INCLUDE) \
699        $(DEFS) \
700        $(2) \
701        -f - \
702    | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
703        -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
704        -v OUTDIR=$(OUTDIR)/ \
705        -v WORKDIR=$(WORKDIR)/ \
706        -v SRCDIR=$(SRCDIR)/ \
707        -v REPODIR=$(REPODIR)/ \
708    > $(call gb_SrsPartTarget_get_dep_target,$(1)))
709endef
710else
711gb_SrsPartTarget__command_dep =
712endif
713
714# WinResTarget class
715
716gb_WinResTarget_POSTFIX :=.res
717
718define gb_WinResTarget__command
719$(call gb_Output_announce,$(2),$(true),RES,3)
720$(call gb_Helper_abbreviate_dirs_native,\
721    mkdir -p $(dir $(1)) && \
722    $(gb_RC) \
723        $(DEFS) $(FLAGS) \
724        -I$(dir $(3)) \
725        $(INCLUDE) \
726        -Fo$(1) \
727        $(RCFILE) )
728endef
729
730$(eval $(call gb_Helper_make_dep_targets,\
731    WinResTarget \
732))
733
734ifeq ($(gb_FULLDEPS),$(true))
735define gb_WinResTarget__command_dep
736$(call gb_Helper_abbreviate_dirs_native,\
737    $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
738        $(INCLUDE) \
739        $(DEFS) \
740        $(2) \
741        -f - \
742    | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
743        -v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \
744        -v OUTDIR=$(OUTDIR)/ \
745        -v WORKDIR=$(WORKDIR)/ \
746        -v SRCDIR=$(SRCDIR)/ \
747        -v REPODIR=$(REPODIR)/ \
748    > $(call gb_WinResTarget_get_dep_target,$(1)))
749endef
750else
751gb_WinResTarget__command_dep =
752endif
753
754# ComponentTarget
755
756gb_XSLTPROCPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
757gb_Library_COMPONENTPREFIXES := \
758    OOO:vnd.sun.star.expand:\dBRAND_BASE_DIR/program/ \
759    URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
760
761# vim: set noet sw=4 ts=4:
762