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