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