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