xref: /aoo41x/main/solenv/gbuild/platform/os2.mk (revision 828da808)
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	cppunit
394
395gb_Library_LAYER := \
396	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
397	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \
398	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
399	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
400	$(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
401	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
402	$(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \
403	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
404	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
405	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
406
407gb_Library_FILENAMES :=\
408	$(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
409
410gb_Library_DLLEXT := .dll
411gb_Library_MAJORVER :=
412gb_Library_RTEXT := $(gb_Library_DLLEXT)
413ifeq ($(gb_PRODUCT),$(true))
414gb_Library_STLEXT := stlp45$(gb_Library_DLLEXT)
415else
416gb_Library_STLEXT := stlp45_stldebug$(gb_Library_DLLEXT)
417endif
418gb_Library_OOOEXT := $(gb_Library_DLLEXT)
419gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT)
420gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT)
421gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT)
422
423gb_Library_DLLFILENAMES :=\
424	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
425	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
426	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
427	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
428	$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
429	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
430	$(foreach lib,$(gb_Library_STLLIBS),$(lib):$(lib)$(gb_Library_STLEXT)) \
431	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
432	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
433	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
434
435define gb_Library_Library_platform
436$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
437
438#$(call gb_LinkTarget_set_auxtargets,$(2),\
439	$(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
440	$(3).manifest \
441	$(call gb_LinkTarget_get_pdbfile,$(2)) \
442	$(patsubst %.dll,%.pdb,$(3)) \
443	$(patsubst %.dll,%.ilk,$(3)) \
444)
445
446$(call gb_Library_get_target,$(1)) \
447$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3))
448
449ifneq ($(ENABLE_CRASHDUMP),)
450$(call gb_Library_get_target,$(1)) \
451$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS +=  \
452		$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))) \
453		$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))) \
454
455$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))),$(patsubst %.dll,%.pdb,$(3)))
456$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))),$(patsubst %.dll,%.ilk,$(3)))
457endif
458
459$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3))
460
461$(call gb_LinkTarget_get_target,$(2)) \
462$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
463
464endef
465
466define gb_Library_add_default_nativeres_DISABLED
467$(call gb_WinResTarget_WinResTarget_init,$(1)/$(2))
468$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo)
469$(call gb_WinResTarget_set_defs,$(1)/$(2),\
470        $$(DEFS) \
471		-DADDITIONAL_VERINFO1 \
472		-DADDITIONAL_VERINFO2 \
473		-DADDITIONAL_VERINFO3 \
474)
475$(call gb_Library_add_nativeres,$(1),$(2))
476$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2))
477
478endef
479
480define gb_Library_add_nativeres
481$(info info $(1)/$(2))
482$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : $(call gb_WinResTarget_get_target,$(1)/$(2))
483$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : NATIVERES += $(call gb_WinResTarget_get_target,$(1)/$(2))
484$(info NATIVERES $(NATIVERES))
485
486endef
487
488define gb_Library_get_dllname
489$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES)))
490endef
491
492
493# StaticLibrary class
494
495gb_StaticLibrary_DEFS :=
496gb_StaticLibrary_SYSPRE :=
497gb_StaticLibrary_PLAINEXT := .lib
498gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
499
500gb_StaticLibrary_FILENAMES := \
501	$(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
502	$(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
503
504gb_StaticLibrary_StaticLibrary_platform =
505
506
507# Executable class
508
509gb_Executable_EXT := .exe
510gb_Executable_TARGETTYPEFLAGS :=
511#-RELEASE -BASE:0x1b000000 -OPT:NOREF -INCREMENTAL:NO -DEBUG
512gb_Executable_get_rpath :=
513
514define gb_Executable_Executable_platform
515#$(call gb_LinkTarget_set_auxtargets,$(2),\
516#	$(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \
517#	$(call gb_LinkTarget_get_pdbfile,$(2)) \
518#	$(call gb_LinkTarget_get_target,$(2)).manifest \
519#)
520
521#$(call gb_Executable_get_target,$(1)) \
522#$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Executable_get_target,$(1)).manifest
523#$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)).manifest,$(call gb_LinkTarget_get_target,$(2)).manifest)
524
525#$(call gb_LinkTarget_get_target,$(2)) \
526#$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
527
528endef
529
530# CppunitTest class
531
532gb_CppunitTest_CPPTESTPRECOMMAND :=
533gb_CppunitTest_SYSPRE := itest_
534gb_CppunitTest_EXT := .lib
535gb_CppunitTest_get_filename = $(gb_CppunitTest_SYSPRE)$(1)$(gb_CppunitTest_EXT)
536gb_CppunitTest_get_libfilename = test_$(1).dll
537
538define gb_CppunitTest_CppunitTest_platform
539$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
540
541#$(call gb_LinkTarget_set_auxtargets,$(2),\
542	$(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
543	$(3).manifest \
544	$(patsubst %.dll,%.pdb,$(3)) \
545	$(call gb_LinkTarget_get_pdbfile,$(2)) \
546	$(patsubst %.dll,%.ilk,$(3)) \
547)
548
549$(call gb_LinkTarget_get_target,$(2)) \
550$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
551
552endef
553
554# JunitTest class
555
556gb_defaultlangiso := en-US
557gb_smoketest_instset := $(SRCDIR)/instsetoo_native/$(INPATH)/OpenOffice/archive/install/$(gb_defaultlangiso)/OOo_*_install-arc_$(gb_defaultlangiso).zip
558
559ifeq ($(OOO_TEST_SOFFICE),)
560
561
562# Work around Windows problems with long pathnames (see issue 50885) by
563# installing into the temp directory instead of the module output tree (in which
564# case $(target).instpath contains the path to the temp installation,
565# which is removed after smoketest); can be removed once issue 50885 is fixed;
566# on other platforms, a single installation to solver is created in
567# smoketestoo_native.
568
569# for now, no dependency on $(shell ls $(gb_smoketest_instset))
570# because that doesn't work before the instset is built
571# and there is not much of a benefit anyway (gbuild not knowing about smoketest)
572define gb_JunitTest_JunitTest_platform_longpathname_hack
573$(call gb_JunitTest_get_target,$(1)) : $(call gb_JunitTest_get_target,$(1)).instpath
574$(call gb_JunitTest_get_target,$(1)) : CLEAN_CMD = $(call gb_Helper_abbreviate_dirs,rm -rf `cat $$@.instpath` $$@.instpath)
575
576$(call gb_JunitTest_get_target,$(1)).instpath :
577	INST_DIR=$$$$(cygpath -m `mktemp -d -t testinst.XXXXXX`) \
578	&& unzip -d "$$$${INST_DIR}"  $$(gb_smoketest_instset) \
579	&& mv "$$$${INST_DIR}"/OOo_*_install-arc_$$(gb_defaultlangiso) "$$$${INST_DIR}"/opt\
580	&& mkdir -p $$(dir $$@) \
581	&& echo "$$$${INST_DIR}" > $$@
582
583endef
584else # OOO_TEST_SOFFICE
585gb_JunitTest_JunitTest_platform_longpathname_hack =
586endif # OOO_TEST_SOFFICE
587
588define gb_JunitTest_JunitTest_platform
589$(call gb_JunitTest_JunitTest_platform_longpathname_hack,$(1))
590
591$(call gb_JunitTest_get_target,$(1)) : DEFS := \
592	-Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:`cat $(call gb_JunitTest_get_target,$(1)).instpath`/opt/OpenOffice.org 3/program/soffice.exe}" \
593    -Dorg.openoffice.test.arg.env=PATH \
594    -Dorg.openoffice.test.arg.user=file:///$(call gb_JunitTest_get_userdir,$(1)) \
595
596endef
597
598
599# SdiTarget class
600
601gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
602
603# SrsPartMergeTarget
604
605gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
606
607# SrsPartTarget class
608
609gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe
610gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
611
612ifeq ($(gb_FULLDEPS),$(true))
613define gb_SrsPartTarget__command_dep
614$(call gb_Helper_abbreviate_dirs_native,\
615	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
616		$(INCLUDE) \
617		$(DEFS) \
618		$(2) \
619		-f - \
620	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
621		-v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
622		-v OUTDIR=$(OUTDIR)/ \
623		-v WORKDIR=$(WORKDIR)/ \
624		-v SRCDIR=$(SRCDIR)/ \
625		-v REPODIR=$(REPODIR)/ \
626	> $(call gb_SrsPartTarget_get_dep_target,$(1)))
627endef
628else
629gb_SrsPartTarget__command_dep =
630endif
631
632# WinResTarget class
633
634gb_WinResTarget_POSTFIX :=.res
635
636define gb_WinResTarget__command
637$(call gb_Output_announce,$(2),$(true),RES,3)
638$(call gb_Helper_abbreviate_dirs_native,\
639	mkdir -p $(dir $(1)) && \
640	$(gb_RC) \
641		$(DEFS) $(FLAGS) \
642		-I$(dir $(3)) \
643		$(INCLUDE) \
644		-fo=$(1) \
645        -r $(RCFILE) )
646endef
647
648$(eval $(call gb_Helper_make_dep_targets,\
649	WinResTarget \
650))
651
652ifeq ($(gb_FULLDEPS),$(true))
653define gb_WinResTarget__command_dep
654$(call gb_Helper_abbreviate_dirs_native,\
655	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
656		$(INCLUDE) \
657		$(DEFS) \
658		$(2) \
659		-f - \
660	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
661		-v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \
662		-v OUTDIR=$(OUTDIR)/ \
663		-v WORKDIR=$(WORKDIR)/ \
664		-v SRCDIR=$(SRCDIR)/ \
665		-v REPODIR=$(REPODIR)/ \
666	> $(call gb_WinResTarget_get_dep_target,$(1)))
667endef
668else
669gb_WinResTarget__command_dep =
670endif
671
672# ComponentTarget
673
674gb_XSLTPROCPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
675gb_Library_COMPONENTPREFIXES := \
676    OOO:vnd.sun.star.expand:\dBRAND_BASE_DIR/program/ \
677    URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
678
679# vim: set noet sw=4 ts=4:
680