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