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