xref: /trunk/main/solenv/gbuild/platform/winmingw.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2009 by Sun Microsystems, Inc.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.	If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28GUI := WNT
29COM := GCC
30
31# set tmpdir to some mixed case path, suitable for native tools
32gb_TMPDIR:=$(if $(TMPDIR),$(shell cygpath -m $(TMPDIR)),$(shell cygpath -m /tmp))
33gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX
34
35gb_CC := $(CC)
36gb_CXX := $(CXX)
37gb_LINK := $(shell $(CC) -print-prog-name=ld)
38gb_AR := $(shell $(CC) -print-prog-name=ar)
39gb_AWK := awk
40ifeq ($(USE_MINGW),cygwin)
41gb_MINGWLIBDIR := $(COMPATH)/lib/mingw
42else
43ifeq ($(USE_MINGW),cygwin-w64-mingw32)
44gb_MINGWLIBDIR := $(COMPATH)/usr/i686-w64-mingw32/sys-root/mingw/lib
45else
46gb_MINGWLIBDIR := $(COMPATH)/lib
47endif
48endif
49ifeq ($(MINGW_SHARED_GXXLIB),YES)
50gb_MINGW_LIBSTDCPP := $(subst -l,,$(MINGW_SHARED_LIBSTDCPP))
51else
52gb_MINGW_LIBSTDCPP := \
53		stdc++ \
54		moldname
55endif
56ifeq ($(MINGW_SHARED_GCCLIB),YES)
57gb_MINGW_LIBGCC := \
58		gcc_s \
59		gcc
60else
61ifeq ($(MINGW_GCCLIB_EH),YES)
62gb_MINGW_LIBGCC := \
63		gcc \
64		gcc_eh
65else
66gb_MINGW_LIBGCC := gcc
67endif
68endif
69
70gb_OSDEFS := \
71	-DWINVER=0x0500 \
72	-D_WIN32_IE=0x0500 \
73	-DNT351 \
74	-DWIN32 \
75	-DWNT \
76
77ifeq ($(GXX_INCLUDE_PATH),)
78GXX_INCLUDE_PATH=$(COMPATH)/include/c++/$(shell gcc -dumpversion)
79endif
80
81gb_COMPILERDEFS := \
82	-DGCC \
83	-D$(CVER) \
84	-DCVER=$(CVER) \
85	-DGLIBC=2 \
86	-DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \
87	-DCPPU_ENV=gcc3 \
88	-D_MT \
89	-D_NATIVE_WCHAR_T_DEFINED \
90	-D_MSC_EXTENSIONS \
91	-D_FORCENAMELESSUNION \
92
93ifeq ($(USE_MINGW),cygwin-w64-mingw32)
94gb_COMPILERDEFS +=-D_declspec=__declspec
95endif
96
97gb_CPUDEFS := \
98	-DINTEL \
99	-D_M_IX86 \
100
101gb_RCDEFS := \
102     -DWINVER=0x0400 \
103	 -DWIN32 \
104
105gb_RCFLAGS := \
106     -V
107
108gb_CFLAGS := \
109	-Wall \
110	-Wendif-labels \
111	-Wextra \
112	-fmessage-length=0 \
113	-fno-strict-aliasing \
114	-pipe \
115	-nostdinc \
116
117gb_CXXFLAGS := \
118	-Wall \
119	-Wendif-labels \
120	-Wextra \
121	-Wno-ctor-dtor-privacy \
122	-Wno-non-virtual-dtor \
123	-Wreturn-type \
124	-Wshadow \
125	-Wuninitialized \
126	-fmessage-length=0 \
127	-fno-strict-aliasing \
128	-fno-use-cxa-atexit \
129	-pipe \
130	-nostdinc \
131
132ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
133gb_CFLAGS_WERROR := -Werror
134gb_CXXFLAGS_WERROR := -Werror
135endif
136
137ifneq ($(SYSBASE),)
138gb_CXXFLAGS += --sysroot=$(SYSBASE)
139gb_CFLAGS += --sysroot=$(SYSBASE)
140endif
141gb_LinkTarget_EXCEPTIONFLAGS := \
142	-DEXCEPTIONS_ON \
143	-fexceptions \
144	-fno-enforce-eh-specs \
145
146gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS)
147
148
149gb_LinkTarget_NOEXCEPTIONFLAGS := \
150	-DEXCEPTIONS_OFF \
151	-fno-exceptions \
152
153gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS := $(gb_LinkTarget_NOEXCEPTIONFLAGS)
154
155gb_LinkTarget_LDFLAGS := \
156	--export-all-symbols \
157	--kill-at \
158	--subsystem console \
159	--exclude-libs ALL \
160	--enable-stdcall-fixup \
161	--enable-runtime-pseudo-reloc-v2 \
162	-L$(gb_Library_DLLDIR) \
163	$(patsubst %,-L%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
164
165ifeq ($(MINGW_GCCLIB_EH),YES)
166gb_LinkTarget_LDFLAGS += -shared-libgcc
167endif
168
169ifeq ($(gb_DEBUGLEVEL),2)
170gb_COMPILEROPTFLAGS := -O0
171else
172gb_COMPILEROPTFLAGS := -Os
173endif
174
175gb_COMPILERNOOPTFLAGS := -O0
176
177gb_STDLIBS := \
178	mingwthrd \
179	$(gb_MINGW_LIBSTDCPP) \
180	mingw32 \
181	$(gb_MINGW_LIBGCC) \
182	uwinapi \
183	moldname \
184	mingwex \
185    kernel32 \
186	msvcrt \
187
188
189# Helper class
190
191gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
192gb_Helper_WORKDIR_NATIVE := $(shell cygpath -m $(WORKDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
193gb_Helper_OUTDIR_NATIVE := $(shell cygpath -m $(OUTDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
194gb_Helper_REPODIR_NATIVE := $(shell cygpath -m $(REPODIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
195
196define gb_Helper_abbreviate_dirs_native
197R=$(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))) && \
198$(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)))))))))
199endef
200
201# convert parametters filesystem root to native notation
202# does some real work only on windows, make sure not to
203# break the dummy implementations on unx*
204define gb_Helper_convert_native
205$(patsubst -I$(OUTDIR)%,-I$(gb_Helper_OUTDIR_NATIVE)%, \
206$(patsubst $(OUTDIR)%,$(gb_Helper_OUTDIR_NATIVE)%, \
207$(patsubst $(WORKDIR)%,$(gb_Helper_WORKDIR_NATIVE)%, \
208$(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \
209$(1)))))
210endef
211
212# CObject class
213
214ifeq ($(gb_FULLDEPS),$(true))
215define gb_CObject__command_deponcompile
216$(call gb_Helper_abbreviate_dirs_native,\
217	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
218		$(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
219		-I$(dir $(3)) \
220		$(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
221		$(3) \
222		-f - \
223	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
224		-v OBJECTFILE=$(1) \
225		-v OUTDIR=$(OUTDIR)/ \
226		-v WORKDIR=$(WORKDIR)/ \
227		-v SRCDIR=$(SRCDIR)/ \
228		-v REPODIR=$(REPODIR)/ \
229	> $(call gb_CObject_get_dep_target,$(2)))
230endef
231else
232CObject__command_deponcompile =
233endif
234
235define gb_CObject__command
236$(call gb_Output_announce,$(2),$(true),C  ,3)
237$(call gb_Helper_abbreviate_dirs_native,\
238	mkdir -p $(dir $(1)) && \
239	$(gb_CC) \
240		$(DEFS) $(CFLAGS) \
241		-c $(3) \
242		-o $(1) \
243		-I$(dir $(3)) \
244		$(INCLUDE))
245$(call gb_CObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(CFLAGS),$(INCLUDE))
246endef
247
248
249
250# CxxObject class
251
252ifeq ($(gb_FULLDEPS),$(true))
253define gb_CxxObject__command_deponcompile
254$(call gb_Helper_abbreviate_dirs_native,\
255	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
256		$(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
257		-I$(dir $(3)) \
258		$(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
259		$(3) \
260		-f - \
261	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
262		-v OBJECTFILE=$(1) \
263		-v OUTDIR=$(OUTDIR)/ \
264		-v WORKDIR=$(WORKDIR)/ \
265		-v SRCDIR=$(SRCDIR)/ \
266		-v REPODIR=$(REPODIR)/ \
267	> $(call gb_CxxObject_get_dep_target,$(2)))
268endef
269else
270gb_CxxObject__command_deponcompile =
271endif
272
273define gb_CxxObject__command
274$(call gb_Output_announce,$(2),$(true),CXX,3)
275$(call gb_Helper_abbreviate_dirs_native,\
276	mkdir -p $(dir $(1)) && \
277	$(gb_CXX) \
278		$(DEFS) $(CXXFLAGS) \
279		-c $(3) \
280		-o $(1) \
281		-I$(dir $(3)) \
282		$(INCLUDE_STL) $(INCLUDE))
283$(call gb_CxxObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(CXXFLAGS),$(INCLUDE_STL) $(INCLUDE))
284endef
285
286
287# PrecompiledHeader class
288
289gb_PrecompiledHeader_EXT := .gch
290
291gb_PrecompiledHeader_get_enableflags = -I$(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR) \
292					-DPRECOMPILED_HEADERS \
293					-Winvalid-pch \
294
295ifeq ($(gb_FULLDEPS),$(true))
296define gb_PrecompiledHeader__command_deponcompile
297$(call gb_Helper_abbreviate_dirs_native,\
298	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
299		$(4) $(5) \
300		-I$(dir $(3)) \
301		$(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
302		$(3) \
303		-f - \
304	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
305		-v OBJECTFILE=$(1) \
306		-v OUTDIR=$(OUTDIR)/ \
307		-v WORKDIR=$(WORKDIR)/ \
308		-v SRCDIR=$(SRCDIR)/ \
309		-v REPODIR=$(REPODIR)/ \
310	> $(call gb_PrecompiledHeader_get_dep_target,$(2)))
311endef
312else
313gb_PrecompiledHeader__command_deponcompile =
314endif
315
316define gb_PrecompiledHeader__command
317$(call gb_Output_announce,$(2),$(true),PCH,1)
318$(call gb_Helper_abbreviate_dirs_native,\
319	mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2))) && \
320	$(gb_CXX) \
321		-x c++-header \
322		$(4) $(5) \
323		-I$(dir $(3)) \
324		$(6) \
325		-c $(3) \
326		-o$(1))
327$(call gb_PrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
328
329endef
330
331# NoexPrecompiledHeader class
332
333gb_NoexPrecompiledHeader_EXT := .gch
334
335gb_NoexPrecompiledHeader_get_enableflags = -I$(WORKDIR)/NoexPrecompiledHeader/$(gb_NoexPrecompiledHeader_DEBUGDIR) \
336					-Winvalid-pch \
337
338ifeq ($(gb_FULLDEPS),$(true))
339define gb_NoexPrecompiledHeader__command_deponcompile
340$(call gb_Helper_abbreviate_dirs_native,\
341	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
342		$(4) $(5) \
343		-I$(dir $(3)) \
344		$(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
345		$(3) \
346		-f - \
347	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
348		-v OBJECTFILE=$(1) \
349		-v OUTDIR=$(OUTDIR)/ \
350		-v WORKDIR=$(WORKDIR)/ \
351		-v SRCDIR=$(SRCDIR)/ \
352		-v REPODIR=$(REPODIR)/ \
353	> $(call gb_NoexPrecompiledHeader_get_dep_target,$(2)))
354endef
355else
356gb_NoexPrecompiledHeader__command_deponcompile =
357endif
358
359define gb_NoexPrecompiledHeader__command
360$(call gb_Output_announce,$(2),$(true),PCH,1)
361$(call gb_Helper_abbreviate_dirs_native,\
362	mkdir -p $(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) && \
363	$(gb_CXX) \
364		-x c++-header \
365		$(4) $(5) \
366		-I$(dir $(3)) \
367		$(6) \
368		-c $(3) \
369		-o$(1))
370$(call gb_NoexPrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
371
372endef
373
374
375# LinkTarget class
376
377gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_COMPILEROPTFLAGS)
378gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
379
380ifeq ($(gb_DEBUGLEVEL),2)
381gb_LinkTarget_CXXFLAGS += -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline
382gb_LinkTarget_CFLAGS += -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline
383
384endif
385
386gb_LinkTarget_INCLUDE :=\
387	$(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \
388	$(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \
389
390gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
391
392define gb_LinkTarget__command_dynamiclinkexecutable
393$(call gb_Output_announce,$(2),$(true),LNK,4)
394$(call gb_Helper_abbreviate_dirs_native,\
395	mkdir -p $(dir $(1)) && \
396	RESPONSEFILE=`$(gb_MKTEMP)` && \
397	echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
398		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
399		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) " > $${RESPONSEFILE} && \
400	$(gb_LINK) \
401		$(gb_Executable_TARGETTYPEFLAGS) \
402		$(LDFLAGS) \
403		$(gb_MINGWLIBDIR)/crt2.o \
404		$(MINGW_CLIB_DIR)/crtbegin.o \
405		@$${RESPONSEFILE} \
406		--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \
407		--start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \
408		$(MINGW_CLIB_DIR)/crtend.o \
409		-Map $(basename $(1)).map \
410		-o $(1))
411endef
412
413define gb_LinkTarget__command_dynamiclinklibrary
414$(call gb_Helper_abbreviate_dirs_native,\
415	mkdir -p $(dir $(1)) && \
416	rm -f $(1) && \
417	RESPONSEFILE=`$(gb_MKTEMP)` && \
418	echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
419		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
420		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) " > $${RESPONSEFILE} && \
421	$(gb_LINK) \
422		$(gb_Library_TARGETTYPEFLAGS) \
423		$(LDFLAGS) \
424		--enable-auto-image-base \
425		-e _DllMainCRTStartup@12 \
426		$(gb_MINGWLIBDIR)/dllcrt2.o \
427		$(MINGW_CLIB_DIR)/crtbegin.o \
428		@$${RESPONSEFILE} \
429		--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \
430		--start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \
431		$(MINGW_CLIB_DIR)/crtend.o \
432		-Map $(basename $(DLLTARGET)).map \
433		-o $(DLLTARGET) && touch $(1))
434endef
435
436define gb_LinkTarget__command_staticlinklibrary
437$(call gb_Helper_abbreviate_dirs_native,\
438	mkdir -p $(dir $(1)) && \
439	RESPONSEFILE=`$(gb_MKTEMP)` && \
440	echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
441		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
442		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) " > $${RESPONSEFILE} && \
443	$(gb_AR) -rsu\
444		$(1) \
445		@$${RESPONSEFILE})
446endef
447
448define gb_LinkTarget__command
449$(call gb_Output_announce,$(2),$(true),LNK,4)
450$(if $(filter Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinkexecutable,$(1),$(2)))
451$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinklibrary,$(1),$(2)))
452$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlinklibrary,$(1)))
453endef
454
455
456# Library class
457
458gb_Library_DEFS := -D_DLL
459gb_Library_TARGETTYPEFLAGS := -shared
460gb_Library_get_rpath :=
461
462gb_Library_SYSPRE := i
463gb_Library_PLAINEXT := .lib
464
465gb_Library_PLAINLIBS_NONE += \
466	mingwthrd \
467	mingw32 \
468	mingwex \
469	$(gb_MINGW_LIBSTDCPP) \
470	$(gb_MINGW_LIBGCC) \
471	advapi32 \
472	gdi32 \
473	kernel32 \
474	msvcrt \
475	mpr \
476	moldname \
477	ole32 \
478	oleaut32 \
479	shell32 \
480	unicows \
481	user32 \
482	uuid \
483	uwinapi \
484	z \
485
486gb_Library_LAYER := \
487	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
488	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \
489	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
490	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
491	$(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
492	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
493	$(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \
494	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
495	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
496	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
497
498gb_Library_FILENAMES :=\
499	$(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
500
501gb_Library_DLLEXT := .dll
502gb_Library_MAJORVER := 3
503gb_Library_RTEXT := gcc3$(gb_Library_DLLEXT)
504ifeq ($(gb_PRODUCT),$(true))
505gb_Library_STLEXT := port_gcc$(gb_Library_DLLEXT)
506else
507gb_Library_STLEXT := port_gcc_stldebug$(gb_Library_DLLEXT)
508endif
509gb_Library_OOOEXT := gi$(gb_Library_DLLEXT)
510gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT)
511gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT)
512gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT)
513
514gb_Library_DLLFILENAMES := \
515	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
516	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
517	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
518	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
519	$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
520	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
521	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
522	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
523	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
524
525gb_Library_IARCSYSPRE := lib
526gb_Library_IARCEXT := .a
527
528gb_Library_ILIBEXT := .lib
529
530define gb_Library_Library_platform
531$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
532
533$(call gb_LinkTarget_set_auxtargets,$(2),\
534	$(patsubst %.dll,%.map,$(3)) \
535)
536
537$(call gb_Library_get_target,$(1)) \
538$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3))
539
540$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3))
541
542endef
543
544define gb_Library_add_default_nativeres
545$(call gb_WinResTarget_WinResTarget_init,$(1)/$(2))
546$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo)
547$(call gb_WinResTarget_set_defs,$(1)/$(2),\
548        $$(DEFS) \
549		-DADDITIONAL_VERINFO1 \
550		-DADDITIONAL_VERINFO2 \
551		-DADDITIONAL_VERINFO3 \
552)
553$(call gb_Library_add_nativeres,$(1),$(2))
554$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2))
555
556endef
557
558define gb_Library_add_nativeres
559$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : $(call gb_WinResTarget_get_target,$(1)/$(2))
560$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : NATIVERES += $(call gb_WinResTarget_get_target,$(1)/$(2))
561
562endef
563
564define gb_Library_get_dllname
565$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES)))
566endef
567
568
569# StaticLibrary class
570
571gb_StaticLibrary_DEFS :=
572gb_StaticLibrary_SYSPRE := lib
573gb_StaticLibrary_PLAINEXT := .a
574gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
575
576gb_StaticLibrary_FILENAMES := \
577	$(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
578	$(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
579
580gb_StaticLibrary_FILENAMES := $(patsubst salcpprt:salcpprt%,salcpprt:cpprtl%,$(gb_StaticLibrary_FILENAMES))
581
582gb_StaticLibrary_StaticLibrary_platform =
583
584# Executable class
585
586gb_Executable_EXT := .exe
587gb_Executable_TARGETTYPEFLAGS :=
588gb_Executable_get_rpath :=
589gb_Executable_Executable_platform =
590
591
592# CppunitTest class
593
594gb_CppunitTest_CPPTESTPRECOMMAND :=
595gb_CppunitTest_SYSPRE := itest_
596gb_CppunitTest_EXT := .lib
597gb_CppunitTest_get_filename = $(gb_CppunitTest_SYSPRE)$(1)$(gb_CppunitTest_EXT)
598gb_CppunitTest_get_libfilename = test_$(1).dll
599
600define gb_CppunitTest_CppunitTest_platform
601$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
602
603$(call gb_LinkTarget_set_auxtargets,$(2),\
604	$(patsubst %.dll,%.map,$(3)) \
605)
606
607endef
608
609# SdiTarget class
610
611gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
612
613# SrsPartMergeTarget
614
615gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
616
617# SrsPartTarget class
618
619gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe
620gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
621
622ifeq ($(gb_FULLDEPS),$(true))
623define gb_SrsPartTarget__command_dep
624$(call gb_Helper_abbreviate_dirs_native,\
625	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
626		$(INCLUDE) \
627		$(DEFS) \
628		$(2) \
629		-f - \
630	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
631		-v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
632		-v OUTDIR=$(OUTDIR)/ \
633		-v WORKDIR=$(WORKDIR)/ \
634		-v SRCDIR=$(SRCDIR)/ \
635		-v REPODIR=$(REPODIR)/ \
636	> $(call gb_SrsPartTarget_get_dep_target,$(1)))
637endef
638else
639gb_SrsPartTarget__command_dep =
640endif
641
642# WinResTarget class
643
644gb_WinResTarget_POSTFIX :=_res.o
645
646define gb_WinResTarget__command
647$(call gb_Output_announce,$(2),$(true),RES,3)
648$(call gb_Helper_abbreviate_dirs_native,\
649	mkdir -p $(dir $(1)) && \
650	$(gb_RC) \
651		$(DEFS) $(FLAGS) \
652		-I$(dir $(3)) \
653		$(INCLUDE) \
654		-Fo$(patsubst %_res.o,%.res,$(1)) \
655        $(RCFILE) )
656    windres $(patsubst %_res.o,%.res,$(1)) $(1)
657	rm $(patsubst %_res.o,%.res,$(1))
658endef
659
660$(eval $(call gb_Helper_make_dep_targets,\
661	WinResTarget \
662))
663
664ifeq ($(gb_FULLDEPS),$(true))
665define gb_WinResTarget__command_dep
666$(call gb_Helper_abbreviate_dirs_native,\
667	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
668		$(INCLUDE) \
669		$(DEFS) \
670		$(2) \
671		-f - \
672	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
673		-v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \
674		-v OUTDIR=$(OUTDIR)/ \
675		-v WORKDIR=$(WORKDIR)/ \
676		-v SRCDIR=$(SRCDIR)/ \
677		-v REPODIR=$(REPODIR)/ \
678	> $(call gb_WinResTarget_get_dep_target,$(1)))
679endef
680else
681gb_WinResTarget__command_dep =
682endif
683
684# ComponentTarget
685
686gb_XSLTPROCPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
687gb_Library_COMPONENTPREFIXES := \
688    OOO:vnd.sun.star.expand:\dBRAND_BASE_DIR/program/ \
689    URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
690
691# vim: set noet sw=4 ts=4:
692