[93] | 1 | # $Id: GCC3PLAIN.kmk 3567 2022-06-26 20:00:02Z bird $
|
---|
| 2 | ## @file
|
---|
[826] | 3 | # kBuild Tool Config - Generic GCC v3.2.x or later Using The System GCC, any Unix Linker and Unix Archiver.
|
---|
[93] | 4 | #
|
---|
[1547] | 5 |
|
---|
| 6 | #
|
---|
[3121] | 7 | # Copyright (c) 2004-2017 knut st. osmundsen <bird-kBuild-spam-xviiv@anduin.net>
|
---|
[93] | 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 | #
|
---|
[93] | 33 |
|
---|
[847] | 34 | TOOL_GCC3PLAIN := Generic GCC v3.2.x or later Using The System GCC, any Unix Linker and Unix Archiver.
|
---|
[93] | 35 |
|
---|
[667] | 36 | # Tool Specific Properties
|
---|
[3393] | 37 | ifndef TOOL_GCC3PLAIN_PREFIX
|
---|
| 38 | TOOL_GCC3PLAIN_PREFIX :=
|
---|
| 39 | endif
|
---|
| 40 | ifndef TOOL_GCC3PLAIN_SUFFIX
|
---|
| 41 | TOOL_GCC3PLAIN_SUFFIX := $(HOSTSUFF_EXE)
|
---|
| 42 | endif
|
---|
| 43 | TOOL_GCC3PLAIN_PREFIX2 ?= $(TOOL_GCC3PLAIN_PREFIX)
|
---|
| 44 | TOOL_GCC3PLAIN_SUFFIX2 ?= $(TOOL_GCC3PLAIN_SUFFIX)
|
---|
| 45 | TOOL_GCC3PLAIN_CC ?= $(TOOL_GCC3PLAIN_PREFIX)gcc$(TOOL_GCC3PLAIN_SUFFIX)
|
---|
| 46 | TOOL_GCC3PLAIN_CXX ?= $(TOOL_GCC3PLAIN_PREFIX)g++$(TOOL_GCC3PLAIN_SUFFIX)
|
---|
| 47 | TOOL_GCC3PLAIN_AS ?= $(TOOL_GCC3PLAIN_PREFIX)gcc$(TOOL_GCC3PLAIN_SUFFIX)
|
---|
| 48 | TOOL_GCC3PLAIN_AR ?= $(TOOL_GCC3PLAIN_PREFIX2)ar$(TOOL_GCC3PLAIN_SUFFIX2)
|
---|
| 49 | TOOL_GCC3PLAIN_RANLIB ?= $(TOOL_GCC3PLAIN_PREFIX2)ranlib$(TOOL_GCC3PLAIN_SUFFIX2)
|
---|
| 50 | TOOL_GCC3PLAIN_LD ?= $(TOOL_GCC3PLAIN_PREFIX)gcc$(TOOL_GCC3PLAIN_SUFFIX)
|
---|
| 51 | TOOL_GCC3PLAIN_LD_SYSMOD ?= $(TOOL_GCC3PLAIN_PREFIX2)ld$(TOOL_GCC3PLAIN_SUFFIX2)
|
---|
| 52 | TOOL_GCC3PLAIN_LD_SYSMOD.os2 ?= $(TOOL_GCC3PLAIN_PREFIX)g++$(TOOL_GCC3PLAIN_SUFFIX)
|
---|
[847] | 53 | TOOL_GCC3PLAIN_LDFLAGS.dll.os2 ?= -Zdll
|
---|
| 54 | TOOL_GCC3PLAIN_LDFLAGS.dll.darwin ?= -dynamiclib
|
---|
[1504] | 55 | ifndef TOOL_GCC3PLAIN_LDFLAGS.$(KBUILD_TARGET)
|
---|
[847] | 56 | TOOL_GCC3PLAIN_LDFLAGS.dll ?= -shared
|
---|
| 57 | else
|
---|
[1504] | 58 | TOOL_GCC3PLAIN_LDFLAGS.dll ?= $(TOOL_GCC3PLAIN_LDFLAGS.$(KBUILD_TARGET))
|
---|
[847] | 59 | endif
|
---|
[3393] | 60 | TOOL_GCC3PLAIN_LD_SONAME.darwin ?= $(NO_SUCH_VARIABLE)
|
---|
| 61 | TOOL_GCC3PLAIN_LD_SONAME.os2 ?= $(NO_SUCH_VARIABLE)
|
---|
[1504] | 62 | TOOL_GCC3PLAIN_LD_SONAME.solaris ?= -Wl,-h,$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2)))
|
---|
[3393] | 63 | TOOL_GCC3PLAIN_LD_SONAME.win ?= $(NO_SUCH_VARIABLE)
|
---|
[1504] | 64 | ifndef TOOL_GCC3PLAIN_LD_SONAME.$(KBUILD_TARGET)
|
---|
| 65 | TOOL_GCC3PLAIN_LD_SONAME ?= -Wl,-soname=$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2)))
|
---|
[847] | 66 | else
|
---|
[1504] | 67 | TOOL_GCC3PLAIN_LD_SONAME ?= $(TOOL_GCC3PLAIN_LD_SONAME.$(KBUILD_TARGET))
|
---|
[847] | 68 | endif
|
---|
[93] | 69 |
|
---|
[667] | 70 | # General Properties used by kBuild
|
---|
[826] | 71 | TOOL_GCC3PLAIN_COBJSUFF ?= .o
|
---|
| 72 | TOOL_GCC3PLAIN_CFLAGS ?=
|
---|
| 73 | TOOL_GCC3PLAIN_CFLAGS.debug ?= -g
|
---|
[1058] | 74 | TOOL_GCC3PLAIN_CFLAGS.profile ?= -O2 #-g -pg
|
---|
[826] | 75 | TOOL_GCC3PLAIN_CFLAGS.release ?= -O2
|
---|
| 76 | TOOL_GCC3PLAIN_CINCS ?=
|
---|
| 77 | TOOL_GCC3PLAIN_CDEFS ?=
|
---|
[137] | 78 |
|
---|
[826] | 79 | TOOL_GCC3PLAIN_CXXOBJSUFF ?= .o
|
---|
| 80 | TOOL_GCC3PLAIN_CXXOBJSUFF ?= .o
|
---|
| 81 | TOOL_GCC3PLAIN_CXXFLAGS ?=
|
---|
| 82 | TOOL_GCC3PLAIN_CXXFLAGS.debug ?= -g
|
---|
[1058] | 83 | TOOL_GCC3PLAIN_CXXFLAGS.profile ?= -O2 #-g -pg
|
---|
[826] | 84 | TOOL_GCC3PLAIN_CXXFLAGS.release ?= -O2
|
---|
| 85 | TOOL_GCC3PLAIN_CXXINCS ?=
|
---|
| 86 | TOOL_GCC3PLAIN_CXXDEFS ?=
|
---|
[667] | 87 |
|
---|
[826] | 88 | TOOL_GCC3PLAIN_ASFLAGS ?= -x assembler-with-cpp
|
---|
| 89 | TOOL_GCC3PLAIN_ASFLAGS.debug ?= -g
|
---|
| 90 | TOOL_GCC3PLAIN_ASFLAGS.profile ?= -g
|
---|
| 91 | TOOL_GCC3PLAIN_ASOBJSUFF ?= .o
|
---|
[667] | 92 |
|
---|
[826] | 93 | TOOL_GCC3PLAIN_ARFLAGS ?= cr
|
---|
| 94 | TOOL_GCC3PLAIN_ARLIBSUFF ?= .a
|
---|
[667] | 95 |
|
---|
[826] | 96 | TOOL_GCC3PLAIN_LDFLAGS ?=
|
---|
[667] | 97 |
|
---|
| 98 |
|
---|
[93] | 99 | ## Compile C source.
|
---|
| 100 | # @param $(target) Normalized main target name.
|
---|
| 101 | # @param $(source) Source filename (relative).
|
---|
[235] | 102 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
[93] | 103 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 104 | # @param $(flags) Flags.
|
---|
| 105 | # @param $(defs) Definitions. No -D or something.
|
---|
| 106 | # @param $(incs) Includes. No -I or something.
|
---|
[235] | 107 | # @param $(dirdep) Directory creation dependency.
|
---|
| 108 | # @param $(deps) Other dependencies.
|
---|
[93] | 109 | #
|
---|
| 110 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[235] | 111 | # @param $(objsuff) Object suffix.
|
---|
[826] | 112 | TOOL_GCC3PLAIN_COMPILE_C_DEPEND =
|
---|
| 113 | TOOL_GCC3PLAIN_COMPILE_C_DEPORD =
|
---|
[1418] | 114 | ifdef KBUILD_USE_KOBJCACHE
|
---|
[1015] | 115 | TOOL_GCC3PLAIN_COMPILE_C_USES_KOBJCACHE = 1
|
---|
| 116 | TOOL_GCC3PLAIN_COMPILE_C_OUTPUT = $(outbase).i
|
---|
[826] | 117 | define TOOL_GCC3PLAIN_COMPILE_C_CMDS
|
---|
[1058] | 118 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 119 | --kObjCache-cpp $(outbase).i\
|
---|
[1015] | 120 | $(TOOL_GCC3PLAIN_CC) -E -o -\
|
---|
[3566] | 121 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1015] | 122 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[1058] | 123 | $(abspath $(source))\
|
---|
| 124 | --kObjCache-cc $(obj)\
|
---|
[1015] | 125 | $(TOOL_GCC3PLAIN_CC) -c\
|
---|
[1058] | 126 | $(flags) -fpreprocessed -x c\
|
---|
[1015] | 127 | -o $(obj)\
|
---|
[1058] | 128 | -
|
---|
[2431] | 129 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[1015] | 130 | endef
|
---|
[1418] | 131 | else # !KBUILD_USE_KOBJCACHE
|
---|
[1015] | 132 | TOOL_GCC3PLAIN_COMPILE_C_OUTPUT =
|
---|
| 133 | define TOOL_GCC3PLAIN_COMPILE_C_CMDS
|
---|
[826] | 134 | $(QUIET)$(TOOL_GCC3PLAIN_CC) -c\
|
---|
[3566] | 135 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[380] | 136 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 137 | -o $(obj)\
|
---|
[697] | 138 | $(abspath $(source))
|
---|
[2431] | 139 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[93] | 140 | endef
|
---|
[1418] | 141 | endif # !KBUILD_USE_KOBJCACHE
|
---|
[93] | 142 |
|
---|
| 143 |
|
---|
| 144 | ## Compile C++ source.
|
---|
| 145 | # @param $(target) Normalized main target name.
|
---|
| 146 | # @param $(source) Source filename (relative).
|
---|
[235] | 147 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
[93] | 148 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 149 | # @param $(flags) Flags.
|
---|
| 150 | # @param $(defs) Definitions. No -D or something.
|
---|
| 151 | # @param $(incs) Includes. No -I or something.
|
---|
[235] | 152 | # @param $(dirdep) Directory creation dependency.
|
---|
| 153 | # @param $(deps) Other dependencies.
|
---|
[93] | 154 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[235] | 155 | # @param $(objsuff) Object suffix.
|
---|
[826] | 156 | TOOL_GCC3PLAIN_COMPILE_CXX_DEPEND =
|
---|
| 157 | TOOL_GCC3PLAIN_COMPILE_CXX_DEPORD =
|
---|
[1418] | 158 | ifdef KBUILD_USE_KOBJCACHE
|
---|
[1015] | 159 | TOOL_GCC3PLAIN_COMPILE_CXX_USES_KOBJCACHE = 1
|
---|
| 160 | TOOL_GCC3PLAIN_COMPILE_CXX_OUTPUT = $(outbase).ii
|
---|
[826] | 161 | define TOOL_GCC3PLAIN_COMPILE_CXX_CMDS
|
---|
[1058] | 162 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 163 | --kObjCache-cpp $(outbase).ii\
|
---|
[1015] | 164 | $(TOOL_GCC3PLAIN_CXX) -E -o -\
|
---|
[3566] | 165 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1015] | 166 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[1058] | 167 | $(abspath $(source))\
|
---|
| 168 | --kObjCache-cc $(obj)\
|
---|
[1015] | 169 | $(TOOL_GCC3PLAIN_CXX) -c\
|
---|
[1058] | 170 | $(flags) -fpreprocessed -x c++\
|
---|
[1015] | 171 | -o $(obj)\
|
---|
[1058] | 172 | -
|
---|
[2431] | 173 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[1015] | 174 | endef
|
---|
[1418] | 175 | else # !KBUILD_USE_KOBJCACHE
|
---|
[1015] | 176 | TOOL_GCC3PLAIN_COMPILE_CXX_OUTPUT =
|
---|
| 177 | define TOOL_GCC3PLAIN_COMPILE_CXX_CMDS
|
---|
[826] | 178 | $(QUIET)$(TOOL_GCC3PLAIN_CXX) -c\
|
---|
[3566] | 179 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[380] | 180 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 181 | -o $(obj)\
|
---|
[697] | 182 | $(abspath $(source))
|
---|
[2431] | 183 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[93] | 184 | endef
|
---|
[1418] | 185 | endif # !KBUILD_USE_KOBJCACHE
|
---|
[93] | 186 |
|
---|
| 187 |
|
---|
[461] | 188 | ## Compile Assembly source.
|
---|
| 189 | # @param $(target) Normalized main target name.
|
---|
| 190 | # @param $(source) Source filename (relative).
|
---|
| 191 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 192 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 193 | # @param $(flags) Flags.
|
---|
| 194 | # @param $(defs) Definitions. No -D or something.
|
---|
| 195 | # @param $(incs) Includes. No -I or something.
|
---|
| 196 | # @param $(dirdep) Directory creation dependency.
|
---|
| 197 | # @param $(deps) Other dependencies.
|
---|
| 198 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 199 | # @param $(objsuff) Object suffix.
|
---|
| 200 | #
|
---|
[826] | 201 | TOOL_GCC3PLAIN_COMPILE_AS_OUTPUT =
|
---|
| 202 | TOOL_GCC3PLAIN_COMPILE_AS_DEPEND =
|
---|
| 203 | TOOL_GCC3PLAIN_COMPILE_AS_DEPORD =
|
---|
| 204 | define TOOL_GCC3PLAIN_COMPILE_AS_CMDS
|
---|
| 205 | $(QUIET)$(TOOL_GCC3PLAIN_AS) -c\
|
---|
[3566] | 206 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[461] | 207 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 208 | -o $(obj)\
|
---|
[697] | 209 | $(abspath $(source))
|
---|
[2431] | 210 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[461] | 211 | endef
|
---|
| 212 |
|
---|
| 213 |
|
---|
[93] | 214 | ## Link library
|
---|
| 215 | # @param $(target) Normalized main target name.
|
---|
[380] | 216 | # @param $(out) Library name.
|
---|
[93] | 217 | # @param $(objs) Object files to put in the library.
|
---|
| 218 | # @param $(flags) Flags.
|
---|
[235] | 219 | # @param $(dirdep) Directory creation dependency.
|
---|
| 220 | # @param $(deps) Other dependencies.
|
---|
| 221 | # @param $(othersrc) Unhandled sources.
|
---|
[93] | 222 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[1098] | 223 | TOOL_GCC3PLAIN_LINK_LIBRARY_OUTPUT =
|
---|
[826] | 224 | TOOL_GCC3PLAIN_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
| 225 | TOOL_GCC3PLAIN_LINK_LIBRARY_DEPORD =
|
---|
| 226 | define TOOL_GCC3PLAIN_LINK_LIBRARY_CMDS
|
---|
[847] | 227 | $(call xargs,$(QUIET)$(TOOL_GCC3PLAIN_AR) $(flags) $(out),$(objs))
|
---|
| 228 | $(foreach lib,$(othersrc)\
|
---|
| 229 | ,$(NL)$(TAB)$(call MSG_AR_MERGE,$(target),$(out),$(lib)) \
|
---|
| 230 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))ar.tmp.dir/* \
|
---|
| 231 | $(NL)$(TAB)$(QUIET)$(MKDIR) -p $(dir $(outbase))/ar.tmp.dir/ \
|
---|
| 232 | $(NL)$(TAB)$(QUIET)(cd $(dir $(outbase))ar.tmp.dir/ \
|
---|
| 233 | && $(TOOL_GCC3PLAIN_AR) x $(abspath $(lib)) \
|
---|
| 234 | && $(TOOL_GCC3PLAIN_AR) $(flags) $(out) *) \
|
---|
| 235 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))/ar.tmp.dir/* \
|
---|
| 236 | $(NL)$(TAB)$(QUIET)$(RMDIR) $(dir $(outbase))ar.tmp.dir/)
|
---|
[826] | 237 | $(QUIET)$(TOOL_GCC3PLAIN_RANLIB) $(out)
|
---|
[772] | 238 | endef
|
---|
[206] | 239 |
|
---|
| 240 |
|
---|
[93] | 241 | ## Link program
|
---|
| 242 | # @param $(target) Normalized main target name.
|
---|
[353] | 243 | # @param $(out) Program name.
|
---|
[93] | 244 | # @param $(objs) Object files to link together.
|
---|
| 245 | # @param $(libs) Libraries to search.
|
---|
| 246 | # @param $(libpath) Library search paths.
|
---|
| 247 | # @param $(flags) Flags.
|
---|
[235] | 248 | # @param $(dirdep) Directory creation dependency.
|
---|
| 249 | # @param $(deps) Other dependencies.
|
---|
| 250 | # @param $(othersrc) Unhandled sources.
|
---|
| 251 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 252 | # @param $(custom_post) Custom step invoked after linking.
|
---|
[93] | 253 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[1033] | 254 | TOOL_GCC3PLAIN_LINK_PROGRAM_OUTPUT =
|
---|
| 255 | TOOL_GCC3PLAIN_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map
|
---|
[826] | 256 | TOOL_GCC3PLAIN_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
|
---|
[572] | 257 | $(filter %.def, $(othersrc))
|
---|
[826] | 258 | TOOL_GCC3PLAIN_LINK_PROGRAM_DEPORD =
|
---|
| 259 | define TOOL_GCC3PLAIN_LINK_PROGRAM_CMDS
|
---|
| 260 | $(QUIET)$(TOOL_GCC3PLAIN_LD) $(flags) -o $(out) $(objs)\
|
---|
[572] | 261 | $(filter %.def, $(othersrc))\
|
---|
[380] | 262 | $(foreach p,$(libpath), -L$(p))\
|
---|
[1259] | 263 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
|
---|
[93] | 264 | endef
|
---|
| 265 |
|
---|
[130] | 266 |
|
---|
| 267 | ## Link DLL
|
---|
| 268 | # @param $(target) Normalized main target name.
|
---|
[353] | 269 | # @param $(out) Program name.
|
---|
[130] | 270 | # @param $(objs) Object files to link together.
|
---|
| 271 | # @param $(libs) Libraries to search.
|
---|
| 272 | # @param $(libpath) Library search paths.
|
---|
| 273 | # @param $(flags) Flags.
|
---|
[235] | 274 | # @param $(dirdep) Directory creation dependency.
|
---|
| 275 | # @param $(deps) Other dependencies.
|
---|
| 276 | # @param $(othersrc) Unhandled sources.
|
---|
| 277 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 278 | # @param $(custom_post) Custom step invoked after linking.
|
---|
[130] | 279 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[1033] | 280 | TOOL_GCC3PLAIN_LINK_DLL_OUTPUT =
|
---|
| 281 | TOOL_GCC3PLAIN_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
|
---|
[826] | 282 | TOOL_GCC3PLAIN_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
|
---|
[572] | 283 | $(filter %.def, $(othersrc))
|
---|
[826] | 284 | TOOL_GCC3PLAIN_LINK_DLL_DEPORD =
|
---|
| 285 | define TOOL_GCC3PLAIN_LINK_DLL_CMDS
|
---|
| 286 | $(QUIET)$(TOOL_GCC3PLAIN_LD) $(TOOL_GCC3PLAIN_LDFLAGS.dll) $(flags) -o $(out)\
|
---|
[1504] | 287 | $(if $(filter-out win32 os2, $(KBUILD_TARGET)),$(call TOOL_GCC3PLAIN_LD_SONAME,$(target),$(out)))\
|
---|
[380] | 288 | $(objs)\
|
---|
[572] | 289 | $(filter %.def, $(othersrc))\
|
---|
[380] | 290 | $(foreach p,$(libpath), -L$(p))\
|
---|
[1259] | 291 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
|
---|
[130] | 292 | endef
|
---|
| 293 |
|
---|
[1084] | 294 |
|
---|
| 295 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
[1259] | 296 | # This tool target might not work everywhere, but is provided for the
|
---|
[1084] | 297 | # platforms where it works (Solaris, etc).
|
---|
| 298 | #
|
---|
| 299 | # @param $(target) Normalized main target name.
|
---|
| 300 | # @param $(out) System module name.
|
---|
| 301 | # @param $(objs) Object files to link together.
|
---|
| 302 | # @param $(libs) Libraries to search.
|
---|
| 303 | # @param $(libpath) Library search paths.
|
---|
| 304 | # @param $(flags) Flags.
|
---|
| 305 | # @param $(dirdep) Directory creation dependency.
|
---|
| 306 | # @param $(deps) Other dependencies.
|
---|
| 307 | # @param $(othersrc) Unhandled sources.
|
---|
| 308 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 309 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 310 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 311 | TOOL_GCC3PLAIN_LINK_SYSMOD_OUTPUT =
|
---|
| 312 | TOOL_GCC3PLAIN_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
|
---|
| 313 | TOOL_GCC3PLAIN_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
|
---|
| 314 | $(filter %.def, $(othersrc))
|
---|
| 315 | TOOL_GCC3PLAIN_LINK_SYSMOD_DEPORD =
|
---|
| 316 | define TOOL_GCC3PLAIN_LINK_SYSMOD_CMDS
|
---|
| 317 | $(QUIET)$(if $(TOOL_GCC3PLAIN_LD_SYSMOD.$(bld_trg)),$(TOOL_GCC3PLAIN_LD_SYSMOD.$(bld_trg)),$(TOOL_GCC3PLAIN_LD_SYSMOD))\
|
---|
| 318 | $(TOOL_GCC3PLAIN_LDFLAGS_SYSMOD.$(bld_trg)) $(flags) -o $(out)\
|
---|
| 319 | $(objs)\
|
---|
| 320 | $(filter %.def, $(othersrc))\
|
---|
| 321 | $(foreach p,$(libpath), -L$(p))\
|
---|
[1612] | 322 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
|
---|
[1084] | 323 | endef
|
---|
| 324 |
|
---|