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