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