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