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 d3d9 \ 466 d3dx \ 467 ddraw \ 468 gdi32 \ 469 gdiplus \ 470 gnu_getopt \ 471 imm32\ 472 kernel32 \ 473 msimg32 \ 474 msvcrt \ 475 mpr \ 476 moldname \ 477 ole32 \ 478 oleaut32 \ 479 shell32 \ 480 user32 \ 481 uuid \ 482 uwinapi \ 483 winmm \ 484 winspool 485 486gb_Library_LAYER := \ 487 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ 488 $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \ 489 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \ 490 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ 491 $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \ 492 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \ 493 $(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \ 494 $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \ 495 $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \ 496 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \ 497 498gb_Library_FILENAMES :=\ 499 $(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ 500 501gb_Library_DLLEXT := .dll 502gb_Library_MAJORVER := 3 503gb_Library_RTEXT := gcc3$(gb_Library_DLLEXT) 504ifeq ($(gb_PRODUCT),$(true)) 505gb_Library_STLEXT := port_gcc$(gb_Library_DLLEXT) 506else 507gb_Library_STLEXT := port_gcc_stldebug$(gb_Library_DLLEXT) 508endif 509gb_Library_OOOEXT := $(gb_Library_DLLEXT) 510gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT) 511gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT) 512gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT) 513 514gb_Library_DLLFILENAMES := \ 515 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \ 516 $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ 517 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ 518 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \ 519 $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \ 520 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \ 521 $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \ 522 $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \ 523 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \ 524 525gb_Library_IARCSYSPRE := lib 526gb_Library_IARCEXT := .a 527 528gb_Library_ILIBEXT := .lib 529 530define gb_Library_Library_platform 531$(call gb_LinkTarget_set_dlltarget,$(2),$(3)) 532 533$(call gb_LinkTarget_set_auxtargets,$(2),\ 534 $(patsubst %.dll,%.map,$(3)) \ 535) 536 537$(call gb_Library_get_target,$(1)) \ 538$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3)) 539 540$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3),$(1)) 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_SYSPRE := lib 573gb_StaticLibrary_PLAINEXT := .a 574gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT) 575 576gb_StaticLibrary_FILENAMES := \ 577 $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \ 578 $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \ 579 580gb_StaticLibrary_FILENAMES := $(patsubst salcpprt:salcpprt%,salcpprt:cpprtl%,$(gb_StaticLibrary_FILENAMES)) 581 582gb_StaticLibrary_StaticLibrary_platform = 583 584# Executable class 585 586gb_Executable_EXT := .exe 587gb_Executable_TARGETTYPEFLAGS := 588gb_Executable_get_rpath := 589gb_Executable_Executable_platform = 590gb_Executable_TARGETGUI := 591 592# GoogleTest class 593 594gb_GoogleTest_GTESTPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 595gb_GoogleTest_get_filename = $(1)$(gb_Executable_EXT) 596 597define gb_GoogleTest_GoogleTest_platform 598endef 599 600# SdiTarget class 601 602gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 603 604# SrsPartMergeTarget 605 606gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 607 608# SrsPartTarget class 609 610gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe 611gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET) 612 613ifeq ($(gb_FULLDEPS),$(true)) 614define gb_SrsPartTarget__command_dep 615$(call gb_Helper_abbreviate_dirs_native,\ 616 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 617 $(INCLUDE) \ 618 $(DEFS) \ 619 $(2) \ 620 -f - \ 621 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 622 -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \ 623 -v OUTDIR=$(OUTDIR)/ \ 624 -v WORKDIR=$(WORKDIR)/ \ 625 -v SRCDIR=$(SRCDIR)/ \ 626 -v REPODIR=$(REPODIR)/ \ 627 > $(call gb_SrsPartTarget_get_dep_target,$(1))) 628endef 629else 630gb_SrsPartTarget__command_dep = 631endif 632 633# WinResTarget class 634 635gb_WinResTarget_POSTFIX :=_res.o 636 637define gb_WinResTarget__command 638$(call gb_Output_announce,$(2),$(true),RES,3) 639$(call gb_Helper_abbreviate_dirs_native,\ 640 mkdir -p $(dir $(1)) && \ 641 $(gb_RC) \ 642 $(DEFS) $(FLAGS) \ 643 -I$(dir $(3)) \ 644 $(INCLUDE) \ 645 -Fo$(patsubst %_res.o,%.res,$(1)) \ 646 $(RCFILE) ) 647$(call gb_Helper_abbreviate_dirs_native,\ 648 windres $(patsubst %_res.o,%.res,$(1)) $(1)) 649 rm $(patsubst %_res.o,%.res,$(1)) 650endef 651 652$(eval $(call gb_Helper_make_dep_targets,\ 653 WinResTarget \ 654)) 655 656ifeq ($(gb_FULLDEPS),$(true)) 657define gb_WinResTarget__command_dep 658$(call gb_Helper_abbreviate_dirs_native,\ 659 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 660 $(INCLUDE) \ 661 $(DEFS) \ 662 $(2) \ 663 -f - \ 664 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 665 -v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \ 666 -v OUTDIR=$(OUTDIR)/ \ 667 -v WORKDIR=$(WORKDIR)/ \ 668 -v SRCDIR=$(SRCDIR)/ \ 669 -v REPODIR=$(REPODIR)/ \ 670 > $(call gb_WinResTarget_get_dep_target,$(1))) 671endef 672else 673gb_WinResTarget__command_dep = 674endif 675 676# ComponentTarget 677 678gb_XSLTPROCPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 679gb_Library_COMPONENTPREFIXES := \ 680 OOO:vnd.sun.star.expand:\dOOO_BASE_DIR/program/ \ 681 URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \ 682 NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \ 683 684# UnoApiTarget 685 686gb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc.exe 687gb_UnoApiTarget_IDLCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_IDLCTARGET) 688gb_UnoApiTarget_REGMERGETARGET := $(OUTDIR)/bin/regmerge.exe 689gb_UnoApiTarget_REGMERGECOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGMERGETARGET) 690gb_UnoApiTarget_REGCOMPARETARGET := $(OUTDIR)/bin/regcompare.exe 691gb_UnoApiTarget_REGCOMPARECOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGCOMPARETARGET) 692gb_UnoApiTarget_CPPUMAKERTARGET := $(OUTDIR)/bin/cppumaker.exe 693gb_UnoApiTarget_CPPUMAKERCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_CPPUMAKERTARGET) 694gb_UnoApiTarget_REGVIEWTARGET := $(OUTDIR)/bin/regview.exe 695gb_UnoApiTarget_REGVIEWCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGVIEWTARGET) 696 697# vim: set noet sw=4 ts=4: 698