xref: /aoo42x/main/solenv/gbuild/platform/os2.mk (revision cde270a3)
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	$(if $(DLLTARGET), echo EXPORTS >> $(DLLDEF) &&) \
321	$(if $(DLLTARGET), emxexp @$${RESPONSEFILE} | fix_exp_file | sort | uniq | fix_def_ord >> $(DLLDEF) &&) \
322	$(gb_LINK) \
323		$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
324		$(if $(filter StaticLibrary,$(TARGETTYPE)),$(gb_StaticLibrary_TARGETTYPEFLAGS)) \
325		$(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
326		$(LDFLAGS) \
327		@$${RESPONSEFILE} \
328		$(if $(DLLTARGET), $(DLLDEF)) \
329		$(NATIVERES) \
330		$(patsubst %.lib,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \
331		$(patsubst %,-l%,$(EXTERNAL_LIBS)) \
332		$(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \
333		$(if $(DLLTARGET),-o $(DLLTARGET), -o $(1) ); \
334		RC=$$?; rm $${RESPONSEFILE} \
335	$(if $(DLLTARGET),; emximp -p2048 -o $(1) $(DLLDEF) ) \
336	$(if $(DLLTARGET),; if [ ! -f $(DLLTARGET) ]; then rm -f $(1) && false; fi) ; exit $$RC)
337endef
338
339
340define gb_LinkTarget__command_staticlinklibrary
341$(call gb_Helper_abbreviate_dirs_native,\
342	mkdir -p $(dir $(1)) && \
343	RESPONSEFILE=`$(gb_MKTEMP)` && \
344	echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
345		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
346		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) " > $${RESPONSEFILE} && \
347	$(gb_AR) cru\
348		$(1) \
349		@$${RESPONSEFILE})
350endef
351
352define gb_LinkTarget__command
353$(call gb_Output_announce,$(2),$(true),LNK,4)
354$(if $(filter Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinkexecutable,$(1),$(2)))
355$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinkexecutable,$(1),$(2)))
356$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlinklibrary,$(1)))
357endef
358
359
360# Library class
361
362gb_Library_DEFS := -D_DLL
363gb_Library_TARGETTYPEFLAGS := -Zdll
364gb_Library_get_rpath :=
365
366gb_Library_SYSPRE :=
367gb_Library_PLAINEXT := .lib
368
369gb_Library_PLAINLIBS_NONE += \
370	stdc++ \
371	ft2lib \
372	dl \
373	freetype \
374	jpeg \
375	m \
376	z \
377	pthread \
378	cppunit
379
380gb_Library_LAYER := \
381	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
382	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \
383	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
384	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
385	$(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
386	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
387	$(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \
388	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
389	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
390	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
391
392gb_Library_FILENAMES :=\
393	$(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT))
394
395
396gb_Library_DLLEXT := .dll
397gb_Library_MAJORVER :=
398gb_Library_RTEXT := $(gb_Library_DLLEXT)
399ifeq ($(gb_PRODUCT),$(true))
400gb_Library_STLEXT := stdc++$(gb_Library_DLLEXT)
401else
402gb_Library_STLEXT := stlp45_stldebug$(gb_Library_DLLEXT)
403endif
404gb_Library_OOOEXT := $(gb_Library_DLLEXT)
405gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT)
406gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT)
407gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT)
408
409gb_Library_DLLFILENAMES :=\
410	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
411	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
412	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
413	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
414	$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
415	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
416	$(foreach lib,$(gb_Library_STLLIBS),$(lib):$(lib)$(gb_Library_STLEXT)) \
417	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
418	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
419	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
420
421define gb_Library_Library_platform
422$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
423
424#$(call gb_LinkTarget_set_auxtargets,$(2),\
425	$(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
426	$(3).manifest \
427	$(call gb_LinkTarget_get_pdbfile,$(2)) \
428	$(patsubst %.dll,%.pdb,$(3)) \
429	$(patsubst %.dll,%.ilk,$(3)) \
430)
431
432$(call gb_Library_get_target,$(1)) \
433$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3))
434
435ifneq ($(ENABLE_CRASHDUMP),)
436$(call gb_Library_get_target,$(1)) \
437$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS +=  \
438		$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))) \
439		$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))) \
440
441$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))),$(patsubst %.dll,%.pdb,$(3)))
442$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))),$(patsubst %.dll,%.ilk,$(3)))
443endif
444
445$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3))
446
447$(call gb_LinkTarget_get_target,$(2)) \
448$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
449
450endef
451
452define gb_Library_add_default_nativeres_DISABLED
453$(call gb_WinResTarget_WinResTarget_init,$(1)/$(2))
454$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo)
455$(call gb_WinResTarget_set_defs,$(1)/$(2),\
456        $$(DEFS) \
457		-DADDITIONAL_VERINFO1 \
458		-DADDITIONAL_VERINFO2 \
459		-DADDITIONAL_VERINFO3 \
460)
461$(call gb_Library_add_nativeres,$(1),$(2))
462$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2))
463
464endef
465
466define gb_Library_add_nativeres
467$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : $(call gb_WinResTarget_get_target,$(1)/$(2))
468$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : NATIVERES += $(call gb_WinResTarget_get_target,$(1)/$(2))
469
470endef
471
472define gb_Library_get_dllname
473$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES)))
474endef
475
476
477# StaticLibrary class
478
479gb_StaticLibrary_DEFS :=
480gb_StaticLibrary_SYSPRE :=
481gb_StaticLibrary_PLAINEXT := .lib
482gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
483
484gb_StaticLibrary_FILENAMES := \
485	$(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
486	$(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
487
488gb_StaticLibrary_StaticLibrary_platform =
489
490
491# Executable class
492
493gb_Executable_EXT := .exe
494gb_Executable_TARGETTYPEFLAGS :=
495#-RELEASE -BASE:0x1b000000 -OPT:NOREF -INCREMENTAL:NO -DEBUG
496gb_Executable_get_rpath :=
497
498define gb_Executable_Executable_platform
499#$(call gb_LinkTarget_set_auxtargets,$(2),\
500#	$(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \
501#	$(call gb_LinkTarget_get_pdbfile,$(2)) \
502#	$(call gb_LinkTarget_get_target,$(2)).manifest \
503#)
504
505#$(call gb_Executable_get_target,$(1)) \
506#$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Executable_get_target,$(1)).manifest
507#$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)).manifest,$(call gb_LinkTarget_get_target,$(2)).manifest)
508
509#$(call gb_LinkTarget_get_target,$(2)) \
510#$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
511
512endef
513
514# CppunitTest class
515
516gb_CppunitTest_CPPTESTPRECOMMAND :=
517gb_CppunitTest_SYSPRE := itest_
518gb_CppunitTest_EXT := .lib
519gb_CppunitTest_get_filename = $(gb_CppunitTest_SYSPRE)$(1)$(gb_CppunitTest_EXT)
520gb_CppunitTest_get_libfilename = test_$(1).dll
521
522define gb_CppunitTest_CppunitTest_platform
523$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
524
525#$(call gb_LinkTarget_set_auxtargets,$(2),\
526	$(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
527	$(3).manifest \
528	$(patsubst %.dll,%.pdb,$(3)) \
529	$(call gb_LinkTarget_get_pdbfile,$(2)) \
530	$(patsubst %.dll,%.ilk,$(3)) \
531)
532
533$(call gb_LinkTarget_get_target,$(2)) \
534$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
535
536endef
537
538# JunitTest class
539
540gb_defaultlangiso := en-US
541gb_smoketest_instset := $(SRCDIR)/instsetoo_native/$(INPATH)/OpenOffice/archive/install/$(gb_defaultlangiso)/OOo_*_install-arc_$(gb_defaultlangiso).zip
542
543ifeq ($(OOO_TEST_SOFFICE),)
544
545
546# Work around Windows problems with long pathnames (see issue 50885) by
547# installing into the temp directory instead of the module output tree (in which
548# case $(target).instpath contains the path to the temp installation,
549# which is removed after smoketest); can be removed once issue 50885 is fixed;
550# on other platforms, a single installation to solver is created in
551# smoketestoo_native.
552
553# for now, no dependency on $(shell ls $(gb_smoketest_instset))
554# because that doesn't work before the instset is built
555# and there is not much of a benefit anyway (gbuild not knowing about smoketest)
556define gb_JunitTest_JunitTest_platform_longpathname_hack
557$(call gb_JunitTest_get_target,$(1)) : $(call gb_JunitTest_get_target,$(1)).instpath
558$(call gb_JunitTest_get_target,$(1)) : CLEAN_CMD = $(call gb_Helper_abbreviate_dirs,rm -rf `cat $$@.instpath` $$@.instpath)
559
560$(call gb_JunitTest_get_target,$(1)).instpath :
561	INST_DIR=$$$$(cygpath -m `mktemp -d -t testinst.XXXXXX`) \
562	&& unzip -d "$$$${INST_DIR}"  $$(gb_smoketest_instset) \
563	&& mv "$$$${INST_DIR}"/OOo_*_install-arc_$$(gb_defaultlangiso) "$$$${INST_DIR}"/opt\
564	&& mkdir -p $$(dir $$@) \
565	&& echo "$$$${INST_DIR}" > $$@
566
567endef
568else # OOO_TEST_SOFFICE
569gb_JunitTest_JunitTest_platform_longpathname_hack =
570endif # OOO_TEST_SOFFICE
571
572define gb_JunitTest_JunitTest_platform
573$(call gb_JunitTest_JunitTest_platform_longpathname_hack,$(1))
574
575$(call gb_JunitTest_get_target,$(1)) : DEFS := \
576	-Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:`cat $(call gb_JunitTest_get_target,$(1)).instpath`/opt/OpenOffice.org 3/program/soffice.exe}" \
577    -Dorg.openoffice.test.arg.env=PATH \
578    -Dorg.openoffice.test.arg.user=file:///$(call gb_JunitTest_get_userdir,$(1)) \
579
580endef
581
582
583# SdiTarget class
584
585gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
586
587# SrsPartMergeTarget
588
589gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
590
591# SrsPartTarget class
592
593gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe
594gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
595
596ifeq ($(gb_FULLDEPS),$(true))
597define gb_SrsPartTarget__command_dep
598$(call gb_Helper_abbreviate_dirs_native,\
599	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
600		$(INCLUDE) \
601		$(DEFS) \
602		$(2) \
603		-f - \
604	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
605		-v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
606		-v OUTDIR=$(OUTDIR)/ \
607		-v WORKDIR=$(WORKDIR)/ \
608		-v SRCDIR=$(SRCDIR)/ \
609		-v REPODIR=$(REPODIR)/ \
610	> $(call gb_SrsPartTarget_get_dep_target,$(1)))
611endef
612else
613gb_SrsPartTarget__command_dep =
614endif
615
616# WinResTarget class
617
618gb_WinResTarget_POSTFIX :=.res
619
620define gb_WinResTarget__command
621$(call gb_Output_announce,$(2),$(true),RES,3)
622$(call gb_Helper_abbreviate_dirs_native,\
623	mkdir -p $(dir $(1)) && \
624	$(gb_RC) \
625		$(DEFS) $(FLAGS) \
626		-I$(dir $(3)) \
627		$(INCLUDE) \
628		-fo=$(1) \
629        -r $(RCFILE) )
630endef
631
632$(eval $(call gb_Helper_make_dep_targets,\
633	WinResTarget \
634))
635
636ifeq ($(gb_FULLDEPS),$(true))
637define gb_WinResTarget__command_dep
638$(call gb_Helper_abbreviate_dirs_native,\
639	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
640		$(INCLUDE) \
641		$(DEFS) \
642		$(2) \
643		-f - \
644	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
645		-v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \
646		-v OUTDIR=$(OUTDIR)/ \
647		-v WORKDIR=$(WORKDIR)/ \
648		-v SRCDIR=$(SRCDIR)/ \
649		-v REPODIR=$(REPODIR)/ \
650	> $(call gb_WinResTarget_get_dep_target,$(1)))
651endef
652else
653gb_WinResTarget__command_dep =
654endif
655
656# ComponentTarget
657
658gb_XSLTPROCPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
659gb_Library_COMPONENTPREFIXES := \
660    OOO:vnd.sun.star.expand:\dBRAND_BASE_DIR/program/ \
661    URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
662
663# vim: set noet sw=4 ts=4:
664