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 22 23 24GUI := WNT 25COM := MSC 26 27# set tmpdir to some mixed case path, suitable for native tools 28gb_TMPDIR:=$(if $(TMPDIR),$(shell cygpath -m $(TMPDIR)),$(shell cygpath -m /tmp)) 29gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX 30 31gb_CC := cl 32gb_CXX := cl 33gb_LINK := link 34gb_AWK := awk 35gb_CLASSPATHSEP := ; 36gb_RC := rc 37 38# use CC/CXX if they are nondefaults 39ifneq ($(origin CC),default) 40gb_CC := $(CC) 41gb_GCCP := $(CC) 42endif 43ifneq ($(origin CXX),default) 44gb_CXX := $(CXX) 45endif 46 47gb_OSDEFS := \ 48 -DWINVER=0x0500 \ 49 -D_WIN32_IE=0x0500 \ 50 -DNT351 \ 51 -DWIN32 \ 52 -DWNT \ 53 54gb_COMPILERDEFS := \ 55 -DMSC \ 56 -D_CRT_NON_CONFORMING_SWPRINTFS \ 57 -D_CRT_NONSTDC_NO_DEPRECATE \ 58 -D_CRT_SECURE_NO_DEPRECATE \ 59 -D_MT \ 60 -D_DLL \ 61 -DBOOST_MEM_FN_ENABLE_CDECL \ 62 -DCPPU_ENV=$(COMNAME) \ 63 -DFULL_DESK \ 64 -DM1500 \ 65 66gb_CPUDEFS := -D$(CPUNAME) 67ifeq ($(CPUNAME),INTEL) 68gb_CPUDEFS += -D_X86_=1 69endif 70ifeq ($(CPUNAME),X86_64) 71gb_CPUDEFS += -D_AMD64_=1 72endif 73 74gb_RCDEFS := \ 75 -DWINVER=0x0400 \ 76 -DWIN32 \ 77 78gb_RCFLAGS := \ 79 -V 80 81gb_CFLAGS := \ 82 -Gd \ 83 -GR \ 84 -Gs \ 85 -GS \ 86 -nologo \ 87 -Wall \ 88 -wd4005 \ 89 -wd4061 \ 90 -wd4127 \ 91 -wd4180 \ 92 -wd4189 \ 93 -wd4191 \ 94 -wd4217 \ 95 -wd4250 \ 96 -wd4251 \ 97 -wd4255 \ 98 -wd4275 \ 99 -wd4290 \ 100 -wd4294 \ 101 -wd4350 \ 102 -wd4355 \ 103 -wd4365 \ 104 -wd4503 \ 105 -wd4505 \ 106 -wd4511 \ 107 -wd4512 \ 108 -wd4514 \ 109 -wd4611 \ 110 -wd4619 \ 111 -wd4625 \ 112 -wd4626 \ 113 -wd4640 \ 114 -wd4668 \ 115 -wd4675 \ 116 -wd4692 \ 117 -wd4710 \ 118 -wd4711 \ 119 -wd4738 \ 120 -wd4786 \ 121 -wd4800 \ 122 -wd4820 \ 123 -wd4826 \ 124 -Zc:wchar_t- \ 125 -Zm500 \ 126 127gb_CXXFLAGS := \ 128 -Gd \ 129 -GR \ 130 -Gs \ 131 -GS \ 132 -Gy \ 133 -nologo \ 134 -Wall \ 135 -wd4005 \ 136 -wd4061 \ 137 -wd4127 \ 138 -wd4180 \ 139 -wd4189 \ 140 -wd4191 \ 141 -wd4217 \ 142 -wd4250 \ 143 -wd4251 \ 144 -wd4275 \ 145 -wd4290 \ 146 -wd4294 \ 147 -wd4350 \ 148 -wd4355 \ 149 -wd4365 \ 150 -wd4503 \ 151 -wd4505 \ 152 -wd4511 \ 153 -wd4512 \ 154 -wd4514 \ 155 -wd4611 \ 156 -wd4619 \ 157 -wd4625 \ 158 -wd4626 \ 159 -wd4640 \ 160 -wd4668 \ 161 -wd4675 \ 162 -wd4692 \ 163 -wd4710 \ 164 -wd4711 \ 165 -wd4738 \ 166 -wd4786 \ 167 -wd4800 \ 168 -wd4820 \ 169 -wd4826 \ 170 -Zc:wchar_t- \ 171 -Zm500 \ 172 173gb_STDLIBS := \ 174 uwinapi \ 175 kernel32 \ 176 msvcrt \ 177 oldnames \ 178 179ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE) 180gb_CFLAGS_WERROR := -WX 181gb_CXXFLAGS_WERROR := -WX 182endif 183 184gb_LinkTarget_EXCEPTIONFLAGS := \ 185 -DEXCEPTIONS_ON \ 186 -EHa \ 187 188gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS) 189 190 191gb_LinkTarget_NOEXCEPTIONFLAGS := \ 192 -DEXCEPTIONS_OFF \ 193 194gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS := $(gb_LinkTarget_NOEXCEPTIONFLAGS) 195 196ifeq ($(CPUNAME),INTEL) 197gb_LinkTarget_LDFLAGS := \ 198 -MACHINE:IX86 \ 199 -NODEFAULTLIB \ 200 $(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \ 201 202endif 203ifeq ($(CPUNAME),X86_64) 204gb_LinkTarget_LDFLAGS := \ 205 -MACHINE:X64 \ 206 -NODEFAULTLIB \ 207 $(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \ 208 209endif 210 211gb_DEBUG_CFLAGS := -Zi 212 213ifeq ($(gb_DEBUGGING),TRUE) 214gb_LinkTarget_LDFLAGS += -DEBUG 215endif 216 217# this does not use CFLAGS so it is not overridable 218ifneq ($(ENABLE_CRASHDUMP),) 219gb_CFLAGS+=-Zi 220gb_CXXFLAGS+=-Zi 221endif 222 223ifeq ($(gb_DEBUGLEVEL),2) 224gb_COMPILEROPTFLAGS := 225else 226gb_COMPILEROPTFLAGS := -Ob1 -Oxs -Oy- 227endif 228 229gb_COMPILERNOOPTFLAGS := -Od 230 231 232# Helper class 233gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }') 234gb_Helper_WORKDIR_NATIVE := $(shell cygpath -m $(WORKDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }') 235gb_Helper_OUTDIR_NATIVE := $(shell cygpath -m $(OUTDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }') 236gb_Helper_REPODIR_NATIVE := $(shell cygpath -m $(REPODIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }') 237 238define gb_Helper_abbreviate_dirs_native 239R=$(gb_Helper_REPODIR_NATIVE) && $(subst $(REPODIR)/,$$R/,$(subst $(gb_Helper_REPODIR_NATIVE)/,$$R/,O=$(gb_Helper_OUTDIR_NATIVE) && W=$(gb_Helper_WORKDIR_NATIVE) && S=$(gb_Helper_SRCDIR_NATIVE))) && \ 240$(subst $(REPODIR)/,$$R/,$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,$(subst $(WORKDIR)/,$$W/,$(subst $(gb_Helper_REPODIR_NATIVE)/,$$R/,$(subst $(gb_Helper_SRCDIR_NATIVE)/,$$S/,$(subst $(gb_Helper_OUTDIR_NATIVE)/,$$O/,$(subst $(gb_Helper_WORKDIR_NATIVE)/,$$W/,$(1))))))))) 241endef 242 243# convert parametters filesystem root to native notation 244# does some real work only on windows, make sure not to 245# break the dummy implementations on unx* 246define gb_Helper_convert_native 247$(patsubst -I$(OUTDIR)%,-I$(gb_Helper_OUTDIR_NATIVE)%, \ 248$(patsubst $(OUTDIR)%,$(gb_Helper_OUTDIR_NATIVE)%, \ 249$(patsubst $(WORKDIR)%,$(gb_Helper_WORKDIR_NATIVE)%, \ 250$(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \ 251$(1))))) 252endef 253 254# convert parametters filesystem root to native notation 255# does some real work only on windows, make sure not to 256# break the dummy implementations on unx* 257define gb_Helper_convert_native 258$(patsubst -I$(OUTDIR)%,-I$(gb_Helper_OUTDIR_NATIVE)%, \ 259$(patsubst $(OUTDIR)%,$(gb_Helper_OUTDIR_NATIVE)%, \ 260$(patsubst $(WORKDIR)%,$(gb_Helper_WORKDIR_NATIVE)%, \ 261$(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \ 262$(1))))) 263endef 264 265 266# CObject class 267 268ifeq ($(gb_FULLDEPS),$(true)) 269define gb_Object__command_deponcompile 270$(call gb_Helper_abbreviate_dirs_native,\ 271 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 272 $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \ 273 -I$(dir $(3)) \ 274 $(filter-out -I$(COMPATH)% %/pch -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 > $(2)) 284endef 285else 286gb_Object__command_deponcompile = 287endif 288 289define gb_CObject__command 290$(call gb_Output_announce,$(2),$(true),C ,3) 291$(call gb_Helper_abbreviate_dirs_native,\ 292 mkdir -p $(dir $(1)) $(dir $(4)) && \ 293 unset INCLUDE && \ 294 $(gb_CC) \ 295 $(DEFS) \ 296 $(T_CFLAGS) \ 297 -Fd$(PDBFILE) \ 298 $(CFLAGS) \ 299 $(PCHFLAGS) \ 300 -I$(dir $(3)) \ 301 $(INCLUDE) \ 302 -c $(3) \ 303 -Fo$(1)) 304$(call gb_Object__command_deponcompile,$(1),$(4),$(3),$(DEFS),$(T_CFLAGS),$(INCLUDE)) 305endef 306 307 308# CxxObject class 309 310define gb_CxxObject__command 311$(call gb_Output_announce,$(2),$(true),CXX,3) 312$(call gb_Helper_abbreviate_dirs_native,\ 313 mkdir -p $(dir $(1)) $(dir $(4)) && \ 314 unset INCLUDE && \ 315 $(gb_CXX) \ 316 $(DEFS) \ 317 $(T_CXXFLAGS) \ 318 -Fd$(PDBFILE) \ 319 $(CXXFLAGS) \ 320 $(PCHFLAGS) \ 321 -I$(dir $(3)) \ 322 $(INCLUDE_STL) $(INCLUDE) \ 323 -c $(3) \ 324 -Fo$(1)) 325$(call gb_Object__command_deponcompile,$(1),$(4),$(3),$(DEFS),$(T_CXXFLAGS),$(INCLUDE)) 326endef 327 328 329# PrecompiledHeader class 330 331gb_PrecompiledHeader_get_enableflags = -DPRECOMPILED_HEADERS -Yu$(1).hxx \ 332 -Fp$(call gb_PrecompiledHeader_get_target,$(1)) 333 334ifeq ($(gb_FULLDEPS),$(true)) 335define gb_PrecompiledHeader__command_deponcompile 336$(call gb_Helper_abbreviate_dirs_native,\ 337 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 338 $(4) $(5) \ 339 -I$(dir $(3)) \ 340 $(filter-out -I$(COMPATH)% -I$(JAVA_HOME)%,$(6)) \ 341 $(3) \ 342 -f - \ 343 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 344 -v OBJECTFILE=$(1) \ 345 -v OUTDIR=$(OUTDIR)/ \ 346 -v WORKDIR=$(WORKDIR)/ \ 347 -v SRCDIR=$(SRCDIR)/ \ 348 -v REPODIR=$(REPODIR)/ \ 349 > $(call gb_PrecompiledHeader_get_dep_target,$(2))) 350endef 351else 352gb_PrecompiledHeader__command_deponcompile = 353endif 354 355 356define gb_PrecompiledHeader__command 357$(call gb_Output_announce,$(2),$(true),PCH,1) 358$(call gb_Helper_abbreviate_dirs_native,\ 359 mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2))) && \ 360 unset INCLUDE && \ 361 $(gb_CXX) \ 362 $(4) $(5) -Fd$(PDBFILE) \ 363 -I$(dir $(3)) \ 364 $(6) \ 365 -c $(3) \ 366 -DPRECOMPILED_HEADERS \ 367 -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj) 368$(call gb_PrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6)) 369endef 370 371# NoexPrecompiledHeader class 372 373gb_NoexPrecompiledHeader_get_enableflags = -Yu$(1).hxx \ 374 -Fp$(call gb_NoexPrecompiledHeader_get_target,$(1)) 375 376ifeq ($(gb_FULLDEPS),$(true)) 377define gb_NoexPrecompiledHeader__command_deponcompile 378$(call gb_Helper_abbreviate_dirs_native,\ 379 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 380 $(4) $(5) \ 381 -I$(dir $(3)) \ 382 $(filter-out -I$(COMPATH)% -I$(JAVA_HOME)%,$(6)) \ 383 $(3) \ 384 -f - \ 385 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 386 -v OBJECTFILE=$(1) \ 387 -v OUTDIR=$(OUTDIR)/ \ 388 -v WORKDIR=$(WORKDIR)/ \ 389 -v SRCDIR=$(SRCDIR)/ \ 390 -v REPODIR=$(REPODIR)/ \ 391 > $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) 392endef 393else 394gb_NoexPrecompiledHeader__command_deponcompile = 395endif 396 397 398define gb_NoexPrecompiledHeader__command 399$(call gb_Output_announce,$(2),$(true),PCH,1) 400$(call gb_Helper_abbreviate_dirs_native,\ 401 mkdir -p $(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) && \ 402 unset INCLUDE && \ 403 $(gb_CXX) \ 404 $(4) $(5) -Fd$(PDBFILE) \ 405 -I$(dir $(3)) \ 406 $(6) \ 407 -c $(3) \ 408 -DPRECOMPILED_HEADERS \ 409 -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj) 410$(call gb_NoexPrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6)) 411endef 412 413# LinkTarget class 414 415gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) 416gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) 417 418gb_LinkTarget_INCLUDE :=\ 419 $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \ 420 $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \ 421 422gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) 423 424gb_LinkTarget_get_pdbfile = $(call gb_LinkTarget_get_target,)pdb/$(1).pdb 425 426define gb_LinkTarget__command 427$(call gb_Output_announce,$(2),$(true),LNK,4) 428$(call gb_Helper_abbreviate_dirs_native,\ 429 mkdir -p $(dir $(1)) && \ 430 rm -f $(1) && \ 431 RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100, \ 432 $(call gb_Helper_convert_native,$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 433 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 434 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 435 $(PCHOBJS) $(NATIVERES))) && \ 436 $(gb_LINK) \ 437 $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ 438 $(if $(filter StaticLibrary,$(TARGETTYPE)),$(gb_StaticLibrary_TARGETTYPEFLAGS)) \ 439 $(if $(filter GoogleTest Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \ 440 $(if $(filter YES,$(gb_Executable_TARGETGUI)), -SUBSYSTEM:WINDOWS, -SUBSYSTEM:CONSOLE) \ 441 $(T_LDFLAGS) \ 442 @$${RESPONSEFILE} \ 443 $(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib))) \ 444 $(patsubst %,%.lib,$(EXTERNAL_LIBS)) \ 445 $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_filename,$(lib))) \ 446 $(LIBS) \ 447 $(if $(DLLTARGET),-out:$(DLLTARGET) -implib:$(1),-out:$(1)); RC=$$?; rm $${RESPONSEFILE} \ 448 $(if $(DLLTARGET),; if [ ! -f $(DLLTARGET) ]; then rm -f $(1) && false; fi) ; exit $$RC) 449endef 450 451 452# Library class 453 454gb_Library_DEFS := -D_DLL_ 455ifeq ($(CPUNAME),INTEL) 456gb_Library_TARGETTYPEFLAGS := -DLL -OPT:NOREF -SAFESEH -NXCOMPAT -DYNAMICBASE 457endif 458ifeq ($(CPUNAME),X86_64) 459gb_Library_TARGETTYPEFLAGS := -DLL -OPT:NOREF -NXCOMPAT -DYNAMICBASE 460endif 461gb_Library_get_rpath := 462 463gb_Library_SYSPRE := i 464gb_Library_PLAINEXT := .lib 465 466gb_Library_PLAINLIBS_NONE += \ 467 advapi32 \ 468 comdlg32 \ 469 d3d9 \ 470 d3dx \ 471 ddraw \ 472 gdi32 \ 473 gdiplus \ 474 glu32 \ 475 gnu_getopt \ 476 imm32\ 477 kernel32 \ 478 msimg32 \ 479 msvcrt \ 480 mpr \ 481 oldnames \ 482 ole32 \ 483 oleaut32 \ 484 opengl32 \ 485 shell32 \ 486 shlwapi \ 487 strmiids \ 488 user32 \ 489 uuid \ 490 uwinapi \ 491 winmm \ 492 winspool \ 493 ws2_32 \ 494 wsock32 495 496gb_Library_LAYER := \ 497 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ 498 $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \ 499 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \ 500 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ 501 $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \ 502 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \ 503 $(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \ 504 $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \ 505 $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \ 506 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \ 507 508gb_Library_FILENAMES :=\ 509 $(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ 510 511gb_Library_DLLEXT := .dll 512gb_Library_MAJORVER := 3 513gb_Library_RTEXT := MSC$(gb_Library_DLLEXT) 514 515ifeq ($(USE_SYSTEM_STL),YES) 516ifeq ($(gb_PRODUCT),$(true)) 517gb_Library_STLEXT := msvcprt.lib 518else 519gb_Library_STLEXT := msvcprt.lib 520endif 521else 522ifeq ($(gb_PRODUCT),$(true)) 523gb_Library_STLEXT := port_vc7145$(gb_Library_DLLEXT) 524else 525gb_Library_STLEXT := port_vc7145_stldebug$(gb_Library_DLLEXT) 526endif 527endif 528 529gb_Library_OOOEXT := $(gb_Library_DLLEXT) 530gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT) 531gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT) 532gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT) 533 534gb_Library_DLLFILENAMES :=\ 535 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \ 536 $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ 537 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ 538 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \ 539 $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \ 540 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \ 541 $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(lib)$(gb_Library_STLEXT)) \ 542 $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \ 543 $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \ 544 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \ 545 546define gb_Library_Library_platform 547$(call gb_LinkTarget_set_dlltarget,$(2),$(3)) 548 549$(call gb_LinkTarget_set_auxtargets,$(2),\ 550 $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \ 551 $(3).manifest \ 552 $(call gb_LinkTarget_get_pdbfile,$(2)) \ 553 $(patsubst %.dll,%.pdb,$(3)) \ 554 $(patsubst %.dll,%.ilk,$(3)) \ 555) 556 557$(call gb_Library_get_target,$(1)) \ 558$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3)) 559 560ifneq ($(ENABLE_CRASHDUMP),) 561$(call gb_Library_get_target,$(1)) \ 562$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += \ 563 $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))) \ 564 $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))) \ 565 566$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))),$(patsubst %.dll,%.pdb,$(3)),$(1)) 567$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))),$(patsubst %.dll,%.ilk,$(3)),$(1)) 568endif 569 570$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3),$(1)) 571 572$(call gb_LinkTarget_get_target,$(2)) \ 573$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2)) 574ifeq ($(gb_FULLDEPS),$(true)) 575$(call gb_LinkTarget_get_dep_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2)) 576endif 577endef 578 579define gb_Library_add_default_nativeres 580$(call gb_WinResTarget_WinResTarget_init,$(1)/$(2)) 581$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo) 582$(call gb_WinResTarget_set_defs,$(1)/$(2),\ 583 $$(DEFS) \ 584 -DADDITIONAL_VERINFO1 \ 585 -DADDITIONAL_VERINFO2 \ 586 -DADDITIONAL_VERINFO3 \ 587) 588$(call gb_Library_add_nativeres,$(1),$(2)) 589$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2)) 590 591endef 592 593define gb_Library_add_nativeres 594$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : $(call gb_WinResTarget_get_target,$(1)/$(2)) 595$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : NATIVERES += $(call gb_WinResTarget_get_target,$(1)/$(2)) 596 597endef 598 599define gb_Library_get_dllname 600$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES))) 601endef 602 603 604# StaticLibrary class 605 606gb_StaticLibrary_DEFS := 607gb_StaticLibrary_TARGETTYPEFLAGS := -LIB 608gb_StaticLibrary_SYSPRE := 609gb_StaticLibrary_PLAINEXT := .lib 610gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT) 611 612gb_StaticLibrary_FILENAMES := \ 613 $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \ 614 $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \ 615 616gb_StaticLibrary_FILENAMES := $(patsubst salcpprt:salcpprt%,salcpprt:cpprtl%,$(gb_StaticLibrary_FILENAMES)) 617 618define gb_StaticLibrary_StaticLibrary_platform 619$(call gb_LinkTarget_get_target,$(2)) \ 620$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2)) 621 622$(call gb_LinkTarget_set_auxtargets,$(2),\ 623 $(call gb_LinkTarget_get_pdbfile,$(2)) \ 624) 625 626endef 627 628# Executable class 629 630gb_Executable_EXT := .exe 631ifeq ($(CPUNAME),INTEL) 632gb_Executable_TARGETTYPEFLAGS := -RELEASE -BASE:0x1b000000 -OPT:NOREF -INCREMENTAL:NO -DEBUG -SAFESEH -NXCOMPAT -DYNAMICBASE 633endif 634ifeq ($(CPUNAME),X86_64) 635gb_Executable_TARGETTYPEFLAGS := -RELEASE -BASE:0x1b000000 -OPT:NOREF -INCREMENTAL:NO -DEBUG -NXCOMPAT -DYNAMICBASE 636endif 637gb_Executable_get_rpath := 638gb_Executable_TARGETGUI := 639 640define gb_Executable_Executable_platform 641$(call gb_LinkTarget_set_auxtargets,$(2),\ 642 $(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \ 643 $(call gb_LinkTarget_get_pdbfile,$(2)) \ 644 $(call gb_LinkTarget_get_target,$(2)).manifest \ 645) 646 647$(call gb_Executable_get_target,$(1)) \ 648$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Executable_get_target,$(1)).manifest 649$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)).manifest,$(call gb_LinkTarget_get_target,$(2)).manifest,$(1)) 650 651$(call gb_LinkTarget_get_target,$(2)) \ 652$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2)) 653 654endef 655 656# GoogleTest class 657 658gb_GoogleTest_GTESTPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 659gb_GoogleTest_get_filename = $(1)$(gb_Executable_EXT) 660 661define gb_GoogleTest_GoogleTest_platform 662endef 663 664# JunitTest class 665 666define gb_JunitTest_JunitTest_platform 667$(call gb_JunitTest_get_target,$(1)) : DEFS := \ 668 -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(SRCDIR)/instsetoo_native/$(INPATH)/Apache_OpenOffice/installed/install/en-US/OpenOffice 4/program/soffice.exe}" \ 669 -Dorg.openoffice.test.arg.env=PATH \ 670 -Dorg.openoffice.test.arg.user=file:///$(call gb_JunitTest_get_userdir,$(1)) \ 671 672endef 673 674 675# SdiTarget class 676 677gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 678 679# SrsPartMergeTarget 680 681gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 682 683# SrsPartTarget class 684 685gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe 686gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET) 687 688ifeq ($(gb_FULLDEPS),$(true)) 689define gb_SrsPartTarget__command_dep 690$(call gb_Helper_abbreviate_dirs_native,\ 691 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 692 $(INCLUDE) \ 693 $(DEFS) \ 694 $(2) \ 695 -f - \ 696 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 697 -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \ 698 -v OUTDIR=$(OUTDIR)/ \ 699 -v WORKDIR=$(WORKDIR)/ \ 700 -v SRCDIR=$(SRCDIR)/ \ 701 -v REPODIR=$(REPODIR)/ \ 702 > $(call gb_SrsPartTarget_get_dep_target,$(1))) 703endef 704else 705gb_SrsPartTarget__command_dep = 706endif 707 708# WinResTarget class 709 710gb_WinResTarget_POSTFIX :=.res 711 712define gb_WinResTarget__command 713$(call gb_Output_announce,$(2),$(true),RES,3) 714$(call gb_Helper_abbreviate_dirs_native,\ 715 mkdir -p $(dir $(1)) && \ 716 $(gb_RC) \ 717 $(DEFS) $(FLAGS) \ 718 -I$(dir $(3)) \ 719 $(INCLUDE) \ 720 -Fo$(1) \ 721 $(RCFILE) ) 722endef 723 724$(eval $(call gb_Helper_make_dep_targets,\ 725 WinResTarget \ 726)) 727 728ifeq ($(gb_FULLDEPS),$(true)) 729define gb_WinResTarget__command_dep 730$(call gb_Helper_abbreviate_dirs_native,\ 731 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 732 $(INCLUDE) \ 733 $(DEFS) \ 734 $(2) \ 735 -f - \ 736 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 737 -v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \ 738 -v OUTDIR=$(OUTDIR)/ \ 739 -v WORKDIR=$(WORKDIR)/ \ 740 -v SRCDIR=$(SRCDIR)/ \ 741 -v REPODIR=$(REPODIR)/ \ 742 > $(call gb_WinResTarget_get_dep_target,$(1))) 743endef 744else 745gb_WinResTarget__command_dep = 746endif 747 748# ComponentTarget 749 750gb_XSLTPROCPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 751gb_Library_COMPONENTPREFIXES := \ 752 OOO:vnd.sun.star.expand:\dOOO_BASE_DIR/program/ \ 753 URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \ 754 NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \ 755 756# UnoApiTarget 757 758gb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc.exe 759gb_UnoApiTarget_IDLCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_IDLCTARGET) 760gb_UnoApiTarget_REGMERGETARGET := $(OUTDIR)/bin/regmerge.exe 761gb_UnoApiTarget_REGMERGECOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGMERGETARGET) 762gb_UnoApiTarget_REGCOMPARETARGET := $(OUTDIR)/bin/regcompare.exe 763gb_UnoApiTarget_REGCOMPARECOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGCOMPARETARGET) 764gb_UnoApiTarget_CPPUMAKERTARGET := $(OUTDIR)/bin/cppumaker.exe 765gb_UnoApiTarget_CPPUMAKERCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_CPPUMAKERTARGET) 766gb_UnoApiTarget_REGVIEWTARGET := $(OUTDIR)/bin/regview.exe 767gb_UnoApiTarget_REGVIEWCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGVIEWTARGET) 768 769# vim: set noet sw=4 ts=4: 770