xref: /aoo41x/main/solenv/gbuild/platform/os2.mk (revision f0a50dfa)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2011 Oracle and/or its affiliates.
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
28include $(GBUILDDIR)/gmsl
29
30GUI := OS2
31COM := GCC
32
33# set tmpdir to some mixed case path, suitable for native tools
34#gb_TMPDIR:=$(if $(TMPDIR),$(shell cygpath -m $(TMPDIR)),$(shell cygpath -m /tmp))
35#gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX
36gb_MKTEMP := mktemp -t gbuild.XXXXXX
37
38gb_CC := gcc
39gb_CXX := g++
40gb_GCCP := gcc
41gb_LINK := gcc
42gb_AR := emxomfar
43gb_AWK := awk
44gb_CLASSPATHSEP := ;
45gb_RC := wrc
46
47# use CC/CXX if they are nondefaults
48ifneq ($(origin CC),default)
49gb_CC := $(CC)
50gb_GCCP := $(CC)
51endif
52ifneq ($(origin CXX),default)
53gb_CXX := $(CXX)
54endif
55
56gb_OSDEFS := \
57	-D$(OS) \
58	-D_PTHREADS \
59	-DOS2 \
60	$(PTHREAD_CFLAGS) \
61
62ifeq ($(GXX_INCLUDE_PATH),)
63GXX_INCLUDE_PATH=$(COMPATH)/include/c++/$(shell gcc -dumpversion)
64endif
65
66gb_COMPILERDEFS := \
67	-D$(COM) \
68	-DHAVE_GCC_VISIBILITY_FEATURE \
69	-DCPPU_ENV=gcc3 \
70	-DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \
71
72gb_CPUDEFS := -DINTEL -D_X86_=1 -DX86
73
74gb_RCDEFS := \
75	-DOS2 \
76	-bt=os2 \
77	-i$(PATH_EMXPGCC)\include \
78
79gb_RCFLAGS := \
80     -V
81
82gb_CFLAGS := \
83	-Zomf \
84	-Wall \
85	-Wendif-labels \
86	-Wextra \
87	-Wshadow \
88	-fmessage-length=0 \
89	-fno-common \
90	-fno-strict-aliasing \
91	-I$(JAVA_HOME)/include \
92	-I$(JAVA_HOME)/include/os2
93
94
95#	-fvisibility=hidden \
96#
97
98gb_CXXFLAGS := \
99	-Zomf \
100	-Wall \
101	-Wendif-labels \
102	-Wextra \
103	-Wno-ctor-dtor-privacy \
104	-Wno-non-virtual-dtor \
105	-Wshadow \
106	-fmessage-length=0 \
107	-fno-common \
108	-fno-strict-aliasing \
109	-fno-use-cxa-atexit \
110	-I$(JAVA_HOME)/include \
111	-I$(JAVA_HOME)/include/os2
112
113#	-fvisibility-inlines-hidden \
114#	-fvisibility=hidden \
115#
116
117gb_STDLIBS = \
118	stdc444 \
119
120ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
121gb_CFLAGS_WERROR := -Werror
122gb_CXXFLAGS_WERROR := -Werror
123endif
124
125gb_LinkTarget_EXCEPTIONFLAGS := \
126	-DEXCEPTIONS_ON \
127	-fexceptions \
128	-fno-enforce-eh-specs \
129
130gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS)
131
132gb_LinkTarget_NOEXCEPTIONFLAGS := \
133	-DEXCEPTIONS_OFF \
134	-fno-exceptions \
135
136gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS := $(gb_LinkTarget_NOEXCEPTIONFLAGS)
137
138
139gb_LinkTarget_LDFLAGS := \
140	-g -Zomf \
141	-Zhigh-mem \
142	-Zlinker "DISABLE 1121" \
143	-Zmap \
144	$(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
145	$(subst -L../lib , ,$(SOLARLIB)) \
146
147ifneq ($(ENABLE_CRASHDUMP),)
148gb_LinkTarget_LDFLAGS += -DEBUG
149gb_CFLAGS+=-Zi
150gb_CXXFLAGS+=-Zi
151endif
152
153ifeq ($(gb_DEBUGLEVEL),2)
154gb_COMPILEROPTFLAGS := -O0
155#gb_LinkTarget_LDFLAGS += -DEBUG
156else
157gb_COMPILEROPTFLAGS := -Os
158endif
159
160gb_COMPILERNOOPTFLAGS := -O0
161
162
163# Helper class
164
165gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs)
166
167# convert parametters filesystem root to native notation
168# does some real work only on windows, make sure not to
169# break the dummy implementations on unx*
170define gb_Helper_convert_native
171$(1)
172endef
173
174
175# CObject class
176
177define gb_CObject__command
178$(call gb_Output_announce,$(2),$(true),C  ,3)
179$(call gb_Helper_abbreviate_dirs,\
180	mkdir -p $(dir $(1)) && \
181	mkdir -p $(dir $(call gb_CObject_get_dep_target,$(2))) && \
182	$(gb_CC) \
183		$(DEFS) $(CFLAGS) \
184		-c $(3) \
185		-o $(1) \
186		-MMD -MT $(call gb_CObject_get_target,$(2)) \
187		-MF $(call gb_CObject_get_dep_target,$(2)) \
188		-I$(dir $(3)) \
189		$(INCLUDE))
190endef
191
192
193# CxxObject class
194
195define gb_CxxObject__command
196$(call gb_Output_announce,$(2),$(true),CXX,3)
197$(call gb_Helper_abbreviate_dirs,\
198	mkdir -p $(dir $(1)) && \
199	mkdir -p $(dir $(call gb_CxxObject_get_dep_target,$(2))) && \
200	$(gb_CXX) \
201		$(DEFS) $(CXXFLAGS) \
202		-c $(3) \
203		-o $(1) \
204		-MMD -MT $(call gb_CxxObject_get_target,$(2)) \
205		-MF $(call gb_CxxObject_get_dep_target,$(2)) \
206		-I$(dir $(3)) \
207		$(INCLUDE_STL) $(INCLUDE))
208endef
209
210
211# PrecompiledHeader class
212
213gb_PrecompiledHeader_get_enableflags = -Yu$(1).hxx \
214									   -Fp$(call gb_PrecompiledHeader_get_target,$(1))
215
216ifeq ($(gb_FULLDEPS),$(true))
217define gb_PrecompiledHeader__command_deponcompile
218$(call gb_Helper_abbreviate_dirs_native,\
219	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
220		$(4) $(5) \
221		-I$(dir $(3)) \
222		$(filter-out -I$(COMPATH)% -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_PrecompiledHeader_get_dep_target,$(2)))
232endef
233else
234gb_PrecompiledHeader__command_deponcompile =
235endif
236
237
238define gb_PrecompiledHeader__command
239$(call gb_Output_announce,$(2),$(true),PCH,1)
240$(call gb_Helper_abbreviate_dirs_native,\
241	mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2))) && \
242	unset INCLUDE && \
243	$(gb_CXX) \
244		$(4) $(5) -Fd$(PDBFILE) \
245		-I$(dir $(3)) \
246		$(6) \
247		-c $(3) \
248		-Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj)
249$(call gb_PrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
250endef
251
252# NoexPrecompiledHeader class
253
254gb_NoexPrecompiledHeader_get_enableflags = -Yu$(1).hxx \
255										   -Fp$(call gb_NoexPrecompiledHeader_get_target,$(1))
256
257ifeq ($(gb_FULLDEPS),$(true))
258define gb_NoexPrecompiledHeader__command_deponcompile
259$(call gb_Helper_abbreviate_dirs_native,\
260	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
261		$(4) $(5) \
262		-I$(dir $(3)) \
263		$(filter-out -I$(COMPATH)% -I$(JAVA_HOME)%,$(6)) \
264		$(3) \
265		-f - \
266	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
267		-v OBJECTFILE=$(1) \
268		-v OUTDIR=$(OUTDIR)/ \
269		-v WORKDIR=$(WORKDIR)/ \
270		-v SRCDIR=$(SRCDIR)/ \
271		-v REPODIR=$(REPODIR)/ \
272	> $(call gb_NoexPrecompiledHeader_get_dep_target,$(2)))
273endef
274else
275gb_NoexPrecompiledHeader__command_deponcompile =
276endif
277
278
279define gb_NoexPrecompiledHeader__command
280$(call gb_Output_announce,$(2),$(true),PCH,1)
281$(call gb_Helper_abbreviate_dirs_native,\
282	mkdir -p $(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) && \
283	unset INCLUDE && \
284	$(gb_CXX) \
285		$(4) $(5) -Fd$(PDBFILE) \
286		-I$(dir $(3)) \
287		$(6) \
288		-c $(3) \
289		-Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj)
290$(call gb_NoexPrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
291endef
292
293# LinkTarget class
294
295gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_COMPILEROPTFLAGS)
296gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
297
298ifeq ($(gb_DEBUGLEVEL),2)
299gb_LinkTarget_CFLAGS += -g
300gb_LinkTarget_CXXFLAGS += -g
301gb_LinkTarget_OBJCXXFLAGS += -g
302endif
303
304gb_LinkTarget_INCLUDE :=\
305	$(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \
306	$(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \
307
308gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
309
310gb_LinkTarget_get_pdbfile = $(call gb_LinkTarget_get_target,)pdb/$(1).pdb
311
312DLLBASE8 = $(call substr,$(notdir $(DLLTARGET:.dll=)),1,8)
313DLLTARGET8 = $(dir $(DLLTARGET))$(DLLBASE8)$(gb_Library_DLLEXT)
314DLLDEF8 = $(dir $(DLLTARGET))$(DLLBASE8).def
315
316	#EMXEXPRSP=$(call var2filecr,$(shell $(gb_MKTEMP)),1, \
317		$(call gb_Helper_convert_native,$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
318		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
319		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object)))) \
320		) && \
321	emxexp @$${EMXEXPRSP} >> $(DLLDEF8) && \
322	echo EXPORTS		>> $(DLLDEF8) && \
323
324
325define gb_LinkTarget__command_dynamiclinkexecutable
326$(call gb_Output_announce,$(2),$(true),LNK,4)
327$(call gb_Helper_abbreviate_dirs_native,\
328	mkdir -p $(dir $(1)) && \
329	rm -f $(1) && \
330	$(if $(DLLTARGET), echo LIBRARY	  $(DLLBASE8) INITINSTANCE TERMINSTANCE	 > $(DLLDEF8) &&) \
331	$(if $(DLLTARGET), echo DATA MULTIPLE	>> $(DLLDEF8) &&) \
332	RESPONSEFILE=$(call var2filecr,$(shell $(gb_MKTEMP)),1, \
333	    $(call gb_Helper_convert_native,$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
334		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
335		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
336		$(PCHOBJS))) && \
337	$(gb_LINK) \
338		$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
339		$(if $(filter StaticLibrary,$(TARGETTYPE)),$(gb_StaticLibrary_TARGETTYPEFLAGS)) \
340		$(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
341		$(LDFLAGS) \
342		@$${RESPONSEFILE} \
343		$(if $(DLLTARGET), $(DLLDEF8)) \
344		$(NATIVERES) \
345		$(patsubst %.lib,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \
346		$(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \
347		$(if $(DLLTARGET),-o $(DLLTARGET8), -o $(1) ); \
348		RC=$$?; rm $${RESPONSEFILE} \
349	$(if $(DLLTARGET),; emximp -p2048 -o $(1) $(DLLTARGET8) ) \
350	$(if $(DLLTARGET),; cp -p $(DLLTARGET8) $(DLLTARGET)) \
351	$(if $(DLLTARGET),; if [ ! -f $(DLLTARGET) ]; then rm -f $(1) && false; fi) ; exit $$RC)
352endef
353
354
355define gb_LinkTarget__command_staticlinklibrary
356$(call gb_Helper_abbreviate_dirs_native,\
357	mkdir -p $(dir $(1)) && \
358	RESPONSEFILE=`$(gb_MKTEMP)` && \
359	echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
360		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
361		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) " > $${RESPONSEFILE} && \
362	$(gb_AR) cru\
363		$(1) \
364		@$${RESPONSEFILE})
365endef
366
367define gb_LinkTarget__command
368$(call gb_Output_announce,$(2),$(true),LNK,4)
369$(if $(filter Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinkexecutable,$(1),$(2)))
370$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinkexecutable,$(1),$(2)))
371$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlinklibrary,$(1)))
372endef
373
374
375# Library class
376
377gb_Library_DEFS := -D_DLL
378gb_Library_TARGETTYPEFLAGS := -Zdll
379gb_Library_get_rpath :=
380
381gb_Library_SYSPRE := i
382gb_Library_PLAINEXT := .lib
383
384gb_Library_PLAINLIBS_NONE += \
385	$(gb_STDLIBS) \
386	ft2lib \
387	dl \
388	freetype \
389	jpeg \
390	m \
391	z \
392	pthread
393
394gb_Library_LAYER := \
395	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
396	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \
397	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
398	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
399	$(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
400	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
401	$(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \
402	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
403	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
404	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
405
406gb_Library_FILENAMES :=\
407	$(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
408
409gb_Library_DLLEXT := .dll
410gb_Library_MAJORVER :=
411gb_Library_RTEXT := $(gb_Library_DLLEXT)
412ifeq ($(gb_PRODUCT),$(true))
413gb_Library_STLEXT := stlp45$(gb_Library_DLLEXT)
414else
415gb_Library_STLEXT := stlp45_stldebug$(gb_Library_DLLEXT)
416endif
417gb_Library_OOOEXT := $(gb_Library_DLLEXT)
418gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT)
419gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT)
420gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT)
421
422gb_Library_DLLFILENAMES :=\
423	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
424	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
425	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
426	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
427	$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
428	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
429	$(foreach lib,$(gb_Library_STLLIBS),$(lib):$(lib)$(gb_Library_STLEXT)) \
430	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
431	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
432	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
433
434define gb_Library_Library_platform
435$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
436
437#$(call gb_LinkTarget_set_auxtargets,$(2),\
438	$(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
439	$(3).manifest \
440	$(call gb_LinkTarget_get_pdbfile,$(2)) \
441	$(patsubst %.dll,%.pdb,$(3)) \
442	$(patsubst %.dll,%.ilk,$(3)) \
443)
444
445$(call gb_Library_get_target,$(1)) \
446$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3))
447
448ifneq ($(ENABLE_CRASHDUMP),)
449$(call gb_Library_get_target,$(1)) \
450$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS +=  \
451		$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))) \
452		$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))) \
453
454$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))),$(patsubst %.dll,%.pdb,$(3)))
455$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))),$(patsubst %.dll,%.ilk,$(3)))
456endif
457
458$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3))
459
460$(call gb_LinkTarget_get_target,$(2)) \
461$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
462
463endef
464
465define gb_Library_add_default_nativeres_DISABLED
466$(call gb_WinResTarget_WinResTarget_init,$(1)/$(2))
467$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo)
468$(call gb_WinResTarget_set_defs,$(1)/$(2),\
469        $$(DEFS) \
470		-DADDITIONAL_VERINFO1 \
471		-DADDITIONAL_VERINFO2 \
472		-DADDITIONAL_VERINFO3 \
473)
474$(call gb_Library_add_nativeres,$(1),$(2))
475$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2))
476
477endef
478
479define gb_Library_add_nativeres
480$(info info $(1)/$(2))
481$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : $(call gb_WinResTarget_get_target,$(1)/$(2))
482$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : NATIVERES += $(call gb_WinResTarget_get_target,$(1)/$(2))
483$(info NATIVERES $(NATIVERES))
484
485endef
486
487define gb_Library_get_dllname
488$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES)))
489endef
490
491
492# StaticLibrary class
493
494gb_StaticLibrary_DEFS :=
495gb_StaticLibrary_SYSPRE :=
496gb_StaticLibrary_PLAINEXT := .lib
497gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
498
499gb_StaticLibrary_FILENAMES := \
500	$(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
501	$(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
502
503gb_StaticLibrary_StaticLibrary_platform =
504
505
506# Executable class
507
508gb_Executable_EXT := .exe
509gb_Executable_TARGETTYPEFLAGS :=
510#-RELEASE -BASE:0x1b000000 -OPT:NOREF -INCREMENTAL:NO -DEBUG
511gb_Executable_get_rpath :=
512
513define gb_Executable_Executable_platform
514#$(call gb_LinkTarget_set_auxtargets,$(2),\
515#	$(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \
516#	$(call gb_LinkTarget_get_pdbfile,$(2)) \
517#	$(call gb_LinkTarget_get_target,$(2)).manifest \
518#)
519
520#$(call gb_Executable_get_target,$(1)) \
521#$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Executable_get_target,$(1)).manifest
522#$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)).manifest,$(call gb_LinkTarget_get_target,$(2)).manifest)
523
524#$(call gb_LinkTarget_get_target,$(2)) \
525#$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
526
527endef
528
529# CppunitTest class
530
531gb_CppunitTest_CPPTESTPRECOMMAND :=
532gb_CppunitTest_SYSPRE := itest_
533gb_CppunitTest_EXT := .lib
534gb_CppunitTest_get_filename = $(gb_CppunitTest_SYSPRE)$(1)$(gb_CppunitTest_EXT)
535gb_CppunitTest_get_libfilename = test_$(1).dll
536
537define gb_CppunitTest_CppunitTest_platform
538$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
539
540#$(call gb_LinkTarget_set_auxtargets,$(2),\
541	$(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
542	$(3).manifest \
543	$(patsubst %.dll,%.pdb,$(3)) \
544	$(call gb_LinkTarget_get_pdbfile,$(2)) \
545	$(patsubst %.dll,%.ilk,$(3)) \
546)
547
548$(call gb_LinkTarget_get_target,$(2)) \
549$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
550
551endef
552
553# JunitTest class
554
555gb_defaultlangiso := en-US
556gb_smoketest_instset := $(SRCDIR)/instsetoo_native/$(INPATH)/OpenOffice/archive/install/$(gb_defaultlangiso)/OOo_*_install-arc_$(gb_defaultlangiso).zip
557
558ifeq ($(OOO_TEST_SOFFICE),)
559
560
561# Work around Windows problems with long pathnames (see issue 50885) by
562# installing into the temp directory instead of the module output tree (in which
563# case $(target).instpath contains the path to the temp installation,
564# which is removed after smoketest); can be removed once issue 50885 is fixed;
565# on other platforms, a single installation to solver is created in
566# smoketestoo_native.
567
568# for now, no dependency on $(shell ls $(gb_smoketest_instset))
569# because that doesn't work before the instset is built
570# and there is not much of a benefit anyway (gbuild not knowing about smoketest)
571define gb_JunitTest_JunitTest_platform_longpathname_hack
572$(call gb_JunitTest_get_target,$(1)) : $(call gb_JunitTest_get_target,$(1)).instpath
573$(call gb_JunitTest_get_target,$(1)) : CLEAN_CMD = $(call gb_Helper_abbreviate_dirs,rm -rf `cat $$@.instpath` $$@.instpath)
574
575$(call gb_JunitTest_get_target,$(1)).instpath :
576	INST_DIR=$$$$(cygpath -m `mktemp -d -t testinst.XXXXXX`) \
577	&& unzip -d "$$$${INST_DIR}"  $$(gb_smoketest_instset) \
578	&& mv "$$$${INST_DIR}"/OOo_*_install-arc_$$(gb_defaultlangiso) "$$$${INST_DIR}"/opt\
579	&& mkdir -p $$(dir $$@) \
580	&& echo "$$$${INST_DIR}" > $$@
581
582endef
583else # OOO_TEST_SOFFICE
584gb_JunitTest_JunitTest_platform_longpathname_hack =
585endif # OOO_TEST_SOFFICE
586
587define gb_JunitTest_JunitTest_platform
588$(call gb_JunitTest_JunitTest_platform_longpathname_hack,$(1))
589
590$(call gb_JunitTest_get_target,$(1)) : DEFS := \
591	-Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:`cat $(call gb_JunitTest_get_target,$(1)).instpath`/opt/OpenOffice.org 3/program/soffice.exe}" \
592    -Dorg.openoffice.test.arg.env=PATH \
593    -Dorg.openoffice.test.arg.user=file:///$(call gb_JunitTest_get_userdir,$(1)) \
594
595endef
596
597
598# SdiTarget class
599
600gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
601
602# SrsPartMergeTarget
603
604gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
605
606# SrsPartTarget class
607
608gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe
609gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
610
611ifeq ($(gb_FULLDEPS),$(true))
612define gb_SrsPartTarget__command_dep
613$(call gb_Helper_abbreviate_dirs_native,\
614	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
615		$(INCLUDE) \
616		$(DEFS) \
617		$(2) \
618		-f - \
619	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
620		-v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
621		-v OUTDIR=$(OUTDIR)/ \
622		-v WORKDIR=$(WORKDIR)/ \
623		-v SRCDIR=$(SRCDIR)/ \
624		-v REPODIR=$(REPODIR)/ \
625	> $(call gb_SrsPartTarget_get_dep_target,$(1)))
626endef
627else
628gb_SrsPartTarget__command_dep =
629endif
630
631# WinResTarget class
632
633gb_WinResTarget_POSTFIX :=.res
634
635define gb_WinResTarget__command
636$(call gb_Output_announce,$(2),$(true),RES,3)
637$(call gb_Helper_abbreviate_dirs_native,\
638	mkdir -p $(dir $(1)) && \
639	$(gb_RC) \
640		$(DEFS) $(FLAGS) \
641		-I$(dir $(3)) \
642		$(INCLUDE) \
643		-fo=$(1) \
644        -r $(RCFILE) )
645endef
646
647$(eval $(call gb_Helper_make_dep_targets,\
648	WinResTarget \
649))
650
651ifeq ($(gb_FULLDEPS),$(true))
652define gb_WinResTarget__command_dep
653$(call gb_Helper_abbreviate_dirs_native,\
654	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
655		$(INCLUDE) \
656		$(DEFS) \
657		$(2) \
658		-f - \
659	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
660		-v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \
661		-v OUTDIR=$(OUTDIR)/ \
662		-v WORKDIR=$(WORKDIR)/ \
663		-v SRCDIR=$(SRCDIR)/ \
664		-v REPODIR=$(REPODIR)/ \
665	> $(call gb_WinResTarget_get_dep_target,$(1)))
666endef
667else
668gb_WinResTarget__command_dep =
669endif
670
671# ComponentTarget
672
673gb_XSLTPROCPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
674gb_Library_COMPONENTPREFIXES := \
675    OOO:vnd.sun.star.expand:\dBRAND_BASE_DIR/program/ \
676    URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
677
678# vim: set noet sw=4 ts=4:
679