xref: /trunk/main/solenv/gbuild/platform/winmingw.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 := GCC
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 := $(CC)
32gb_CXX := $(CXX)
33gb_LINK := $(shell $(CC) -print-prog-name=ld)
34gb_AR := $(shell $(CC) -print-prog-name=ar)
35gb_AWK := awk
36gb_RC := rc
37ifeq ($(USE_MINGW),cygwin)
38gb_MINGWLIBDIR := $(COMPATH)/lib/mingw
39else
40ifeq ($(USE_MINGW),cygwin-w64-mingw32)
41gb_MINGWLIBDIR := $(COMPATH)/usr/i686-w64-mingw32/sys-root/mingw/lib
42else
43gb_MINGWLIBDIR := $(COMPATH)/lib
44endif
45endif
46ifeq ($(MINGW_SHARED_GXXLIB),YES)
47gb_MINGW_LIBSTDCPP := $(subst -l,,$(MINGW_SHARED_LIBSTDCPP))
48else
49gb_MINGW_LIBSTDCPP := \
50		stdc++ \
51		moldname
52endif
53ifeq ($(MINGW_SHARED_GCCLIB),YES)
54gb_MINGW_LIBGCC := \
55		gcc_s \
56		gcc
57else
58ifeq ($(MINGW_GCCLIB_EH),YES)
59gb_MINGW_LIBGCC := \
60		gcc \
61		gcc_eh
62else
63gb_MINGW_LIBGCC := gcc
64endif
65endif
66
67gb_OSDEFS := \
68	-DWINVER=0x0500 \
69	-D_WIN32_IE=0x0500 \
70	-D_WIN32_WINNT=0x0600 \
71	-DNT351 \
72	-DWIN32 \
73	-DWNT \
74
75ifeq ($(GXX_INCLUDE_PATH),)
76GXX_INCLUDE_PATH=$(COMPATH)/include/c++/$(shell gcc -dumpversion)
77endif
78
79gb_COMPILERDEFS := \
80	-DGCC \
81	-D$(CVER) \
82	-DCVER=$(CVER) \
83	-DGLIBC=2 \
84	-DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \
85	-DCPPU_ENV=gcc3 \
86	-D_MT \
87	-D_NATIVE_WCHAR_T_DEFINED \
88	-D_MSC_EXTENSIONS \
89	-D_FORCENAMELESSUNION \
90
91ifeq ($(USE_MINGW),cygwin-w64-mingw32)
92gb_COMPILERDEFS +=-D_declspec=__declspec
93endif
94
95gb_CPUDEFS := \
96	-DINTEL \
97	-D_M_IX86 \
98
99gb_RCDEFS := \
100     -DWIN32 \
101     -D__GNUC__ \
102
103gb_RCFLAGS := \
104     -V
105
106gb_CFLAGS := \
107	-Wall \
108	-Wendif-labels \
109	-Wextra \
110	-fmessage-length=0 \
111	-fno-strict-aliasing \
112	-pipe \
113	-nostdinc \
114
115gb_CXXFLAGS := \
116	-Wall \
117	-Wendif-labels \
118	-Wextra \
119	-Wno-ctor-dtor-privacy \
120	-Wno-non-virtual-dtor \
121	-Wreturn-type \
122	-Wshadow \
123	-Wuninitialized \
124	-fmessage-length=0 \
125	-fno-strict-aliasing \
126	-fno-use-cxa-atexit \
127	-pipe \
128	-nostdinc \
129
130ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
131gb_CFLAGS_WERROR := -Werror
132gb_CXXFLAGS_WERROR := -Werror
133endif
134
135ifneq ($(SYSBASE),)
136gb_CXXFLAGS += --sysroot=$(SYSBASE)
137gb_CFLAGS += --sysroot=$(SYSBASE)
138endif
139gb_LinkTarget_EXCEPTIONFLAGS := \
140	-DEXCEPTIONS_ON \
141	-fexceptions \
142	-fno-enforce-eh-specs \
143
144gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS)
145
146
147gb_LinkTarget_NOEXCEPTIONFLAGS := \
148	-DEXCEPTIONS_OFF \
149	-fno-exceptions \
150
151gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS := $(gb_LinkTarget_NOEXCEPTIONFLAGS)
152
153gb_LinkTarget_LDFLAGS := \
154	--export-all-symbols \
155	--kill-at \
156	--exclude-libs ALL \
157	--enable-stdcall-fixup \
158	--enable-runtime-pseudo-reloc-v2 \
159	-L$(gb_Library_DLLDIR) \
160	$(patsubst %,-L%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
161
162ifeq ($(MINGW_GCCLIB_EH),YES)
163gb_LinkTarget_LDFLAGS += -shared-libgcc
164endif
165
166gb_DEBUG_CFLAGS := -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline
167
168ifeq ($(gb_DEBUGLEVEL),2)
169gb_COMPILEROPTFLAGS := -O0
170else
171gb_COMPILEROPTFLAGS := -Os
172endif
173
174gb_COMPILERNOOPTFLAGS := -O0
175
176gb_STDLIBS := \
177	mingwthrd \
178	$(gb_MINGW_LIBSTDCPP) \
179	mingw32 \
180	$(gb_MINGW_LIBGCC) \
181	uwinapi \
182	moldname \
183	mingwex \
184    kernel32 \
185	msvcrt \
186
187
188# Helper class
189
190gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
191gb_Helper_WORKDIR_NATIVE := $(shell cygpath -m $(WORKDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
192gb_Helper_OUTDIR_NATIVE := $(shell cygpath -m $(OUTDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
193gb_Helper_REPODIR_NATIVE := $(shell cygpath -m $(REPODIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
194
195define gb_Helper_abbreviate_dirs_native
196R=$(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))) && \
197$(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)))))))))
198endef
199
200# convert parametters filesystem root to native notation
201# does some real work only on windows, make sure not to
202# break the dummy implementations on unx*
203define gb_Helper_convert_native
204$(patsubst -I$(OUTDIR)%,-I$(gb_Helper_OUTDIR_NATIVE)%, \
205$(patsubst $(OUTDIR)%,$(gb_Helper_OUTDIR_NATIVE)%, \
206$(patsubst $(WORKDIR)%,$(gb_Helper_WORKDIR_NATIVE)%, \
207$(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \
208$(1)))))
209endef
210
211# convert parametters filesystem root to native notation
212# does some real work only on windows, make sure not to
213# break the dummy implementations on unx*
214define gb_Helper_convert_native
215$(patsubst -I$(OUTDIR)%,-I$(gb_Helper_OUTDIR_NATIVE)%, \
216$(patsubst $(OUTDIR)%,$(gb_Helper_OUTDIR_NATIVE)%, \
217$(patsubst $(WORKDIR)%,$(gb_Helper_WORKDIR_NATIVE)%, \
218$(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \
219$(1)))))
220endef
221
222# CObject class
223
224ifeq ($(gb_FULLDEPS),$(true))
225define gb_Object__command_deponcompile
226$(call gb_Helper_abbreviate_dirs_native,\
227	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
228		$(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
229		-I$(dir $(3)) \
230		$(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
231		$(3) \
232		-f - \
233	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
234		-v OBJECTFILE=$(1) \
235		-v OUTDIR=$(OUTDIR)/ \
236		-v WORKDIR=$(WORKDIR)/ \
237		-v SRCDIR=$(SRCDIR)/ \
238		-v REPODIR=$(REPODIR)/ \
239	> $(2))
240endef
241else
242gb_Object__command_deponcompile =
243endif
244
245define gb_CObject__command
246$(call gb_Output_announce,$(2),$(true),C  ,3)
247$(call gb_Helper_abbreviate_dirs_native,\
248	mkdir -p $(dir $(1)) && \
249	$(gb_CC) \
250		$(DEFS) \
251		$(T_CFLAGS) \
252		-c $(3) \
253		-o $(1) \
254		-I$(dir $(3)) \
255		$(INCLUDE))
256$(call gb_Object__command_deponcompile,$(1),$(4),$(3),$(DEFS),$(T_CFLAGS),$(INCLUDE))
257endef
258
259
260
261# CxxObject class
262
263define gb_CxxObject__command
264$(call gb_Output_announce,$(2),$(true),CXX,3)
265$(call gb_Helper_abbreviate_dirs_native,\
266	mkdir -p $(dir $(1)) && \
267	$(gb_CXX) \
268		$(DEFS) \
269		$(T_CXXFLAGS) \
270		-c $(3) \
271		-o $(1) \
272		-I$(dir $(3)) \
273		$(INCLUDE_STL) $(INCLUDE))
274$(call gb_Object__command_deponcompile,$(1),$(4),$(3),$(DEFS),$(T_CXXFLAGS),$(INCLUDE_STL) $(INCLUDE))
275endef
276
277
278# PrecompiledHeader class
279
280gb_PrecompiledHeader_EXT := .gch
281
282gb_PrecompiledHeader_get_enableflags = -I$(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR) \
283					-DPRECOMPILED_HEADERS \
284					-Winvalid-pch \
285
286ifeq ($(gb_FULLDEPS),$(true))
287define gb_PrecompiledHeader__command_deponcompile
288$(call gb_Helper_abbreviate_dirs_native,\
289	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
290		$(4) $(5) \
291		-I$(dir $(3)) \
292		$(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
293		$(3) \
294		-f - \
295	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
296		-v OBJECTFILE=$(1) \
297		-v OUTDIR=$(OUTDIR)/ \
298		-v WORKDIR=$(WORKDIR)/ \
299		-v SRCDIR=$(SRCDIR)/ \
300		-v REPODIR=$(REPODIR)/ \
301	> $(call gb_PrecompiledHeader_get_dep_target,$(2)))
302endef
303else
304gb_PrecompiledHeader__command_deponcompile =
305endif
306
307define gb_PrecompiledHeader__command
308$(call gb_Output_announce,$(2),$(true),PCH,1)
309$(call gb_Helper_abbreviate_dirs_native,\
310	mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2))) && \
311	$(gb_CXX) \
312		-x c++-header \
313		$(4) $(5) \
314		-I$(dir $(3)) \
315		-DPRECOMPILED_HEADERS \
316		$(6) \
317		-c $(3) \
318		-o$(1))
319$(call gb_PrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
320
321endef
322
323# NoexPrecompiledHeader class
324
325gb_NoexPrecompiledHeader_EXT := .gch
326
327gb_NoexPrecompiledHeader_get_enableflags = -I$(WORKDIR)/NoexPrecompiledHeader/$(gb_NoexPrecompiledHeader_DEBUGDIR) \
328					-Winvalid-pch \
329
330ifeq ($(gb_FULLDEPS),$(true))
331define gb_NoexPrecompiledHeader__command_deponcompile
332$(call gb_Helper_abbreviate_dirs_native,\
333	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
334		$(4) $(5) \
335		-I$(dir $(3)) \
336		$(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
337		$(3) \
338		-f - \
339	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
340		-v OBJECTFILE=$(1) \
341		-v OUTDIR=$(OUTDIR)/ \
342		-v WORKDIR=$(WORKDIR)/ \
343		-v SRCDIR=$(SRCDIR)/ \
344		-v REPODIR=$(REPODIR)/ \
345	> $(call gb_NoexPrecompiledHeader_get_dep_target,$(2)))
346endef
347else
348gb_NoexPrecompiledHeader__command_deponcompile =
349endif
350
351define gb_NoexPrecompiledHeader__command
352$(call gb_Output_announce,$(2),$(true),PCH,1)
353$(call gb_Helper_abbreviate_dirs_native,\
354	mkdir -p $(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) && \
355	$(gb_CXX) \
356		-x c++-header \
357		$(4) $(5) \
358		-I$(dir $(3)) \
359		-DPRECOMPILED_HEADERS \
360		$(6) \
361		-c $(3) \
362		-o$(1))
363$(call gb_NoexPrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
364
365endef
366
367
368# LinkTarget class
369
370gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR)
371gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
372
373gb_LinkTarget_INCLUDE :=\
374	$(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \
375	$(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \
376
377gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
378
379define gb_LinkTarget__command_dynamiclinkexecutable
380$(call gb_Output_announce,$(2),$(true),LNK,4)
381$(call gb_Helper_abbreviate_dirs_native,\
382	mkdir -p $(dir $(1)) && \
383	RESPONSEFILE=`$(gb_MKTEMP)` && \
384	echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
385		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
386		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
387		$(NATIVERES) " > $${RESPONSEFILE} && \
388	$(gb_LINK) \
389		$(gb_Executable_TARGETTYPEFLAGS) \
390		$(if $(filter YES,$(gb_Executable_TARGETGUI)), --subsystem windows, --subsystem console) \
391		$(T_LDFLAGS) \
392		$(gb_MINGWLIBDIR)/crt2.o \
393		$(MINGW_CLIB_DIR)/crtbegin.o \
394		@$${RESPONSEFILE} \
395		--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \
396		--start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \
397		--start-group $(patsubst %,-l%,$(EXTERNAL_LIBS)) --end-group \
398		$(LIBS) \
399		$(MINGW_CLIB_DIR)/crtend.o \
400		-Map $(basename $(1)).map \
401		-o $(1))
402endef
403
404define gb_LinkTarget__command_dynamiclinklibrary
405$(call gb_Helper_abbreviate_dirs_native,\
406	mkdir -p $(dir $(1)) && \
407	rm -f $(1) && \
408	RESPONSEFILE=`$(gb_MKTEMP)` && \
409	echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
410		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
411		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
412		$(NATIVERES) " > $${RESPONSEFILE} && \
413	$(gb_LINK) \
414		$(gb_Library_TARGETTYPEFLAGS) \
415		$(T_LDFLAGS) \
416		--enable-auto-image-base \
417		-e _DllMainCRTStartup@12 \
418		$(gb_MINGWLIBDIR)/dllcrt2.o \
419		$(MINGW_CLIB_DIR)/crtbegin.o \
420		@$${RESPONSEFILE} \
421		--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \
422		--start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \
423		$(LIBS) \
424		$(MINGW_CLIB_DIR)/crtend.o \
425		-Map $(basename $(DLLTARGET)).map \
426		-o $(DLLTARGET) && touch $(1))
427endef
428
429define gb_LinkTarget__command_staticlinklibrary
430$(call gb_Helper_abbreviate_dirs_native,\
431	mkdir -p $(dir $(1)) && \
432	RESPONSEFILE=`$(gb_MKTEMP)` && \
433	echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
434		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
435		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) " > $${RESPONSEFILE} && \
436	$(gb_AR) -rsu\
437		$(1) \
438		@$${RESPONSEFILE})
439endef
440
441define gb_LinkTarget__command
442$(call gb_Output_announce,$(2),$(true),LNK,4)
443$(if $(filter GoogleTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinkexecutable,$(1),$(2)))
444$(if $(filter Library,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinklibrary,$(1),$(2)))
445$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlinklibrary,$(1)))
446endef
447
448
449# Library class
450
451gb_Library_DEFS := -D_DLL_
452gb_Library_TARGETTYPEFLAGS := -shared
453gb_Library_get_rpath :=
454
455gb_Library_SYSPRE := i
456gb_Library_PLAINEXT := .lib
457
458gb_Library_PLAINLIBS_NONE += \
459	mingwthrd \
460	mingw32 \
461	mingwex \
462	$(gb_MINGW_LIBSTDCPP) \
463	$(gb_MINGW_LIBGCC) \
464	advapi32 \
465	comdlg32 \
466	d3d9 \
467	d3dx \
468	ddraw \
469	gdi32 \
470	gdiplus \
471	glu32 \
472	gnu_getopt \
473	imm32\
474	kernel32 \
475	msimg32 \
476	msvcrt \
477	mpr \
478	moldname \
479	ole32 \
480	oleaut32 \
481	opengl32 \
482	shell32 \
483	shlwapi \
484	strmiids \
485	user32 \
486	uuid \
487	uwinapi \
488	winmm \
489	winspool \
490	ws2_32 \
491	wsock32
492
493gb_Library_LAYER := \
494	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
495	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \
496	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
497	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
498	$(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
499	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
500	$(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \
501	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
502	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
503	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
504
505gb_Library_FILENAMES :=\
506	$(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
507
508gb_Library_DLLEXT := .dll
509gb_Library_MAJORVER := 3
510gb_Library_RTEXT := gcc3$(gb_Library_DLLEXT)
511ifeq ($(gb_PRODUCT),$(true))
512gb_Library_STLEXT := port_gcc$(gb_Library_DLLEXT)
513else
514gb_Library_STLEXT := port_gcc_stldebug$(gb_Library_DLLEXT)
515endif
516gb_Library_OOOEXT := $(gb_Library_DLLEXT)
517gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT)
518gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT)
519gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT)
520
521gb_Library_DLLFILENAMES := \
522	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
523	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
524	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
525	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
526	$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
527	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
528	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
529	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
530	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
531
532gb_Library_IARCSYSPRE := lib
533gb_Library_IARCEXT := .a
534
535gb_Library_ILIBEXT := .lib
536
537define gb_Library_Library_platform
538$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
539
540$(call gb_LinkTarget_set_auxtargets,$(2),\
541	$(patsubst %.dll,%.map,$(3)) \
542)
543
544$(call gb_Library_get_target,$(1)) \
545$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3))
546
547$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3),$(1))
548
549endef
550
551define gb_Library_add_default_nativeres
552$(call gb_WinResTarget_WinResTarget_init,$(1)/$(2))
553$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo)
554$(call gb_WinResTarget_set_defs,$(1)/$(2),\
555        $$(DEFS) \
556		-DADDITIONAL_VERINFO1= \
557		-DADDITIONAL_VERINFO2= \
558		-DADDITIONAL_VERINFO3= \
559)
560$(call gb_Library_add_nativeres,$(1),$(2))
561$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2))
562
563endef
564
565define gb_Library_add_nativeres
566$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : $(call gb_WinResTarget_get_target,$(1)/$(2))
567$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : NATIVERES += $(call gb_WinResTarget_get_target,$(1)/$(2))
568
569endef
570
571define gb_Library_get_dllname
572$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES)))
573endef
574
575
576# StaticLibrary class
577
578gb_StaticLibrary_DEFS :=
579gb_StaticLibrary_SYSPRE := lib
580gb_StaticLibrary_PLAINEXT := .a
581gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
582
583gb_StaticLibrary_FILENAMES := \
584	$(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
585	$(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
586
587gb_StaticLibrary_FILENAMES := $(patsubst salcpprt:salcpprt%,salcpprt:cpprtl%,$(gb_StaticLibrary_FILENAMES))
588
589gb_StaticLibrary_StaticLibrary_platform =
590
591# Executable class
592
593gb_Executable_EXT := .exe
594gb_Executable_TARGETTYPEFLAGS :=
595gb_Executable_get_rpath :=
596gb_Executable_Executable_platform =
597gb_Executable_TARGETGUI :=
598
599# GoogleTest class
600
601gb_GoogleTest_GTESTPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
602gb_GoogleTest_get_filename = $(1)$(gb_Executable_EXT)
603
604define gb_GoogleTest_GoogleTest_platform
605endef
606
607# JunitTest class
608
609define gb_JunitTest_JunitTest_platform
610$(call gb_JunitTest_get_target,$(1)) : DEFS := \
611	-Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(SRCDIR)/instsetoo_native/$(INPATH)/Apache_OpenOffice/installed/install/en-US/OpenOffice 4/program/soffice.exe}" \
612    -Dorg.openoffice.test.arg.env=PATH \
613    -Dorg.openoffice.test.arg.user=file:///$(call gb_JunitTest_get_userdir,$(1)) \
614
615endef
616
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:\dOOO_BASE_DIR/program/ \
699    URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
700    NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \
701
702# UnoApiTarget
703
704gb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc.exe
705gb_UnoApiTarget_IDLCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_IDLCTARGET)
706gb_UnoApiTarget_REGMERGETARGET := $(OUTDIR)/bin/regmerge.exe
707gb_UnoApiTarget_REGMERGECOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGMERGETARGET)
708gb_UnoApiTarget_REGCOMPARETARGET := $(OUTDIR)/bin/regcompare.exe
709gb_UnoApiTarget_REGCOMPARECOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGCOMPARETARGET)
710gb_UnoApiTarget_CPPUMAKERTARGET := $(OUTDIR)/bin/cppumaker.exe
711gb_UnoApiTarget_CPPUMAKERCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_CPPUMAKERTARGET)
712gb_UnoApiTarget_REGVIEWTARGET := $(OUTDIR)/bin/regview.exe
713gb_UnoApiTarget_REGVIEWCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGVIEWTARGET)
714
715# vim: set noet sw=4 ts=4:
716