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