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