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