xref: /aoo42x/main/solenv/gbuild/platform/winmingw.mk (revision 42aba0ce)
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	strmiids \
484	user32 \
485	uuid \
486	uwinapi \
487	winmm \
488	winspool \
489	wsock32
490
491gb_Library_LAYER := \
492	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
493	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \
494	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
495	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
496	$(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
497	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
498	$(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \
499	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
500	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
501	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
502
503gb_Library_FILENAMES :=\
504	$(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
505
506gb_Library_DLLEXT := .dll
507gb_Library_MAJORVER := 3
508gb_Library_RTEXT := gcc3$(gb_Library_DLLEXT)
509ifeq ($(gb_PRODUCT),$(true))
510gb_Library_STLEXT := port_gcc$(gb_Library_DLLEXT)
511else
512gb_Library_STLEXT := port_gcc_stldebug$(gb_Library_DLLEXT)
513endif
514gb_Library_OOOEXT := $(gb_Library_DLLEXT)
515gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT)
516gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT)
517gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT)
518
519gb_Library_DLLFILENAMES := \
520	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
521	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
522	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
523	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
524	$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
525	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
526	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
527	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
528	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
529
530gb_Library_IARCSYSPRE := lib
531gb_Library_IARCEXT := .a
532
533gb_Library_ILIBEXT := .lib
534
535define gb_Library_Library_platform
536$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
537
538$(call gb_LinkTarget_set_auxtargets,$(2),\
539	$(patsubst %.dll,%.map,$(3)) \
540)
541
542$(call gb_Library_get_target,$(1)) \
543$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3))
544
545$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3),$(1))
546
547endef
548
549define gb_Library_add_default_nativeres
550$(call gb_WinResTarget_WinResTarget_init,$(1)/$(2))
551$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo)
552$(call gb_WinResTarget_set_defs,$(1)/$(2),\
553        $$(DEFS) \
554		-DADDITIONAL_VERINFO1= \
555		-DADDITIONAL_VERINFO2= \
556		-DADDITIONAL_VERINFO3= \
557)
558$(call gb_Library_add_nativeres,$(1),$(2))
559$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2))
560
561endef
562
563define gb_Library_add_nativeres
564$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : $(call gb_WinResTarget_get_target,$(1)/$(2))
565$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : NATIVERES += $(call gb_WinResTarget_get_target,$(1)/$(2))
566
567endef
568
569define gb_Library_get_dllname
570$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES)))
571endef
572
573
574# StaticLibrary class
575
576gb_StaticLibrary_DEFS :=
577gb_StaticLibrary_SYSPRE := lib
578gb_StaticLibrary_PLAINEXT := .a
579gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
580
581gb_StaticLibrary_FILENAMES := \
582	$(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
583	$(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
584
585gb_StaticLibrary_FILENAMES := $(patsubst salcpprt:salcpprt%,salcpprt:cpprtl%,$(gb_StaticLibrary_FILENAMES))
586
587gb_StaticLibrary_StaticLibrary_platform =
588
589# Executable class
590
591gb_Executable_EXT := .exe
592gb_Executable_TARGETTYPEFLAGS :=
593gb_Executable_get_rpath :=
594gb_Executable_Executable_platform =
595gb_Executable_TARGETGUI :=
596
597# GoogleTest class
598
599gb_GoogleTest_GTESTPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
600gb_GoogleTest_get_filename = $(1)$(gb_Executable_EXT)
601
602define gb_GoogleTest_GoogleTest_platform
603endef
604
605# SdiTarget class
606
607gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
608
609# SrsPartMergeTarget
610
611gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
612
613# SrsPartTarget class
614
615gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe
616gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
617
618ifeq ($(gb_FULLDEPS),$(true))
619define gb_SrsPartTarget__command_dep
620$(call gb_Helper_abbreviate_dirs_native,\
621	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
622		$(INCLUDE) \
623		$(DEFS) \
624		$(2) \
625		-f - \
626	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
627		-v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
628		-v OUTDIR=$(OUTDIR)/ \
629		-v WORKDIR=$(WORKDIR)/ \
630		-v SRCDIR=$(SRCDIR)/ \
631		-v REPODIR=$(REPODIR)/ \
632	> $(call gb_SrsPartTarget_get_dep_target,$(1)))
633endef
634else
635gb_SrsPartTarget__command_dep =
636endif
637
638# WinResTarget class
639
640gb_WinResTarget_POSTFIX :=_res.o
641
642define gb_WinResTarget__command
643$(call gb_Output_announce,$(2),$(true),RES,3)
644$(call gb_Helper_abbreviate_dirs_native,\
645	mkdir -p $(dir $(1)) && \
646	$(gb_RC) \
647		$(DEFS) $(FLAGS) \
648		-I$(dir $(3)) \
649		$(INCLUDE) \
650		-Fo$(patsubst %_res.o,%.res,$(1)) \
651        $(RCFILE) )
652$(call gb_Helper_abbreviate_dirs_native,\
653    windres $(patsubst %_res.o,%.res,$(1)) $(1))
654	rm $(patsubst %_res.o,%.res,$(1))
655endef
656
657$(eval $(call gb_Helper_make_dep_targets,\
658	WinResTarget \
659))
660
661ifeq ($(gb_FULLDEPS),$(true))
662define gb_WinResTarget__command_dep
663$(call gb_Helper_abbreviate_dirs_native,\
664	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
665		$(INCLUDE) \
666		$(DEFS) \
667		$(2) \
668		-f - \
669	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
670		-v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \
671		-v OUTDIR=$(OUTDIR)/ \
672		-v WORKDIR=$(WORKDIR)/ \
673		-v SRCDIR=$(SRCDIR)/ \
674		-v REPODIR=$(REPODIR)/ \
675	> $(call gb_WinResTarget_get_dep_target,$(1)))
676endef
677else
678gb_WinResTarget__command_dep =
679endif
680
681# ComponentTarget
682
683gb_XSLTPROCPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
684gb_Library_COMPONENTPREFIXES := \
685    OOO:vnd.sun.star.expand:\dOOO_BASE_DIR/program/ \
686    URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
687    NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \
688
689# UnoApiTarget
690
691gb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc.exe
692gb_UnoApiTarget_IDLCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_IDLCTARGET)
693gb_UnoApiTarget_REGMERGETARGET := $(OUTDIR)/bin/regmerge.exe
694gb_UnoApiTarget_REGMERGECOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGMERGETARGET)
695gb_UnoApiTarget_REGCOMPARETARGET := $(OUTDIR)/bin/regcompare.exe
696gb_UnoApiTarget_REGCOMPARECOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGCOMPARETARGET)
697gb_UnoApiTarget_CPPUMAKERTARGET := $(OUTDIR)/bin/cppumaker.exe
698gb_UnoApiTarget_CPPUMAKERCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_CPPUMAKERTARGET)
699gb_UnoApiTarget_REGVIEWTARGET := $(OUTDIR)/bin/regview.exe
700gb_UnoApiTarget_REGVIEWCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGVIEWTARGET)
701
702# vim: set noet sw=4 ts=4:
703