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