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