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