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