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