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 $(6) \ 316 -c $(3) \ 317 -o$(1)) 318$(call gb_PrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6)) 319 320endef 321 322# NoexPrecompiledHeader class 323 324gb_NoexPrecompiledHeader_EXT := .gch 325 326gb_NoexPrecompiledHeader_get_enableflags = -I$(WORKDIR)/NoexPrecompiledHeader/$(gb_NoexPrecompiledHeader_DEBUGDIR) \ 327 -Winvalid-pch \ 328 329ifeq ($(gb_FULLDEPS),$(true)) 330define gb_NoexPrecompiledHeader__command_deponcompile 331$(call gb_Helper_abbreviate_dirs_native,\ 332 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 333 $(4) $(5) \ 334 -I$(dir $(3)) \ 335 $(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \ 336 $(3) \ 337 -f - \ 338 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 339 -v OBJECTFILE=$(1) \ 340 -v OUTDIR=$(OUTDIR)/ \ 341 -v WORKDIR=$(WORKDIR)/ \ 342 -v SRCDIR=$(SRCDIR)/ \ 343 -v REPODIR=$(REPODIR)/ \ 344 > $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) 345endef 346else 347gb_NoexPrecompiledHeader__command_deponcompile = 348endif 349 350define gb_NoexPrecompiledHeader__command 351$(call gb_Output_announce,$(2),$(true),PCH,1) 352$(call gb_Helper_abbreviate_dirs_native,\ 353 mkdir -p $(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) && \ 354 $(gb_CXX) \ 355 -x c++-header \ 356 $(4) $(5) \ 357 -I$(dir $(3)) \ 358 $(6) \ 359 -c $(3) \ 360 -o$(1)) 361$(call gb_NoexPrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6)) 362 363endef 364 365 366# LinkTarget class 367 368gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) 369gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) 370 371gb_LinkTarget_INCLUDE :=\ 372 $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \ 373 $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \ 374 375gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) 376 377define gb_LinkTarget__command_dynamiclinkexecutable 378$(call gb_Output_announce,$(2),$(true),LNK,4) 379$(call gb_Helper_abbreviate_dirs_native,\ 380 mkdir -p $(dir $(1)) && \ 381 RESPONSEFILE=`$(gb_MKTEMP)` && \ 382 echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 383 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 384 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 385 $(NATIVERES) " > $${RESPONSEFILE} && \ 386 $(gb_LINK) \ 387 $(gb_Executable_TARGETTYPEFLAGS) \ 388 $(if $(filter YES,$(gb_Executable_TARGETGUI)), --subsystem windows, --subsystem console) \ 389 $(T_LDFLAGS) \ 390 $(gb_MINGWLIBDIR)/crt2.o \ 391 $(MINGW_CLIB_DIR)/crtbegin.o \ 392 @$${RESPONSEFILE} \ 393 --start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \ 394 --start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \ 395 --start-group $(patsubst %,-l%,$(EXTERNAL_LIBS)) --end-group \ 396 $(LIBS) \ 397 $(MINGW_CLIB_DIR)/crtend.o \ 398 -Map $(basename $(1)).map \ 399 -o $(1)) 400endef 401 402define gb_LinkTarget__command_dynamiclinklibrary 403$(call gb_Helper_abbreviate_dirs_native,\ 404 mkdir -p $(dir $(1)) && \ 405 rm -f $(1) && \ 406 RESPONSEFILE=`$(gb_MKTEMP)` && \ 407 echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 408 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 409 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 410 $(NATIVERES) " > $${RESPONSEFILE} && \ 411 $(gb_LINK) \ 412 $(gb_Library_TARGETTYPEFLAGS) \ 413 $(T_LDFLAGS) \ 414 --enable-auto-image-base \ 415 -e _DllMainCRTStartup@12 \ 416 $(gb_MINGWLIBDIR)/dllcrt2.o \ 417 $(MINGW_CLIB_DIR)/crtbegin.o \ 418 @$${RESPONSEFILE} \ 419 --start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \ 420 --start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \ 421 $(LIBS) \ 422 $(MINGW_CLIB_DIR)/crtend.o \ 423 -Map $(basename $(DLLTARGET)).map \ 424 -o $(DLLTARGET) && touch $(1)) 425endef 426 427define gb_LinkTarget__command_staticlinklibrary 428$(call gb_Helper_abbreviate_dirs_native,\ 429 mkdir -p $(dir $(1)) && \ 430 RESPONSEFILE=`$(gb_MKTEMP)` && \ 431 echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 432 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 433 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) " > $${RESPONSEFILE} && \ 434 $(gb_AR) -rsu\ 435 $(1) \ 436 @$${RESPONSEFILE}) 437endef 438 439define gb_LinkTarget__command 440$(call gb_Output_announce,$(2),$(true),LNK,4) 441$(if $(filter GoogleTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinkexecutable,$(1),$(2))) 442$(if $(filter Library,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclinklibrary,$(1),$(2))) 443$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlinklibrary,$(1))) 444endef 445 446 447# Library class 448 449gb_Library_DEFS := -D_DLL_ 450gb_Library_TARGETTYPEFLAGS := -shared 451gb_Library_get_rpath := 452 453gb_Library_SYSPRE := i 454gb_Library_PLAINEXT := .lib 455 456gb_Library_PLAINLIBS_NONE += \ 457 mingwthrd \ 458 mingw32 \ 459 mingwex \ 460 $(gb_MINGW_LIBSTDCPP) \ 461 $(gb_MINGW_LIBGCC) \ 462 advapi32 \ 463 d3d9 \ 464 d3dx \ 465 ddraw \ 466 gdi32 \ 467 gdiplus \ 468 gnu_getopt \ 469 imm32\ 470 kernel32 \ 471 msimg32 \ 472 msvcrt \ 473 mpr \ 474 moldname \ 475 ole32 \ 476 oleaut32 \ 477 shell32 \ 478 user32 \ 479 uuid \ 480 uwinapi \ 481 winmm \ 482 winspool 483 484gb_Library_LAYER := \ 485 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ 486 $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \ 487 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \ 488 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ 489 $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \ 490 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \ 491 $(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \ 492 $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \ 493 $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \ 494 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \ 495 496gb_Library_FILENAMES :=\ 497 $(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ 498 499gb_Library_DLLEXT := .dll 500gb_Library_MAJORVER := 3 501gb_Library_RTEXT := gcc3$(gb_Library_DLLEXT) 502ifeq ($(gb_PRODUCT),$(true)) 503gb_Library_STLEXT := port_gcc$(gb_Library_DLLEXT) 504else 505gb_Library_STLEXT := port_gcc_stldebug$(gb_Library_DLLEXT) 506endif 507gb_Library_OOOEXT := $(gb_Library_DLLEXT) 508gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT) 509gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT) 510gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT) 511 512gb_Library_DLLFILENAMES := \ 513 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \ 514 $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ 515 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ 516 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \ 517 $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \ 518 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \ 519 $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \ 520 $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \ 521 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \ 522 523gb_Library_IARCSYSPRE := lib 524gb_Library_IARCEXT := .a 525 526gb_Library_ILIBEXT := .lib 527 528define gb_Library_Library_platform 529$(call gb_LinkTarget_set_dlltarget,$(2),$(3)) 530 531$(call gb_LinkTarget_set_auxtargets,$(2),\ 532 $(patsubst %.dll,%.map,$(3)) \ 533) 534 535$(call gb_Library_get_target,$(1)) \ 536$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3)) 537 538$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3),$(1)) 539 540endef 541 542define gb_Library_add_default_nativeres 543$(call gb_WinResTarget_WinResTarget_init,$(1)/$(2)) 544$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo) 545$(call gb_WinResTarget_set_defs,$(1)/$(2),\ 546 $$(DEFS) \ 547 -DADDITIONAL_VERINFO1= \ 548 -DADDITIONAL_VERINFO2= \ 549 -DADDITIONAL_VERINFO3= \ 550) 551$(call gb_Library_add_nativeres,$(1),$(2)) 552$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2)) 553 554endef 555 556define gb_Library_add_nativeres 557$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : $(call gb_WinResTarget_get_target,$(1)/$(2)) 558$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,$(1))) : NATIVERES += $(call gb_WinResTarget_get_target,$(1)/$(2)) 559 560endef 561 562define gb_Library_get_dllname 563$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES))) 564endef 565 566 567# StaticLibrary class 568 569gb_StaticLibrary_DEFS := 570gb_StaticLibrary_SYSPRE := lib 571gb_StaticLibrary_PLAINEXT := .a 572gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT) 573 574gb_StaticLibrary_FILENAMES := \ 575 $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \ 576 $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \ 577 578gb_StaticLibrary_FILENAMES := $(patsubst salcpprt:salcpprt%,salcpprt:cpprtl%,$(gb_StaticLibrary_FILENAMES)) 579 580gb_StaticLibrary_StaticLibrary_platform = 581 582# Executable class 583 584gb_Executable_EXT := .exe 585gb_Executable_TARGETTYPEFLAGS := 586gb_Executable_get_rpath := 587gb_Executable_Executable_platform = 588gb_Executable_TARGETGUI := 589 590# GoogleTest class 591 592gb_GoogleTest_GTESTPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 593gb_GoogleTest_get_filename = $(1)$(gb_Executable_EXT) 594 595define gb_GoogleTest_GoogleTest_platform 596endef 597 598# SdiTarget class 599 600gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 601 602# SrsPartMergeTarget 603 604gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 605 606# SrsPartTarget class 607 608gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe 609gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET) 610 611ifeq ($(gb_FULLDEPS),$(true)) 612define gb_SrsPartTarget__command_dep 613$(call gb_Helper_abbreviate_dirs_native,\ 614 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 615 $(INCLUDE) \ 616 $(DEFS) \ 617 $(2) \ 618 -f - \ 619 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 620 -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \ 621 -v OUTDIR=$(OUTDIR)/ \ 622 -v WORKDIR=$(WORKDIR)/ \ 623 -v SRCDIR=$(SRCDIR)/ \ 624 -v REPODIR=$(REPODIR)/ \ 625 > $(call gb_SrsPartTarget_get_dep_target,$(1))) 626endef 627else 628gb_SrsPartTarget__command_dep = 629endif 630 631# WinResTarget class 632 633gb_WinResTarget_POSTFIX :=_res.o 634 635define gb_WinResTarget__command 636$(call gb_Output_announce,$(2),$(true),RES,3) 637$(call gb_Helper_abbreviate_dirs_native,\ 638 mkdir -p $(dir $(1)) && \ 639 $(gb_RC) \ 640 $(DEFS) $(FLAGS) \ 641 -I$(dir $(3)) \ 642 $(INCLUDE) \ 643 -Fo$(patsubst %_res.o,%.res,$(1)) \ 644 $(RCFILE) ) 645$(call gb_Helper_abbreviate_dirs_native,\ 646 windres $(patsubst %_res.o,%.res,$(1)) $(1)) 647 rm $(patsubst %_res.o,%.res,$(1)) 648endef 649 650$(eval $(call gb_Helper_make_dep_targets,\ 651 WinResTarget \ 652)) 653 654ifeq ($(gb_FULLDEPS),$(true)) 655define gb_WinResTarget__command_dep 656$(call gb_Helper_abbreviate_dirs_native,\ 657 $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ 658 $(INCLUDE) \ 659 $(DEFS) \ 660 $(2) \ 661 -f - \ 662 | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ 663 -v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \ 664 -v OUTDIR=$(OUTDIR)/ \ 665 -v WORKDIR=$(WORKDIR)/ \ 666 -v SRCDIR=$(SRCDIR)/ \ 667 -v REPODIR=$(REPODIR)/ \ 668 > $(call gb_WinResTarget_get_dep_target,$(1))) 669endef 670else 671gb_WinResTarget__command_dep = 672endif 673 674# ComponentTarget 675 676gb_XSLTPROCPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" 677gb_Library_COMPONENTPREFIXES := \ 678 OOO:vnd.sun.star.expand:\dOOO_BASE_DIR/program/ \ 679 URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \ 680 NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \ 681 682# UnoApiTarget 683 684gb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc.exe 685gb_UnoApiTarget_IDLCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_IDLCTARGET) 686gb_UnoApiTarget_REGMERGETARGET := $(OUTDIR)/bin/regmerge.exe 687gb_UnoApiTarget_REGMERGECOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGMERGETARGET) 688gb_UnoApiTarget_REGCOMPARETARGET := $(OUTDIR)/bin/regcompare.exe 689gb_UnoApiTarget_REGCOMPARECOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGCOMPARETARGET) 690gb_UnoApiTarget_CPPUMAKERTARGET := $(OUTDIR)/bin/cppumaker.exe 691gb_UnoApiTarget_CPPUMAKERCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_CPPUMAKERTARGET) 692gb_UnoApiTarget_REGVIEWTARGET := $(OUTDIR)/bin/regview.exe 693gb_UnoApiTarget_REGVIEWCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGVIEWTARGET) 694 695# vim: set noet sw=4 ts=4: 696