xref: /trunk/main/solenv/gbuild/platform/winmingw.mk (revision 44c25570)
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	--subsystem console \
157	--exclude-libs ALL \
158	--enable-stdcall-fixup \
159	--enable-runtime-pseudo-reloc-v2 \
160	-L$(gb_Library_DLLDIR) \
161	$(patsubst %,-L%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
162
163ifeq ($(MINGW_GCCLIB_EH),YES)
164gb_LinkTarget_LDFLAGS += -shared-libgcc
165endif
166
167ifeq ($(gb_DEBUGLEVEL),2)
168gb_COMPILEROPTFLAGS := -O0
169else
170gb_COMPILEROPTFLAGS := -Os
171endif
172
173gb_COMPILERNOOPTFLAGS := -O0
174
175gb_STDLIBS := \
176	mingwthrd \
177	$(gb_MINGW_LIBSTDCPP) \
178	mingw32 \
179	$(gb_MINGW_LIBGCC) \
180	uwinapi \
181	moldname \
182	mingwex \
183    kernel32 \
184	msvcrt \
185
186
187# Helper class
188
189gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
190gb_Helper_WORKDIR_NATIVE := $(shell cygpath -m $(WORKDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
191gb_Helper_OUTDIR_NATIVE := $(shell cygpath -m $(OUTDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
192gb_Helper_REPODIR_NATIVE := $(shell cygpath -m $(REPODIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
193
194define gb_Helper_abbreviate_dirs_native
195R=$(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))) && \
196$(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)))))))))
197endef
198
199# convert parametters filesystem root to native notation
200# does some real work only on windows, make sure not to
201# break the dummy implementations on unx*
202define gb_Helper_convert_native
203$(patsubst -I$(OUTDIR)%,-I$(gb_Helper_OUTDIR_NATIVE)%, \
204$(patsubst $(OUTDIR)%,$(gb_Helper_OUTDIR_NATIVE)%, \
205$(patsubst $(WORKDIR)%,$(gb_Helper_WORKDIR_NATIVE)%, \
206$(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \
207$(1)))))
208endef
209
210# CObject class
211
212ifeq ($(gb_FULLDEPS),$(true))
213define gb_CObject__command_deponcompile
214$(call gb_Helper_abbreviate_dirs_native,\
215	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
216		$(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
217		-I$(dir $(3)) \
218		$(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
219		$(3) \
220		-f - \
221	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
222		-v OBJECTFILE=$(1) \
223		-v OUTDIR=$(OUTDIR)/ \
224		-v WORKDIR=$(WORKDIR)/ \
225		-v SRCDIR=$(SRCDIR)/ \
226		-v REPODIR=$(REPODIR)/ \
227	> $(call gb_CObject_get_dep_target,$(2)))
228endef
229else
230CObject__command_deponcompile =
231endif
232
233define gb_CObject__command
234$(call gb_Output_announce,$(2),$(true),C  ,3)
235$(call gb_Helper_abbreviate_dirs_native,\
236	mkdir -p $(dir $(1)) && \
237	$(gb_CC) \
238		$(DEFS) $(CFLAGS) \
239		-c $(3) \
240		-o $(1) \
241		-I$(dir $(3)) \
242		$(INCLUDE))
243$(call gb_CObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(CFLAGS),$(INCLUDE))
244endef
245
246
247
248# CxxObject class
249
250ifeq ($(gb_FULLDEPS),$(true))
251define gb_CxxObject__command_deponcompile
252$(call gb_Helper_abbreviate_dirs_native,\
253	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
254		$(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
255		-I$(dir $(3)) \
256		$(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
257		$(3) \
258		-f - \
259	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
260		-v OBJECTFILE=$(1) \
261		-v OUTDIR=$(OUTDIR)/ \
262		-v WORKDIR=$(WORKDIR)/ \
263		-v SRCDIR=$(SRCDIR)/ \
264		-v REPODIR=$(REPODIR)/ \
265	> $(call gb_CxxObject_get_dep_target,$(2)))
266endef
267else
268gb_CxxObject__command_deponcompile =
269endif
270
271define gb_CxxObject__command
272$(call gb_Output_announce,$(2),$(true),CXX,3)
273$(call gb_Helper_abbreviate_dirs_native,\
274	mkdir -p $(dir $(1)) && \
275	$(gb_CXX) \
276		$(DEFS) $(CXXFLAGS) \
277		-c $(3) \
278		-o $(1) \
279		-I$(dir $(3)) \
280		$(INCLUDE_STL) $(INCLUDE))
281$(call gb_CxxObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(CXXFLAGS),$(INCLUDE_STL) $(INCLUDE))
282endef
283
284
285# PrecompiledHeader class
286
287gb_PrecompiledHeader_EXT := .gch
288
289gb_PrecompiledHeader_get_enableflags = -I$(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR) \
290					-DPRECOMPILED_HEADERS \
291					-Winvalid-pch \
292
293ifeq ($(gb_FULLDEPS),$(true))
294define gb_PrecompiledHeader__command_deponcompile
295$(call gb_Helper_abbreviate_dirs_native,\
296	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
297		$(4) $(5) \
298		-I$(dir $(3)) \
299		$(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
300		$(3) \
301		-f - \
302	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
303		-v OBJECTFILE=$(1) \
304		-v OUTDIR=$(OUTDIR)/ \
305		-v WORKDIR=$(WORKDIR)/ \
306		-v SRCDIR=$(SRCDIR)/ \
307		-v REPODIR=$(REPODIR)/ \
308	> $(call gb_PrecompiledHeader_get_dep_target,$(2)))
309endef
310else
311gb_PrecompiledHeader__command_deponcompile =
312endif
313
314define gb_PrecompiledHeader__command
315$(call gb_Output_announce,$(2),$(true),PCH,1)
316$(call gb_Helper_abbreviate_dirs_native,\
317	mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2))) && \
318	$(gb_CXX) \
319		-x c++-header \
320		$(4) $(5) \
321		-I$(dir $(3)) \
322		$(6) \
323		-c $(3) \
324		-o$(1))
325$(call gb_PrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
326
327endef
328
329# NoexPrecompiledHeader class
330
331gb_NoexPrecompiledHeader_EXT := .gch
332
333gb_NoexPrecompiledHeader_get_enableflags = -I$(WORKDIR)/NoexPrecompiledHeader/$(gb_NoexPrecompiledHeader_DEBUGDIR) \
334					-Winvalid-pch \
335
336ifeq ($(gb_FULLDEPS),$(true))
337define gb_NoexPrecompiledHeader__command_deponcompile
338$(call gb_Helper_abbreviate_dirs_native,\
339	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
340		$(4) $(5) \
341		-I$(dir $(3)) \
342		$(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
343		$(3) \
344		-f - \
345	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
346		-v OBJECTFILE=$(1) \
347		-v OUTDIR=$(OUTDIR)/ \
348		-v WORKDIR=$(WORKDIR)/ \
349		-v SRCDIR=$(SRCDIR)/ \
350		-v REPODIR=$(REPODIR)/ \
351	> $(call gb_NoexPrecompiledHeader_get_dep_target,$(2)))
352endef
353else
354gb_NoexPrecompiledHeader__command_deponcompile =
355endif
356
357define gb_NoexPrecompiledHeader__command
358$(call gb_Output_announce,$(2),$(true),PCH,1)
359$(call gb_Helper_abbreviate_dirs_native,\
360	mkdir -p $(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) && \
361	$(gb_CXX) \
362		-x c++-header \
363		$(4) $(5) \
364		-I$(dir $(3)) \
365		$(6) \
366		-c $(3) \
367		-o$(1))
368$(call gb_NoexPrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
369
370endef
371
372
373# LinkTarget class
374
375gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_COMPILEROPTFLAGS)
376gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
377
378ifeq ($(gb_DEBUGLEVEL),2)
379gb_LinkTarget_CXXFLAGS += -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline
380gb_LinkTarget_CFLAGS += -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline
381
382endif
383
384gb_LinkTarget_INCLUDE :=\
385	$(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \
386	$(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \
387
388gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
389
390define gb_LinkTarget__command_dynamiclinkexecutable
391$(call gb_Output_announce,$(2),$(true),LNK,4)
392$(call gb_Helper_abbreviate_dirs_native,\
393	mkdir -p $(dir $(1)) && \
394	RESPONSEFILE=`$(gb_MKTEMP)` && \
395	echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
396		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
397		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
398		$(NATIVERES) " > $${RESPONSEFILE} && \
399	$(gb_LINK) \
400		$(gb_Executable_TARGETTYPEFLAGS) \
401		$(LDFLAGS) \
402		$(gb_MINGWLIBDIR)/crt2.o \
403		$(MINGW_CLIB_DIR)/crtbegin.o \
404		@$${RESPONSEFILE} \
405		--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \
406		--start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \
407		--start-group $(patsubst %,-l%,$(EXTERNAL_LIBS)) --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))) \
421		$(NATIVERES) " > $${RESPONSEFILE} && \
422	$(gb_LINK) \
423		$(gb_Library_TARGETTYPEFLAGS) \
424		$(LDFLAGS) \
425		--enable-auto-image-base \
426		-e _DllMainCRTStartup@12 \
427		$(gb_MINGWLIBDIR)/dllcrt2.o \
428		$(MINGW_CLIB_DIR)/crtbegin.o \
429		@$${RESPONSEFILE} \
430		--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \
431		--start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \
432		$(MINGW_CLIB_DIR)/crtend.o \
433		-Map $(basename $(DLLTARGET)).map \
434		-o $(DLLTARGET) && touch $(1))
435endef
436
437define gb_LinkTarget__command_staticlinklibrary
438$(call gb_Helper_abbreviate_dirs_native,\
439	mkdir -p $(dir $(1)) && \
440	RESPONSEFILE=`$(gb_MKTEMP)` && \
441	echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
442		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
443		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) " > $${RESPONSEFILE} && \
444	$(gb_AR) -rsu\
445		$(1) \
446		@$${RESPONSEFILE})
447endef
448
449define gb_LinkTarget__command
450$(call gb_Output_announce,$(2),$(true),LNK,4)
451$(if $(filter Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinkexecutable,$(1),$(2)))
452$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinklibrary,$(1),$(2)))
453$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlinklibrary,$(1)))
454endef
455
456
457# Library class
458
459gb_Library_DEFS := -D_DLL
460gb_Library_TARGETTYPEFLAGS := -shared
461gb_Library_get_rpath :=
462
463gb_Library_SYSPRE := i
464gb_Library_PLAINEXT := .lib
465
466gb_Library_PLAINLIBS_NONE += \
467	mingwthrd \
468	mingw32 \
469	mingwex \
470	$(gb_MINGW_LIBSTDCPP) \
471	$(gb_MINGW_LIBGCC) \
472	advapi32 \
473	gdi32 \
474	gdiplus \
475	gnu_getopt \
476	imm32\
477	kernel32 \
478	msimg32 \
479	msvcrt \
480	mpr \
481	moldname \
482	ole32 \
483	oleaut32 \
484	shell32 \
485	user32 \
486	uuid \
487	uwinapi \
488	winspool \
489	z \
490	cppunit
491
492gb_Library_LAYER := \
493	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
494	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \
495	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
496	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
497	$(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
498	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
499	$(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \
500	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
501	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
502	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
503
504gb_Library_FILENAMES :=\
505	$(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
506
507gb_Library_DLLEXT := .dll
508gb_Library_MAJORVER := 3
509gb_Library_RTEXT := gcc3$(gb_Library_DLLEXT)
510ifeq ($(gb_PRODUCT),$(true))
511gb_Library_STLEXT := port_gcc$(gb_Library_DLLEXT)
512else
513gb_Library_STLEXT := port_gcc_stldebug$(gb_Library_DLLEXT)
514endif
515gb_Library_OOOEXT := $(gb_Library_DLLEXT)
516gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT)
517gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT)
518gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT)
519
520gb_Library_DLLFILENAMES := \
521	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
522	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
523	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
524	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
525	$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
526	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
527	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
528	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
529	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
530
531gb_Library_IARCSYSPRE := lib
532gb_Library_IARCEXT := .a
533
534gb_Library_ILIBEXT := .lib
535
536define gb_Library_Library_platform
537$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
538
539$(call gb_LinkTarget_set_auxtargets,$(2),\
540	$(patsubst %.dll,%.map,$(3)) \
541)
542
543$(call gb_Library_get_target,$(1)) \
544$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3))
545
546$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3))
547
548endef
549
550define gb_Library_add_default_nativeres
551$(call gb_WinResTarget_WinResTarget_init,$(1)/$(2))
552$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo)
553$(call gb_WinResTarget_set_defs,$(1)/$(2),\
554        $$(DEFS) \
555		-DADDITIONAL_VERINFO1= \
556		-DADDITIONAL_VERINFO2= \
557		-DADDITIONAL_VERINFO3= \
558)
559$(call gb_Library_add_nativeres,$(1),$(2))
560$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2))
561
562endef
563
564define gb_Library_add_nativeres
565$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : $(call gb_WinResTarget_get_target,$(1)/$(2))
566$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : NATIVERES += $(call gb_WinResTarget_get_target,$(1)/$(2))
567
568endef
569
570define gb_Library_get_dllname
571$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES)))
572endef
573
574
575# StaticLibrary class
576
577gb_StaticLibrary_DEFS :=
578gb_StaticLibrary_SYSPRE := lib
579gb_StaticLibrary_PLAINEXT := .a
580gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
581
582gb_StaticLibrary_FILENAMES := \
583	$(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
584	$(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
585
586gb_StaticLibrary_FILENAMES := $(patsubst salcpprt:salcpprt%,salcpprt:cpprtl%,$(gb_StaticLibrary_FILENAMES))
587
588gb_StaticLibrary_StaticLibrary_platform =
589
590# Executable class
591
592gb_Executable_EXT := .exe
593gb_Executable_TARGETTYPEFLAGS :=
594gb_Executable_get_rpath :=
595gb_Executable_Executable_platform =
596
597
598# CppunitTest class
599
600gb_CppunitTest_CPPTESTPRECOMMAND :=
601gb_CppunitTest_SYSPRE := itest_
602gb_CppunitTest_EXT := .lib
603gb_CppunitTest_get_filename = $(gb_CppunitTest_SYSPRE)$(1)$(gb_CppunitTest_EXT)
604gb_CppunitTest_get_libfilename = test_$(1).dll
605
606define gb_CppunitTest_CppunitTest_platform
607$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
608
609$(call gb_LinkTarget_set_auxtargets,$(2),\
610	$(patsubst %.dll,%.map,$(3)) \
611)
612
613endef
614
615# SdiTarget class
616
617gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
618
619# SrsPartMergeTarget
620
621gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
622
623# SrsPartTarget class
624
625gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe
626gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
627
628ifeq ($(gb_FULLDEPS),$(true))
629define gb_SrsPartTarget__command_dep
630$(call gb_Helper_abbreviate_dirs_native,\
631	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
632		$(INCLUDE) \
633		$(DEFS) \
634		$(2) \
635		-f - \
636	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
637		-v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
638		-v OUTDIR=$(OUTDIR)/ \
639		-v WORKDIR=$(WORKDIR)/ \
640		-v SRCDIR=$(SRCDIR)/ \
641		-v REPODIR=$(REPODIR)/ \
642	> $(call gb_SrsPartTarget_get_dep_target,$(1)))
643endef
644else
645gb_SrsPartTarget__command_dep =
646endif
647
648# WinResTarget class
649
650gb_WinResTarget_POSTFIX :=_res.o
651
652define gb_WinResTarget__command
653$(call gb_Output_announce,$(2),$(true),RES,3)
654$(call gb_Helper_abbreviate_dirs_native,\
655	mkdir -p $(dir $(1)) && \
656	$(gb_RC) \
657		$(DEFS) $(FLAGS) \
658		-I$(dir $(3)) \
659		$(INCLUDE) \
660		-Fo$(patsubst %_res.o,%.res,$(1)) \
661        $(RCFILE) )
662$(call gb_Helper_abbreviate_dirs_native,\
663    windres $(patsubst %_res.o,%.res,$(1)) $(1))
664	rm $(patsubst %_res.o,%.res,$(1))
665endef
666
667$(eval $(call gb_Helper_make_dep_targets,\
668	WinResTarget \
669))
670
671ifeq ($(gb_FULLDEPS),$(true))
672define gb_WinResTarget__command_dep
673$(call gb_Helper_abbreviate_dirs_native,\
674	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
675		$(INCLUDE) \
676		$(DEFS) \
677		$(2) \
678		-f - \
679	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
680		-v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \
681		-v OUTDIR=$(OUTDIR)/ \
682		-v WORKDIR=$(WORKDIR)/ \
683		-v SRCDIR=$(SRCDIR)/ \
684		-v REPODIR=$(REPODIR)/ \
685	> $(call gb_WinResTarget_get_dep_target,$(1)))
686endef
687else
688gb_WinResTarget__command_dep =
689endif
690
691# ComponentTarget
692
693gb_XSLTPROCPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
694gb_Library_COMPONENTPREFIXES := \
695    OOO:vnd.sun.star.expand:\dBRAND_BASE_DIR/program/ \
696    URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
697
698# vim: set noet sw=4 ts=4:
699