[665] | 1 | # $Id: GCC64.kmk 3567 2022-06-26 20:00:02Z bird $
|
---|
[456] | 2 | ## @file
|
---|
[1064] | 3 | # kBuild Tool Config - Generic 64-bit GCC v3.2.x or later Using The System GCC.
|
---|
[456] | 4 | #
|
---|
[1547] | 5 |
|
---|
| 6 | #
|
---|
[3121] | 7 | # Copyright (c) 2004-2017 knut st. osmundsen <bird-kBuild-spam-xviiv@anduin.net>
|
---|
[456] | 8 | #
|
---|
| 9 | # This file is part of kBuild.
|
---|
| 10 | #
|
---|
| 11 | # kBuild is free software; you can redistribute it and/or modify
|
---|
| 12 | # it under the terms of the GNU General Public License as published by
|
---|
| 13 | # the Free Software Foundation; either version 2 of the License, or
|
---|
| 14 | # (at your option) any later version.
|
---|
| 15 | #
|
---|
| 16 | # kBuild is distributed in the hope that it will be useful,
|
---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 19 | # GNU General Public License for more details.
|
---|
| 20 | #
|
---|
| 21 | # You should have received a copy of the GNU General Public License
|
---|
| 22 | # along with kBuild; if not, write to the Free Software
|
---|
| 23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
| 24 | #
|
---|
| 25 | #
|
---|
[1547] | 26 | # As a special exception you are granted permission to include this file, via
|
---|
[1612] | 27 | # the kmk include directive, as you wish without this in itself causing the
|
---|
| 28 | # resulting makefile, program or whatever to be covered by the GPL license.
|
---|
[1547] | 29 | # This exception does not however invalidate any other reasons why the makefile,
|
---|
| 30 | # program, whatever should not be covered the GPL.
|
---|
| 31 | #
|
---|
| 32 | #
|
---|
[456] | 33 |
|
---|
[1064] | 34 | TOOL_GCC64 := Generic 64-bit GCC v3.2.x or later Using The System GCC. \
|
---|
[667] | 35 | More or less Linux/ELF specfic.
|
---|
[456] | 36 |
|
---|
[667] | 37 | # Tool Specific Properties
|
---|
[3393] | 38 | ifndef TOOL_GCC64_PREFIX
|
---|
| 39 | TOOL_GCC64_PREFIX :=
|
---|
| 40 | endif
|
---|
| 41 | ifndef TOOL_GCC64_SUFFIX
|
---|
| 42 | TOOL_GCC64_SUFFIX := $(HOSTSUFF_EXE)
|
---|
| 43 | endif
|
---|
| 44 | if1of ($(KBUILD_HOST), solaris)
|
---|
| 45 | TOOL_GCC64_PREFIX2 ?= g
|
---|
| 46 | else
|
---|
| 47 | TOOL_GCC64_PREFIX2 ?=
|
---|
| 48 | endif
|
---|
| 49 | TOOL_GCC64_SUFFIX2 ?= $(HOSTSUFF_EXE)
|
---|
| 50 | TOOL_GCC64_PREFIX3 ?=
|
---|
| 51 | TOOL_GCC64_SUFFIX3 ?= $(HOSTSUFF_EXE)
|
---|
| 52 | TOOL_GCC64_CC ?= $(TOOL_GCC64_PREFIX)gcc$(TOOL_GCC64_SUFFIX) -m64
|
---|
| 53 | TOOL_GCC64_CXX ?= $(TOOL_GCC64_PREFIX)g++$(TOOL_GCC64_SUFFIX) -m64
|
---|
| 54 | TOOL_GCC64_AS ?= $(TOOL_GCC64_PREFIX)gcc$(TOOL_GCC64_SUFFIX) -m64
|
---|
| 55 | TOOL_GCC64_AR ?= $(TOOL_GCC64_PREFIX2)ar$(TOOL_GCC64_SUFFIX2)
|
---|
| 56 | TOOL_GCC64_LD ?= $(TOOL_GCC64_PREFIX)gcc$(TOOL_GCC64_SUFFIX) -m64
|
---|
| 57 | if1of ($(KBUILD_HOST), solaris)
|
---|
| 58 | TOOL_GCC64_LD_SYSMOD ?= $(TOOL_GCC64_PREFIX3)ld$(TOOL_GCC64_SUFFIX3)
|
---|
| 59 | else
|
---|
| 60 | TOOL_GCC64_LD_SYSMOD ?= $(TOOL_GCC64_PREFIX2)ld$(TOOL_GCC64_SUFFIX2)
|
---|
| 61 | endif
|
---|
[1504] | 62 | ifndef TOOL_GCC64_LDFLAGS.$(KBUILD_TARGET)
|
---|
[3393] | 63 | TOOL_GCC64_LDFLAGS.dll ?= -shared
|
---|
[456] | 64 | else
|
---|
[3393] | 65 | TOOL_GCC64_LDFLAGS.dll ?= $(TOOL_GCC64_LDFLAGS.$(KBUILD_TARGET))
|
---|
[456] | 66 | endif
|
---|
[3062] | 67 | TOOL_GCC64_LDFLAGS.sysmod ?= -r -m elf_x86_64$(if-expr "$(KBUILD_TARGET)" == "freebsd" || "$(KBUILD_TARGET)" == "gnukfbsd",_fbsd,)
|
---|
[1504] | 68 | TOOL_GCC64_LD_SONAME ?= -Wl,-soname=$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2)))
|
---|
| 69 | ifeq ($(KBUILD_TARGET),os2)
|
---|
[3393] | 70 | TOOL_GCC64_LD_MAP ?= -Zmap=$(1)
|
---|
[456] | 71 | else
|
---|
[3393] | 72 | TOOL_GCC64_LD_MAP ?=
|
---|
[456] | 73 | endif
|
---|
[1504] | 74 | ifeq ($(KBUILD_TARGET),os2)
|
---|
[3393] | 75 | TOOL_GCC64_LD_SYSMOD_MAP ?= -Zmap=$(1)
|
---|
[456] | 76 | else
|
---|
[3393] | 77 | TOOL_GCC64_LD_SYSMOD_MAP ?=
|
---|
[456] | 78 | endif
|
---|
[3393] | 79 | TOOL_GCC64_OBJCOPY ?= $(TOOL_GCC64_PREFIX2)gobjcopy$(TOOL_GCC64_SUFFIX2)
|
---|
[2541] | 80 |
|
---|
[667] | 81 | # General Properties used by kBuild
|
---|
[1064] | 82 | TOOL_GCC64_COBJSUFF ?= .o
|
---|
| 83 | TOOL_GCC64_CFLAGS ?=
|
---|
| 84 | TOOL_GCC64_CFLAGS.debug ?= -g
|
---|
| 85 | TOOL_GCC64_CFLAGS.profile ?= -O2 #-g -pg
|
---|
| 86 | TOOL_GCC64_CFLAGS.release ?= -O2
|
---|
| 87 | TOOL_GCC64_CINCS ?=
|
---|
| 88 | TOOL_GCC64_CDEFS ?=
|
---|
[456] | 89 |
|
---|
[1064] | 90 | TOOL_GCC64_CXXOBJSUFF ?= .o
|
---|
| 91 | TOOL_GCC64_CXXOBJSUFF ?= .o
|
---|
| 92 | TOOL_GCC64_CXXFLAGS ?=
|
---|
| 93 | TOOL_GCC64_CXXFLAGS.debug ?= -g
|
---|
| 94 | TOOL_GCC64_CXXFLAGS.profile ?= -O2 #-g -pg
|
---|
| 95 | TOOL_GCC64_CXXFLAGS.release ?= -O2
|
---|
| 96 | TOOL_GCC64_CXXINCS ?=
|
---|
| 97 | TOOL_GCC64_CXXDEFS ?=
|
---|
[667] | 98 |
|
---|
[1064] | 99 | TOOL_GCC64_ASFLAGS ?= -x assembler-with-cpp
|
---|
| 100 | TOOL_GCC64_ASFLAGS.debug ?= -g
|
---|
| 101 | TOOL_GCC64_ASFLAGS.profile ?= -g
|
---|
| 102 | TOOL_GCC64_ASOBJSUFF ?= .o
|
---|
[667] | 103 |
|
---|
[1064] | 104 | TOOL_GCC64_ARFLAGS ?= cr
|
---|
| 105 | TOOL_GCC64_ARLIBSUFF ?= .a
|
---|
[667] | 106 |
|
---|
[1064] | 107 | TOOL_GCC64_LDFLAGS ?=
|
---|
| 108 | TOOL_GCC64_LDFLAGS.debug ?= -g
|
---|
| 109 | TOOL_GCC64_LDFLAGS.profile ?= -g
|
---|
[667] | 110 |
|
---|
| 111 |
|
---|
[456] | 112 | ## Compile C source.
|
---|
| 113 | # @param $(target) Normalized main target name.
|
---|
| 114 | # @param $(source) Source filename (relative).
|
---|
| 115 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 116 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 117 | # @param $(flags) Flags.
|
---|
| 118 | # @param $(defs) Definitions. No -D or something.
|
---|
| 119 | # @param $(incs) Includes. No -I or something.
|
---|
| 120 | # @param $(dirdep) Directory creation dependency.
|
---|
| 121 | # @param $(deps) Other dependencies.
|
---|
| 122 | #
|
---|
| 123 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 124 | # @param $(objsuff) Object suffix.
|
---|
[1064] | 125 | TOOL_GCC64_COMPILE_C_DEPEND =
|
---|
| 126 | TOOL_GCC64_COMPILE_C_DEPORD =
|
---|
[1418] | 127 | ifdef KBUILD_USE_KOBJCACHE
|
---|
[1064] | 128 | TOOL_GCC64_COMPILE_C_USES_KOBJCACHE = 1
|
---|
| 129 | TOOL_GCC64_COMPILE_C_OUTPUT = $(outbase).i
|
---|
| 130 | define TOOL_GCC64_COMPILE_C_CMDS
|
---|
[1058] | 131 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 132 | --kObjCache-cpp $(outbase).i\
|
---|
[1064] | 133 | $(TOOL_GCC64_CC) -E -o -\
|
---|
[3566] | 134 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1015] | 135 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[1058] | 136 | $(abspath $(source))\
|
---|
| 137 | --kObjCache-cc $(obj)\
|
---|
[1064] | 138 | $(TOOL_GCC64_CC) -c\
|
---|
[1058] | 139 | $(flags) -fpreprocessed -x c\
|
---|
[1015] | 140 | -o $(obj)\
|
---|
[1058] | 141 | -
|
---|
[2431] | 142 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[1015] | 143 | endef
|
---|
[1418] | 144 | else # !KBUILD_USE_KOBJCACHE
|
---|
[1064] | 145 | TOOL_GCC64_COMPILE_C_OUTPUT =
|
---|
| 146 | define TOOL_GCC64_COMPILE_C_CMDS
|
---|
| 147 | $(QUIET)$(TOOL_GCC64_CC) -c\
|
---|
[3566] | 148 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[456] | 149 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 150 | -o $(obj)\
|
---|
[697] | 151 | $(abspath $(source))
|
---|
[2431] | 152 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[456] | 153 | endef
|
---|
[1418] | 154 | endif # !KBUILD_USE_KOBJCACHE
|
---|
[456] | 155 |
|
---|
| 156 |
|
---|
| 157 | ## Compile C++ source.
|
---|
| 158 | # @param $(target) Normalized main target name.
|
---|
| 159 | # @param $(source) Source filename (relative).
|
---|
| 160 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 161 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 162 | # @param $(flags) Flags.
|
---|
| 163 | # @param $(defs) Definitions. No -D or something.
|
---|
| 164 | # @param $(incs) Includes. No -I or something.
|
---|
| 165 | # @param $(dirdep) Directory creation dependency.
|
---|
| 166 | # @param $(deps) Other dependencies.
|
---|
| 167 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 168 | # @param $(objsuff) Object suffix.
|
---|
[1064] | 169 | TOOL_GCC64_COMPILE_CXX_DEPEND =
|
---|
| 170 | TOOL_GCC64_COMPILE_CXX_DEPORD =
|
---|
[1418] | 171 | ifdef KBUILD_USE_KOBJCACHE
|
---|
[1064] | 172 | TOOL_GCC64_COMPILE_CXX_USES_KOBJCACHE = 1
|
---|
| 173 | TOOL_GCC64_COMPILE_CXX_OUTPUT = $(outbase).ii
|
---|
| 174 | define TOOL_GCC64_COMPILE_CXX_CMDS
|
---|
[1058] | 175 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 176 | --kObjCache-cpp $(outbase).ii\
|
---|
[1064] | 177 | $(TOOL_GCC64_CXX) -E -o -\
|
---|
[3566] | 178 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1015] | 179 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[1058] | 180 | $(abspath $(source))\
|
---|
| 181 | --kObjCache-cc $(obj)\
|
---|
[1064] | 182 | $(TOOL_GCC64_CXX) -c\
|
---|
[1058] | 183 | $(flags) -fpreprocessed -x c++\
|
---|
[1015] | 184 | -o $(obj)\
|
---|
[1058] | 185 | -
|
---|
[2431] | 186 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[1015] | 187 | endef
|
---|
[1418] | 188 | else # !KBUILD_USE_KOBJCACHE
|
---|
[1064] | 189 | TOOL_GCC64_COMPILE_CXX_OUTPUT =
|
---|
| 190 | define TOOL_GCC64_COMPILE_CXX_CMDS
|
---|
| 191 | $(QUIET)$(TOOL_GCC64_CXX) -c\
|
---|
[3566] | 192 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[456] | 193 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 194 | -o $(obj)\
|
---|
[697] | 195 | $(abspath $(source))
|
---|
[2431] | 196 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[456] | 197 | endef
|
---|
[1418] | 198 | endif # !KBUILD_USE_KOBJCACHE
|
---|
[456] | 199 |
|
---|
| 200 |
|
---|
[465] | 201 | ## Compile Assembly source.
|
---|
| 202 | # @param $(target) Normalized main target name.
|
---|
| 203 | # @param $(source) Source filename (relative).
|
---|
| 204 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 205 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 206 | # @param $(flags) Flags.
|
---|
| 207 | # @param $(defs) Definitions. No -D or something.
|
---|
| 208 | # @param $(incs) Includes. No -I or something.
|
---|
| 209 | # @param $(dirdep) Directory creation dependency.
|
---|
| 210 | # @param $(deps) Other dependencies.
|
---|
| 211 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 212 | # @param $(objsuff) Object suffix.
|
---|
| 213 | #
|
---|
[1064] | 214 | TOOL_GCC64_COMPILE_AS_OUTPUT =
|
---|
| 215 | TOOL_GCC64_COMPILE_AS_DEPEND =
|
---|
| 216 | TOOL_GCC64_COMPILE_AS_DEPORD =
|
---|
| 217 | define TOOL_GCC64_COMPILE_AS_CMDS
|
---|
| 218 | $(QUIET)$(TOOL_GCC64_AS) -c\
|
---|
[3566] | 219 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[465] | 220 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 221 | -o $(obj)\
|
---|
[697] | 222 | $(abspath $(source))
|
---|
[2431] | 223 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[465] | 224 | endef
|
---|
| 225 |
|
---|
| 226 |
|
---|
[456] | 227 | ## Link library
|
---|
| 228 | # @param $(target) Normalized main target name.
|
---|
| 229 | # @param $(out) Library name.
|
---|
| 230 | # @param $(objs) Object files to put in the library.
|
---|
| 231 | # @param $(flags) Flags.
|
---|
| 232 | # @param $(dirdep) Directory creation dependency.
|
---|
| 233 | # @param $(deps) Other dependencies.
|
---|
| 234 | # @param $(othersrc) Unhandled sources.
|
---|
| 235 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[1064] | 236 | TOOL_GCC64_LINK_LIBRARY_OUTPUT = $(out).ar-script
|
---|
| 237 | TOOL_GCC64_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
| 238 | TOOL_GCC64_LINK_LIBRARY_DEPORD =
|
---|
| 239 | define TOOL_GCC64_LINK_LIBRARY_CMDS
|
---|
[772] | 240 | $(QUIET)$(APPEND) $(out).ar-script 'CREATE $(out)'
|
---|
| 241 | $(QUIET)$(APPEND) -n $(out).ar-script \
|
---|
| 242 | $(foreach o,$(objs), 'ADDMOD $(o)') \
|
---|
[807] | 243 | $(foreach o,$(othersrc), 'ADDLIB $(o)')
|
---|
[772] | 244 | $(QUIET)$(APPEND) $(out).ar-script 'SAVE'
|
---|
| 245 | $(QUIET)$(APPEND) $(out).ar-script 'END'
|
---|
[1315] | 246 | $(QUIET)$(REDIRECT) -rti $(out).ar-script -- $(TOOL_GCC64_AR) -M
|
---|
[772] | 247 | endef
|
---|
[456] | 248 |
|
---|
| 249 |
|
---|
| 250 | ## Link program
|
---|
| 251 | # @param $(target) Normalized main target name.
|
---|
| 252 | # @param $(out) Program name.
|
---|
| 253 | # @param $(objs) Object files to link together.
|
---|
| 254 | # @param $(libs) Libraries to search.
|
---|
| 255 | # @param $(libpath) Library search paths.
|
---|
| 256 | # @param $(flags) Flags.
|
---|
| 257 | # @param $(dirdep) Directory creation dependency.
|
---|
| 258 | # @param $(deps) Other dependencies.
|
---|
| 259 | # @param $(othersrc) Unhandled sources.
|
---|
| 260 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 261 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 262 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[1064] | 263 | TOOL_GCC64_LINK_PROGRAM_OUTPUT =
|
---|
| 264 | TOOL_GCC64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map
|
---|
[2541] | 265 | TOOL_GCC64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug
|
---|
| 266 | TOOL_GCC64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
|
---|
[1064] | 267 | TOOL_GCC64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
| 268 | TOOL_GCC64_LINK_PROGRAM_DEPORD =
|
---|
| 269 | define TOOL_GCC64_LINK_PROGRAM_CMDS
|
---|
| 270 | $(QUIET)$(TOOL_GCC64_LD) $(flags) -o $(out) $(objs)\
|
---|
[456] | 271 | $(foreach p,$(libpath), -L$(p))\
|
---|
[1259] | 272 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
---|
[1064] | 273 | $(call TOOL_GCC64_LD_MAP,$(outbase).map)
|
---|
[2541] | 274 | ifeq ($(ld_debug),split)
|
---|
[2774] | 275 | $(QUIET)$(TOOL_GCC64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
|
---|
| 276 | $(QUIET)$(CHMOD) a-x $(outbase).debug
|
---|
| 277 | $(QUIET)$(TOOL_GCC64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
|
---|
[2541] | 278 | endif
|
---|
[456] | 279 | endef
|
---|
| 280 |
|
---|
| 281 |
|
---|
| 282 | ## Link DLL
|
---|
| 283 | # @param $(target) Normalized main target name.
|
---|
| 284 | # @param $(out) Program name.
|
---|
| 285 | # @param $(objs) Object files to link together.
|
---|
| 286 | # @param $(libs) Libraries to search.
|
---|
| 287 | # @param $(libpath) Library search paths.
|
---|
| 288 | # @param $(flags) Flags.
|
---|
| 289 | # @param $(dirdep) Directory creation dependency.
|
---|
| 290 | # @param $(deps) Other dependencies.
|
---|
| 291 | # @param $(othersrc) Unhandled sources.
|
---|
| 292 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 293 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 294 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[1064] | 295 | TOOL_GCC64_LINK_DLL_OUTPUT =
|
---|
| 296 | TOOL_GCC64_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
|
---|
[2541] | 297 | TOOL_GCC64_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug
|
---|
| 298 | TOOL_GCC64_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
|
---|
[1064] | 299 | TOOL_GCC64_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
| 300 | TOOL_GCC64_LINK_DLL_DEPORD =
|
---|
| 301 | define TOOL_GCC64_LINK_DLL_CMDS
|
---|
| 302 | $(QUIET)$(TOOL_GCC64_LD) $(TOOL_GCC64_LDFLAGS.dll) $(flags) -o $(out)\
|
---|
[1504] | 303 | $(if $(filter-out win os2, $(KBUILD_TARGET)),$(call TOOL_GCC64_LD_SONAME,$(target),$(out)))\
|
---|
[456] | 304 | $(objs)\
|
---|
| 305 | $(foreach p,$(libpath), -L$(p))\
|
---|
[1259] | 306 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
---|
[1064] | 307 | $(call TOOL_GCC64_LD_MAP,$(outbase).map)
|
---|
[2541] | 308 | ifeq ($(ld_debug),split)
|
---|
[2774] | 309 | $(QUIET)$(TOOL_GCC64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
|
---|
| 310 | $(QUIET)$(CHMOD) a-x $(outbase).debug
|
---|
| 311 | $(QUIET)$(TOOL_GCC64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
|
---|
[2541] | 312 | endif
|
---|
[456] | 313 | endef
|
---|
| 314 |
|
---|
| 315 |
|
---|
| 316 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
| 317 | # @param $(target) Normalized main target name.
|
---|
| 318 | # @param $(out) System module name.
|
---|
| 319 | # @param $(objs) Object files to link together.
|
---|
| 320 | # @param $(libs) Libraries to search.
|
---|
| 321 | # @param $(libpath) Library search paths.
|
---|
| 322 | # @param $(flags) Flags.
|
---|
| 323 | # @param $(dirdep) Directory creation dependency.
|
---|
| 324 | # @param $(deps) Other dependencies.
|
---|
| 325 | # @param $(othersrc) Unhandled sources.
|
---|
| 326 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 327 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 328 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[1064] | 329 | TOOL_GCC64_LINK_SYSMOD_OUTPUT =
|
---|
| 330 | TOOL_GCC64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
|
---|
[2541] | 331 | TOOL_GCC64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug
|
---|
| 332 | TOOL_GCC64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
|
---|
[1064] | 333 | TOOL_GCC64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
| 334 | TOOL_GCC64_LINK_SYSMOD_DEPORD =
|
---|
| 335 | define TOOL_GCC64_LINK_SYSMOD_CMDS
|
---|
| 336 | $(QUIET)$(TOOL_GCC64_LD_SYSMOD) $(TOOL_GCC64_LDFLAGS.sysmod) $(flags) -o $(out) $(objs)\
|
---|
[456] | 337 | $(foreach p,$(libpath), -L$(p))\
|
---|
[1259] | 338 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
---|
[1064] | 339 | $(call TOOL_GCC64_LD_SYSMOD_MAP,$(outbase).map)
|
---|
[2541] | 340 | ifeq ($(ld_debug),split)
|
---|
[2774] | 341 | $(QUIET)$(TOOL_GCC64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
|
---|
| 342 | $(QUIET)$(CHMOD) a-x $(outbase).debug
|
---|
| 343 | $(QUIET)$(TOOL_GCC64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
|
---|
[2541] | 344 | endif
|
---|
[456] | 345 | endef
|
---|
| 346 |
|
---|