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