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 := GCC 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 := $(CC) 32gb_CXX := $(CXX) 33gb_LINK := $(shell $(CC) -print-prog-name=ld) 34gb_AR := $(shell $(CC) -print-prog-name=ar) 35gb_AWK := awk 36gb_RC := rc 37ifeq ($(USE_MINGW),cygwin) 38gb_MINGWLIBDIR := $(COMPATH)/lib/mingw 39else 40ifeq ($(USE_MINGW),cygwin-w64-mingw32) 41gb_MINGWLIBDIR := $(COMPATH)/usr/i686-w64-mingw32/sys-root/mingw/lib 42else 43gb_MINGWLIBDIR := $(COMPATH)/lib 44endif 45endif 46ifeq ($(MINGW_SHARED_GXXLIB),YES) 47gb_MINGW_LIBSTDCPP := $(subst -l,,$(MINGW_SHARED_LIBSTDCPP)) 48else 49gb_MINGW_LIBSTDCPP := \ 50 stdc++ \ 51 moldname 52endif 53ifeq ($(MINGW_SHARED_GCCLIB),YES) 54gb_MINGW_LIBGCC := \ 55 gcc_s \ 56 gcc 57else 58ifeq ($(MINGW_GCCLIB_EH),YES) 59gb_MINGW_LIBGCC := \ 60 gcc \ 61 gcc_eh 62else 63gb_MINGW_LIBGCC := gcc 64endif 65endif 66 67gb_OSDEFS := \ 68 -DWINVER=0x0500 \ 69 -D_WIN32_IE=0x0500 \ 70 -D_WIN32_WINNT=0x0600 \ 71 -DNT351 \ 72 -DWIN32 \ 73 -DWNT \ 74 75ifeq ($(GXX_INCLUDE_PATH),) 76GXX_INCLUDE_PATH=$(COMPATH)/include/c++/$(shell gcc -dumpversion) 77endif 78 79gb_COMPILERDEFS := \ 80 -DGCC \ 81 -D$(CVER) \ 82 -DCVER=$(CVER) \ 83 -DGLIBC=2 \ 84 -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \ 85 -DCPPU_ENV=gcc3 \ 86 -D_MT \ 87 -D_NATIVE_WCHAR_T_DEFINED \ 88 -D_MSC_EXTENSIONS \ 89 -D_FORCENAMELESSUNION \ 90 91ifeq ($(USE_MINGW),cygwin-w64-mingw32) 92gb_COMPILERDEFS +=-D_declspec=__declspec 93endif 94 95gb_CPUDEFS := \ 96 -DINTEL \ 97 -D_M_IX86 \ 98 99gb_RCDEFS := \ 100 -DWIN32 \ 101 -D__GNUC__ \ 102 103gb_RCFLAGS := \ 104 -V 105 106gb_CFLAGS := \ 107 -Wall \ 108 -Wendif-labels \ 109 -Wextra \ 110 -fmessage-length=0 \ 111 -fno-strict-aliasing \ 112 -pipe \ 113 -nostdinc \ 114 115gb_CXXFLAGS := \ 116 -Wall \ 117 -Wendif-labels \ 118 -Wextra \ 119 -Wno-ctor-dtor-privacy \ 120 -Wno-non-virtual-dtor \ 121 -Wreturn-type \ 122 -Wshadow \ 123 -Wuninitialized \ 124 -fmessage-length=0 \ 125 -fno-strict-aliasing \ 126 -fno-use-cxa-atexit \ 127 -pipe \ 128 -nostdinc \ 129 130ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE) 131gb_CFLAGS_WERROR := -Werror 132gb_CXXFLAGS_WERROR := -Werror 133endif 134 135ifneq ($(SYSBASE),) 136gb_CXXFLAGS += --sysroot=$(SYSBASE) 137gb_CFLAGS += --sysroot=$(SYSBASE) 138endif 139gb_LinkTarget_EXCEPTIONFLAGS := \ 140 -DEXCEPTIONS_ON \ 141 -fexceptions \ 142 -fno-enforce-eh-specs \ 143 144gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS) 145 146 147gb_LinkTarget_NOEXCEPTIONFLAGS := \ 148 -DEXCEPTIONS_OFF \ 149 -fno-exceptions \ 150 151gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS := $(gb_LinkTarget_NOEXCEPTIONFLAGS) 152 153gb_LinkTarget_LDFLAGS := \ 154 --export-all-symbols \ 155 --kill-at \ 156 --exclude-libs ALL \ 157 --enable-stdcall-fixup \ 158 --enable-runtime-pseudo-reloc-v2 \ 159 -L$(gb_Library_DLLDIR) \ 160 $(patsubst %,-L%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \ 161 162ifeq ($(MINGW_GCCLIB_EH),YES) 163gb_LinkTarget_LDFLAGS += -shared-libgcc 164endif 165 166gb_DEBUG_CFLAGS := -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline 167 168ifeq ($(gb_DEBUGLEVEL),2) 169gb_COMPILEROPTFLAGS := -O0 170else 171gb_COMPILEROPTFLAGS := -Os 172endif 173 174gb_COMPILERNOOPTFLAGS := -O0 175 176gb_STDLIBS := \ 177 mingwthrd \ 178 $(gb_MINGW_LIBSTDCPP) \ 179 mingw32 \ 180 $(gb_MINGW_LIBGCC) \ 181 uwinapi \ 182 moldname \ 183 mingwex \ 184 kernel32 \ 185 msvcrt \ 186 187 188# Helper class 189 190gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }') 191gb_Helper_WORKDIR_NATIVE := $(shell cygpath -m $(WORKDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }') 192gb_Helper_OUTDIR_NATIVE := $(shell cygpath -m $(OUTDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }') 193gb_Helper_REPODIR_NATIVE := $(shell cygpath -m $(REPODIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }') 194 195define gb_Helper_abbreviate_dirs_native 196R=$(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))) && \ 197$(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))))))))) 198endef 199 200# convert parametters filesystem root to native notation 201# does some real work only on windows, make sure not to 202# break the dummy implementations on unx* 203define gb_Helper_convert_native 204$(patsubst -I$(OUTDIR)%,-I$(gb_Helper_OUTDIR_NATIVE)%, \ 205$(patsubst $(OUTDIR)%,$(gb_Helper_OUTDIR_NATIVE)%, \ 206$(patsubst $(WORKDIR)%,$(gb_Helper_WORKDIR_NATIVE)%, \ 207$(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \ 208$(1))))) 209endef 210 211# convert parametters filesystem root to native notation 212# does some real work only on windows, make sure not to 213# break the dummy implementations on unx* 214define gb_Helper_convert_native 215$(patsubst -I$(OUTDIR)%,-I$(gb_Helper_OUTDIR_NATIVE)%, \ 216$(patsubst $(OUTDIR)%,$(gb_Helper_OUTDIR_NATIVE)%, \ 217$(patsubst $(WORKDIR)%,$(gb_Helper_WORKDIR_NATIVE)%, \ 218$(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \ 219$(1))))) 220endef 221 222# CObject class 223 224ifeq ($(gb_FULLDEPS),$(true)) 225define gb_Object__command_deponcompile 226$(call gb_Helper_abbreviate_dirs_native,\ 227 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 228 $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \ 229 -I$(dir $(3)) \ 230 $(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \ 231 $(3) \ 232 -f - \ 233 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 234 -v OBJECTFILE=$(1) \ 235 -v OUTDIR=$(OUTDIR)/ \ 236 -v WORKDIR=$(WORKDIR)/ \ 237 -v SRCDIR=$(SRCDIR)/ \ 238 -v REPODIR=$(REPODIR)/ \ 239 > $(2)) 240endef 241else 242gb_Object__command_deponcompile = 243endif 244 245define gb_CObject__command 246$(call gb_Output_announce,$(2),$(true),C ,3) 247$(call gb_Helper_abbreviate_dirs_native,\ 248 mkdir -p $(dir $(1)) && \ 249 $(gb_CC) \ 250 $(DEFS) \ 251 $(T_CFLAGS) \ 252 -c $(3) \ 253 -o $(1) \ 254 -I$(dir $(3)) \ 255 $(INCLUDE)) 256$(call gb_Object__command_deponcompile,$(1),$(4),$(3),$(DEFS),$(T_CFLAGS),$(INCLUDE)) 257endef 258 259 260 261# CxxObject class 262 263define gb_CxxObject__command 264$(call gb_Output_announce,$(2),$(true),CXX,3) 265$(call gb_Helper_abbreviate_dirs_native,\ 266 mkdir -p $(dir $(1)) && \ 267 $(gb_CXX) \ 268 $(DEFS) \ 269 $(T_CXXFLAGS) \ 270 -c $(3) \ 271 -o $(1) \ 272 -I$(dir $(3)) \ 273 $(INCLUDE_STL) $(INCLUDE)) 274$(call gb_Object__command_deponcompile,$(1),$(4),$(3),$(DEFS),$(T_CXXFLAGS),$(INCLUDE_STL) $(INCLUDE)) 275endef 276 277 278# PrecompiledHeader class 279 280gb_PrecompiledHeader_EXT := .gch 281 282gb_PrecompiledHeader_get_enableflags = -I$(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR) \ 283 -DPRECOMPILED_HEADERS \ 284 -Winvalid-pch \ 285 286ifeq ($(gb_FULLDEPS),$(true)) 287define gb_PrecompiledHeader__command_deponcompile 288$(call gb_Helper_abbreviate_dirs_native,\ 289 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 290 $(4) $(5) \ 291 -I$(dir $(3)) \ 292 $(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \ 293 $(3) \ 294 -f - \ 295 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 296 -v OBJECTFILE=$(1) \ 297 -v OUTDIR=$(OUTDIR)/ \ 298 -v WORKDIR=$(WORKDIR)/ \ 299 -v SRCDIR=$(SRCDIR)/ \ 300 -v REPODIR=$(REPODIR)/ \ 301 > $(call gb_PrecompiledHeader_get_dep_target,$(2))) 302endef 303else 304gb_PrecompiledHeader__command_deponcompile = 305endif 306 307define gb_PrecompiledHeader__command 308$(call gb_Output_announce,$(2),$(true),PCH,1) 309$(call gb_Helper_abbreviate_dirs_native,\ 310 mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2))) && \ 311 $(gb_CXX) \ 312 -x c++-header \ 313 $(4) $(5) \ 314 -I$(dir $(3)) \ 315 -DPRECOMPILED_HEADERS \ 316 $(6) \ 317 -c $(3) \ 318 -o$(1)) 319$(call gb_PrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6)) 320 321endef 322 323# NoexPrecompiledHeader class 324 325gb_NoexPrecompiledHeader_EXT := .gch 326 327gb_NoexPrecompiledHeader_get_enableflags = -I$(WORKDIR)/NoexPrecompiledHeader/$(gb_NoexPrecompiledHeader_DEBUGDIR) \ 328 -Winvalid-pch \ 329 330ifeq ($(gb_FULLDEPS),$(true)) 331define gb_NoexPrecompiledHeader__command_deponcompile 332$(call gb_Helper_abbreviate_dirs_native,\ 333 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 334 $(4) $(5) \ 335 -I$(dir $(3)) \ 336 $(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \ 337 $(3) \ 338 -f - \ 339 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 340 -v OBJECTFILE=$(1) \ 341 -v OUTDIR=$(OUTDIR)/ \ 342 -v WORKDIR=$(WORKDIR)/ \ 343 -v SRCDIR=$(SRCDIR)/ \ 344 -v REPODIR=$(REPODIR)/ \ 345 > $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) 346endef 347else 348gb_NoexPrecompiledHeader__command_deponcompile = 349endif 350 351define gb_NoexPrecompiledHeader__command 352$(call gb_Output_announce,$(2),$(true),PCH,1) 353$(call gb_Helper_abbreviate_dirs_native,\ 354 mkdir -p $(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) && \ 355 $(gb_CXX) \ 356 -x c++-header \ 357 $(4) $(5) \ 358 -I$(dir $(3)) \ 359 -DPRECOMPILED_HEADERS \ 360 $(6) \ 361 -c $(3) \ 362 -o$(1)) 363$(call gb_NoexPrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6)) 364 365endef 366 367 368# LinkTarget class 369 370gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) 371gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) 372 373gb_LinkTarget_INCLUDE :=\ 374 $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \ 375 $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \ 376 377gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) 378 379define gb_LinkTarget__command_dynamiclinkexecutable 380$(call gb_Output_announce,$(2),$(true),LNK,4) 381$(call gb_Helper_abbreviate_dirs_native,\ 382 mkdir -p $(dir $(1)) && \ 383 RESPONSEFILE=`$(gb_MKTEMP)` && \ 384 echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 385 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 386 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 387 $(NATIVERES) " > $${RESPONSEFILE} && \ 388 $(gb_LINK) \ 389 $(gb_Executable_TARGETTYPEFLAGS) \ 390 $(if $(filter YES,$(gb_Executable_TARGETGUI)), --subsystem windows, --subsystem console) \ 391 $(T_LDFLAGS) \ 392 $(gb_MINGWLIBDIR)/crt2.o \ 393 $(MINGW_CLIB_DIR)/crtbegin.o \ 394 @$${RESPONSEFILE} \ 395 --start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \ 396 --start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \ 397 --start-group $(patsubst %,-l%,$(EXTERNAL_LIBS)) --end-group \ 398 $(LIBS) \ 399 $(MINGW_CLIB_DIR)/crtend.o \ 400 -Map $(basename $(1)).map \ 401 -o $(1)) 402endef 403 404define gb_LinkTarget__command_dynamiclinklibrary 405$(call gb_Helper_abbreviate_dirs_native,\ 406 mkdir -p $(dir $(1)) && \ 407 rm -f $(1) && \ 408 RESPONSEFILE=`$(gb_MKTEMP)` && \ 409 echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 410 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 411 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 412 $(NATIVERES) " > $${RESPONSEFILE} && \ 413 $(gb_LINK) \ 414 $(gb_Library_TARGETTYPEFLAGS) \ 415 $(T_LDFLAGS) \ 416 --enable-auto-image-base \ 417 -e _DllMainCRTStartup@12 \ 418 $(gb_MINGWLIBDIR)/dllcrt2.o \ 419 $(MINGW_CLIB_DIR)/crtbegin.o \ 420 @$${RESPONSEFILE} \ 421 --start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \ 422 --start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \ 423 $(LIBS) \ 424 $(MINGW_CLIB_DIR)/crtend.o \ 425 -Map $(basename $(DLLTARGET)).map \ 426 -o $(DLLTARGET) && touch $(1)) 427endef 428 429define gb_LinkTarget__command_staticlinklibrary 430$(call gb_Helper_abbreviate_dirs_native,\ 431 mkdir -p $(dir $(1)) && \ 432 RESPONSEFILE=`$(gb_MKTEMP)` && \ 433 echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 434 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 435 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) " > $${RESPONSEFILE} && \ 436 $(gb_AR) -rsu\ 437 $(1) \ 438 @$${RESPONSEFILE}) 439endef 440 441define gb_LinkTarget__command 442$(call gb_Output_announce,$(2),$(true),LNK,4) 443$(if $(filter GoogleTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinkexecutable,$(1),$(2))) 444$(if $(filter Library,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinklibrary,$(1),$(2))) 445$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlinklibrary,$(1))) 446endef 447 448 449# Library class 450 451gb_Library_DEFS := -D_DLL_ 452gb_Library_TARGETTYPEFLAGS := -shared 453gb_Library_get_rpath := 454 455gb_Library_SYSPRE := i 456gb_Library_PLAINEXT := .lib 457 458gb_Library_PLAINLIBS_NONE += \ 459 mingwthrd \ 460 mingw32 \ 461 mingwex \ 462 $(gb_MINGW_LIBSTDCPP) \ 463 $(gb_MINGW_LIBGCC) \ 464 advapi32 \ 465 comdlg32 \ 466 d3d9 \ 467 d3dx \ 468 ddraw \ 469 gdi32 \ 470 gdiplus \ 471 glu32 \ 472 gnu_getopt \ 473 imm32\ 474 kernel32 \ 475 msimg32 \ 476 msvcrt \ 477 mpr \ 478 moldname \ 479 ole32 \ 480 oleaut32 \ 481 opengl32 \ 482 shell32 \ 483 strmiids \ 484 user32 \ 485 uuid \ 486 uwinapi \ 487 winmm \ 488 winspool 489 490gb_Library_LAYER := \ 491 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ 492 $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \ 493 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \ 494 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ 495 $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \ 496 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \ 497 $(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \ 498 $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \ 499 $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \ 500 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \ 501 502gb_Library_FILENAMES :=\ 503 $(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ 504 505gb_Library_DLLEXT := .dll 506gb_Library_MAJORVER := 3 507gb_Library_RTEXT := gcc3$(gb_Library_DLLEXT) 508ifeq ($(gb_PRODUCT),$(true)) 509gb_Library_STLEXT := port_gcc$(gb_Library_DLLEXT) 510else 511gb_Library_STLEXT := port_gcc_stldebug$(gb_Library_DLLEXT) 512endif 513gb_Library_OOOEXT := $(gb_Library_DLLEXT) 514gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT) 515gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT) 516gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT) 517 518gb_Library_DLLFILENAMES := \ 519 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \ 520 $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ 521 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ 522 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \ 523 $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \ 524 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \ 525 $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \ 526 $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \ 527 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \ 528 529gb_Library_IARCSYSPRE := lib 530gb_Library_IARCEXT := .a 531 532gb_Library_ILIBEXT := .lib 533 534define gb_Library_Library_platform 535$(call gb_LinkTarget_set_dlltarget,$(2),$(3)) 536 537$(call gb_LinkTarget_set_auxtargets,$(2),\ 538 $(patsubst %.dll,%.map,$(3)) \ 539) 540 541$(call gb_Library_get_target,$(1)) \ 542$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3)) 543 544$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3),$(1)) 545 546endef 547 548define gb_Library_add_default_nativeres 549$(call gb_WinResTarget_WinResTarget_init,$(1)/$(2)) 550$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo) 551$(call gb_WinResTarget_set_defs,$(1)/$(2),\ 552 $$(DEFS) \ 553 -DADDITIONAL_VERINFO1= \ 554 -DADDITIONAL_VERINFO2= \ 555 -DADDITIONAL_VERINFO3= \ 556) 557$(call gb_Library_add_nativeres,$(1),$(2)) 558$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2)) 559 560endef 561 562define gb_Library_add_nativeres 563$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : $(call gb_WinResTarget_get_target,$(1)/$(2)) 564$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : NATIVERES += $(call gb_WinResTarget_get_target,$(1)/$(2)) 565 566endef 567 568define gb_Library_get_dllname 569$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES))) 570endef 571 572 573# StaticLibrary class 574 575gb_StaticLibrary_DEFS := 576gb_StaticLibrary_SYSPRE := lib 577gb_StaticLibrary_PLAINEXT := .a 578gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT) 579 580gb_StaticLibrary_FILENAMES := \ 581 $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \ 582 $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \ 583 584gb_StaticLibrary_FILENAMES := $(patsubst salcpprt:salcpprt%,salcpprt:cpprtl%,$(gb_StaticLibrary_FILENAMES)) 585 586gb_StaticLibrary_StaticLibrary_platform = 587 588# Executable class 589 590gb_Executable_EXT := .exe 591gb_Executable_TARGETTYPEFLAGS := 592gb_Executable_get_rpath := 593gb_Executable_Executable_platform = 594gb_Executable_TARGETGUI := 595 596# GoogleTest class 597 598gb_GoogleTest_GTESTPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 599gb_GoogleTest_get_filename = $(1)$(gb_Executable_EXT) 600 601define gb_GoogleTest_GoogleTest_platform 602endef 603 604# SdiTarget class 605 606gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 607 608# SrsPartMergeTarget 609 610gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 611 612# SrsPartTarget class 613 614gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe 615gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET) 616 617ifeq ($(gb_FULLDEPS),$(true)) 618define gb_SrsPartTarget__command_dep 619$(call gb_Helper_abbreviate_dirs_native,\ 620 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 621 $(INCLUDE) \ 622 $(DEFS) \ 623 $(2) \ 624 -f - \ 625 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 626 -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \ 627 -v OUTDIR=$(OUTDIR)/ \ 628 -v WORKDIR=$(WORKDIR)/ \ 629 -v SRCDIR=$(SRCDIR)/ \ 630 -v REPODIR=$(REPODIR)/ \ 631 > $(call gb_SrsPartTarget_get_dep_target,$(1))) 632endef 633else 634gb_SrsPartTarget__command_dep = 635endif 636 637# WinResTarget class 638 639gb_WinResTarget_POSTFIX :=_res.o 640 641define gb_WinResTarget__command 642$(call gb_Output_announce,$(2),$(true),RES,3) 643$(call gb_Helper_abbreviate_dirs_native,\ 644 mkdir -p $(dir $(1)) && \ 645 $(gb_RC) \ 646 $(DEFS) $(FLAGS) \ 647 -I$(dir $(3)) \ 648 $(INCLUDE) \ 649 -Fo$(patsubst %_res.o,%.res,$(1)) \ 650 $(RCFILE) ) 651$(call gb_Helper_abbreviate_dirs_native,\ 652 windres $(patsubst %_res.o,%.res,$(1)) $(1)) 653 rm $(patsubst %_res.o,%.res,$(1)) 654endef 655 656$(eval $(call gb_Helper_make_dep_targets,\ 657 WinResTarget \ 658)) 659 660ifeq ($(gb_FULLDEPS),$(true)) 661define gb_WinResTarget__command_dep 662$(call gb_Helper_abbreviate_dirs_native,\ 663 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 664 $(INCLUDE) \ 665 $(DEFS) \ 666 $(2) \ 667 -f - \ 668 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 669 -v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \ 670 -v OUTDIR=$(OUTDIR)/ \ 671 -v WORKDIR=$(WORKDIR)/ \ 672 -v SRCDIR=$(SRCDIR)/ \ 673 -v REPODIR=$(REPODIR)/ \ 674 > $(call gb_WinResTarget_get_dep_target,$(1))) 675endef 676else 677gb_WinResTarget__command_dep = 678endif 679 680# ComponentTarget 681 682gb_XSLTPROCPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 683gb_Library_COMPONENTPREFIXES := \ 684 OOO:vnd.sun.star.expand:\dOOO_BASE_DIR/program/ \ 685 URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \ 686 NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \ 687 688# UnoApiTarget 689 690gb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc.exe 691gb_UnoApiTarget_IDLCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_IDLCTARGET) 692gb_UnoApiTarget_REGMERGETARGET := $(OUTDIR)/bin/regmerge.exe 693gb_UnoApiTarget_REGMERGECOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGMERGETARGET) 694gb_UnoApiTarget_REGCOMPARETARGET := $(OUTDIR)/bin/regcompare.exe 695gb_UnoApiTarget_REGCOMPARECOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGCOMPARETARGET) 696gb_UnoApiTarget_CPPUMAKERTARGET := $(OUTDIR)/bin/cppumaker.exe 697gb_UnoApiTarget_CPPUMAKERCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_CPPUMAKERTARGET) 698gb_UnoApiTarget_REGVIEWTARGET := $(OUTDIR)/bin/regview.exe 699gb_UnoApiTarget_REGVIEWCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGVIEWTARGET) 700 701# vim: set noet sw=4 ts=4: 702