[93] | 1 | # $Id: GXX3PLAIN.kmk 3567 2022-06-26 20:00:02Z bird $
|
---|
| 2 | ## @file
|
---|
[971] | 3 | # kBuild Tool Config - Generic GCC v3.2.x or later using the system GCC, any Unix linker and Unix archiver to build C++ code.
|
---|
[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 |
|
---|
[971] | 34 | TOOL_GXX3PLAIN := Generic GCC v3.2.x or later using the system GCC, any Unix linker and Unix archiver to build C++ code.
|
---|
[93] | 35 |
|
---|
[667] | 36 | # Tool Specific Properties
|
---|
[3391] | 37 | ifndef TOOL_GXX3PLAIN_PREFIX
|
---|
| 38 | TOOL_GXX3PLAIN_PREFIX :=
|
---|
| 39 | endif
|
---|
| 40 | ifndef TOOL_GXX3PLAIN_SUFFIX
|
---|
| 41 | TOOL_GXX3PLAIN_SUFFIX := $(HOSTSUFF_EXE)
|
---|
| 42 | endif
|
---|
[3393] | 43 | TOOL_GXX3PLAIN_PREFIX2 ?=
|
---|
| 44 | TOOL_GXX3PLAIN_SUFFIX2 ?= $(HOSTSUFF_EXE)
|
---|
[3391] | 45 | TOOL_GXX3PLAIN_CC ?= $(TOOL_GXX3PLAIN_PREFIX)gcc$(TOOL_GXX3PLAIN_SUFFIX)
|
---|
| 46 | TOOL_GXX3PLAIN_CXX ?= $(TOOL_GXX3PLAIN_PREFIX)g++$(TOOL_GXX3PLAIN_SUFFIX)
|
---|
| 47 | TOOL_GXX3PLAIN_PCH ?= $(TOOL_GXX3PLAIN_CXX)
|
---|
| 48 | TOOL_GXX3PLAIN_AS ?= $(TOOL_GXX3PLAIN_PREFIX)gcc$(TOOL_GXX3PLAIN_SUFFIX)
|
---|
[3393] | 49 | TOOL_GXX3PLAIN_AR ?= $(TOOL_GXX3PLAIN_PREFIX2)ar$(TOOL_GXX3PLAIN_SUFFIX2)
|
---|
| 50 | TOOL_GXX3PLAIN_RANLIB ?= $(TOOL_GXX3PLAIN_PREFIX2)ranlib$(TOOL_GXX3PLAIN_SUFFIX2)
|
---|
[3391] | 51 | TOOL_GXX3PLAIN_LD ?= $(TOOL_GXX3PLAIN_PREFIX)g++$(TOOL_GXX3PLAIN_SUFFIX)
|
---|
[3393] | 52 | TOOL_GXX3PLAIN_LD_SYSMOD ?= $(TOOL_GXX3PLAIN_PREFIX2)ld$(TOOL_GXX3PLAIN_SUFFIX2)
|
---|
[3391] | 53 | TOOL_GXX3PLAIN_LD_SYSMOD.os2 ?= $(TOOL_GXX3PLAIN_PREFIX)g++$(TOOL_GXX3PLAIN_SUFFIX)
|
---|
[971] | 54 | TOOL_GXX3PLAIN_LDFLAGS.dll.os2 ?= -Zdll
|
---|
| 55 | TOOL_GXX3PLAIN_LDFLAGS.dll.darwin ?= -dynamiclib
|
---|
[1504] | 56 | ifndef TOOL_GXX3PLAIN_LDFLAGS.$(KBUILD_TARGET)
|
---|
[971] | 57 | TOOL_GXX3PLAIN_LDFLAGS.dll ?= -shared
|
---|
[847] | 58 | else
|
---|
[1504] | 59 | TOOL_GXX3PLAIN_LDFLAGS.dll ?= $(TOOL_GXX3PLAIN_LDFLAGS.$(KBUILD_TARGET))
|
---|
[847] | 60 | endif
|
---|
[971] | 61 | TOOL_GXX3PLAIN_LD_SONAME.darwin ?= $(NO_SUCH_VARIABLE)
|
---|
| 62 | TOOL_GXX3PLAIN_LD_SONAME.os2 ?= $(NO_SUCH_VARIABLE)
|
---|
[1504] | 63 | TOOL_GXX3PLAIN_LD_SONAME.solaris ?= -Wl,-h,$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2)))
|
---|
[971] | 64 | TOOL_GXX3PLAIN_LD_SONAME.win ?= $(NO_SUCH_VARIABLE)
|
---|
[1504] | 65 | ifndef TOOL_GXX3PLAIN_LD_SONAME.$(KBUILD_TARGET)
|
---|
| 66 | TOOL_GXX3PLAIN_LD_SONAME ?= -Wl,-soname=$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2)))
|
---|
[847] | 67 | else
|
---|
[1504] | 68 | TOOL_GXX3PLAIN_LD_SONAME ?= $(TOOL_GXX3PLAIN_LD_SONAME.$(KBUILD_TARGET))
|
---|
[847] | 69 | endif
|
---|
[93] | 70 |
|
---|
[667] | 71 | # General Properties used by kBuild
|
---|
[971] | 72 | TOOL_GXX3PLAIN_COBJSUFF ?= .o
|
---|
| 73 | TOOL_GXX3PLAIN_CFLAGS ?=
|
---|
| 74 | TOOL_GXX3PLAIN_CFLAGS.debug ?= -g
|
---|
[1058] | 75 | TOOL_GXX3PLAIN_CFLAGS.profile ?= -O2 #-g -pg
|
---|
[971] | 76 | TOOL_GXX3PLAIN_CFLAGS.release ?= -O2
|
---|
| 77 | TOOL_GXX3PLAIN_CINCS ?=
|
---|
| 78 | TOOL_GXX3PLAIN_CDEFS ?=
|
---|
[137] | 79 |
|
---|
[971] | 80 | TOOL_GXX3PLAIN_CXXOBJSUFF ?= .o
|
---|
| 81 | TOOL_GXX3PLAIN_CXXFLAGS ?=
|
---|
| 82 | TOOL_GXX3PLAIN_CXXFLAGS.debug ?= -g
|
---|
[1058] | 83 | TOOL_GXX3PLAIN_CXXFLAGS.profile ?= -O2 #-g -pg
|
---|
[971] | 84 | TOOL_GXX3PLAIN_CXXFLAGS.release ?= -O2
|
---|
| 85 | TOOL_GXX3PLAIN_CXXINCS ?=
|
---|
| 86 | TOOL_GXX3PLAIN_CXXDEFS ?=
|
---|
[667] | 87 |
|
---|
[3258] | 88 | TOOL_GXX3PLAIN_PCHOBJSUFF ?= .h.gch
|
---|
| 89 | TOOL_GXX3PLAIN_PCHFLAGS ?= $(TOOL_GXX3PLAIN_CXXFLAGS)
|
---|
| 90 | TOOL_GXX3PLAIN_PCHFLAGS.debug ?= $(TOOL_GXX3PLAIN_CXXFLAGS.debug)
|
---|
| 91 | TOOL_GXX3PLAIN_PCHFLAGS.profile ?= $(TOOL_GXX3PLAIN_CXXFLAGS.profile)
|
---|
| 92 | TOOL_GXX3PLAIN_PCHFLAGS.release ?= $(TOOL_GXX3PLAIN_CXXFLAGS.release)
|
---|
| 93 | TOOL_GXX3PLAIN_PCHINCS ?= $(TOOL_GXX3PLAIN_CXXINCS)
|
---|
| 94 | TOOL_GXX3PLAIN_PCHDEFS ?= $(TOOL_GXX3PLAIN_CXXDEFS)
|
---|
| 95 |
|
---|
[971] | 96 | TOOL_GXX3PLAIN_ASFLAGS ?= -x assembler-with-cpp
|
---|
| 97 | TOOL_GXX3PLAIN_ASFLAGS.debug ?= -g
|
---|
| 98 | TOOL_GXX3PLAIN_ASFLAGS.profile ?= -g
|
---|
| 99 | TOOL_GXX3PLAIN_ASOBJSUFF ?= .o
|
---|
[667] | 100 |
|
---|
[971] | 101 | TOOL_GXX3PLAIN_ARFLAGS ?= cr
|
---|
| 102 | TOOL_GXX3PLAIN_ARLIBSUFF ?= .a
|
---|
[667] | 103 |
|
---|
[971] | 104 | TOOL_GXX3PLAIN_LDFLAGS ?=
|
---|
[667] | 105 |
|
---|
| 106 |
|
---|
[93] | 107 | ## Compile C source.
|
---|
| 108 | # @param $(target) Normalized main target name.
|
---|
| 109 | # @param $(source) Source filename (relative).
|
---|
[235] | 110 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
[93] | 111 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 112 | # @param $(flags) Flags.
|
---|
| 113 | # @param $(defs) Definitions. No -D or something.
|
---|
| 114 | # @param $(incs) Includes. No -I or something.
|
---|
[235] | 115 | # @param $(dirdep) Directory creation dependency.
|
---|
| 116 | # @param $(deps) Other dependencies.
|
---|
[93] | 117 | #
|
---|
| 118 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[235] | 119 | # @param $(objsuff) Object suffix.
|
---|
[971] | 120 | TOOL_GXX3PLAIN_COMPILE_C_DEPEND =
|
---|
[1090] | 121 | TOOL_GXX3PLAIN_COMPILE_C_DEPORD =
|
---|
[3258] | 122 | TOOL_GXX3PLAIN_COMPILE_C_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).i,)
|
---|
| 123 | TOOL_GXX3PLAIN_COMPILE_C_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,)
|
---|
[1015] | 124 | define TOOL_GXX3PLAIN_COMPILE_C_CMDS
|
---|
[3258] | 125 | if "$(use_objcache)" != ""
|
---|
[1058] | 126 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 127 | --kObjCache-cpp $(outbase).i\
|
---|
[1015] | 128 | $(TOOL_GXX3PLAIN_CC) -E -o -\
|
---|
[3566] | 129 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1015] | 130 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[1058] | 131 | $(abspath $(source))\
|
---|
| 132 | --kObjCache-cc $(obj)\
|
---|
[1015] | 133 | $(TOOL_GXX3PLAIN_CC) -c\
|
---|
[1058] | 134 | $(flags) -fpreprocessed -x c\
|
---|
[1015] | 135 | -o $(obj)\
|
---|
[1058] | 136 | -
|
---|
[3258] | 137 | else
|
---|
[971] | 138 | $(QUIET)$(TOOL_GXX3PLAIN_CC) -c\
|
---|
[3566] | 139 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[380] | 140 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 141 | -o $(obj)\
|
---|
[697] | 142 | $(abspath $(source))
|
---|
[3258] | 143 | endif
|
---|
[2431] | 144 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[93] | 145 | endef
|
---|
| 146 |
|
---|
| 147 |
|
---|
| 148 | ## Compile C++ source.
|
---|
| 149 | # @param $(target) Normalized main target name.
|
---|
| 150 | # @param $(source) Source filename (relative).
|
---|
[235] | 151 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
[3258] | 152 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
[93] | 153 | # @param $(flags) Flags.
|
---|
| 154 | # @param $(defs) Definitions. No -D or something.
|
---|
| 155 | # @param $(incs) Includes. No -I or something.
|
---|
[235] | 156 | # @param $(dirdep) Directory creation dependency.
|
---|
[3258] | 157 | # @param $(deps) Other dependencies.
|
---|
[93] | 158 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[235] | 159 | # @param $(objsuff) Object suffix.
|
---|
[3258] | 160 | TOOL_GXX3PLAIN_COMPILE_CXX_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).ii,)
|
---|
| 161 | TOOL_GXX3PLAIN_COMPILE_CXX_DEPEND = $($(target)_1_GCC_PCH_FILE)
|
---|
| 162 | TOOL_GXX3PLAIN_COMPILE_CXX_DEPORD =
|
---|
| 163 | TOOL_GXX3PLAIN_COMPILE_CXX_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,)
|
---|
[971] | 164 | define TOOL_GXX3PLAIN_COMPILE_CXX_CMDS
|
---|
[3258] | 165 | if "$(use_objcache)" != ""
|
---|
[1058] | 166 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 167 | --kObjCache-cpp $(outbase).ii\
|
---|
[3258] | 168 | $(TOOL_GXX3PLAIN_CXX) -E -o - $(if-expr defined($(target)_PCH_HDR)\
|
---|
| 169 | ,-fpch-preprocess -Winvalid-pch -I$($(target)_1_GCC_PCH_DIR) -include $(basename $($(target)_1_GCC_PCH_FILE)),)\
|
---|
[3566] | 170 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1015] | 171 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[1058] | 172 | $(abspath $(source))\
|
---|
| 173 | --kObjCache-cc $(obj)\
|
---|
[1015] | 174 | $(TOOL_GXX3PLAIN_CXX) -c\
|
---|
[3258] | 175 | $(flags) -fpreprocessed $(if-expr defined($(target)_PCH_HDR),-fpch-preprocess,) -x c++\
|
---|
[1015] | 176 | -o $(obj)\
|
---|
[1058] | 177 | -
|
---|
[3258] | 178 | else
|
---|
| 179 | $(QUIET)$(TOOL_GXX3PLAIN_CXX) -c\
|
---|
[3566] | 180 | $(flags) $(qaddprefix sh,-I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[3258] | 181 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 182 | -o $(obj) $(if-expr defined($(target)_PCH_HDR) \
|
---|
| 183 | ,-Winvalid-pch -include $(basename $($(target)_1_GCC_PCH_FILE)),) \
|
---|
| 184 | $(abspath $(source))
|
---|
| 185 | endif
|
---|
[2431] | 186 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[1015] | 187 | endef
|
---|
[3258] | 188 |
|
---|
| 189 |
|
---|
| 190 | ## Precompile C++ header.
|
---|
| 191 | # @param $(target) Normalized main target name.
|
---|
| 192 | # @param $(source) Source filename (relative).
|
---|
| 193 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 194 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 195 | # @param $(flags) Flags.
|
---|
| 196 | # @param $(defs) Definitions. No -D or something.
|
---|
| 197 | # @param $(incs) Includes. No -I or something.
|
---|
| 198 | # @param $(dirdep) Directory creation dependency.
|
---|
| 199 | # @param $(deps) Other dependencies.
|
---|
| 200 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 201 | # @param $(objsuff) Object suffix.
|
---|
| 202 | TOOL_GXX3PLAIN_COMPILE_PCH_OUTPUT = $($(target)_1_GCC_PCH_FILE)
|
---|
| 203 | TOOL_GXX3PLAIN_COMPILE_PCH_DEPEND =
|
---|
| 204 | TOOL_GXX3PLAIN_COMPILE_PCH_DEPORD = $($(target)_1_GCC_PCH_DIR)
|
---|
| 205 | define TOOL_GXX3PLAIN_COMPILE_PCH_CMDS
|
---|
| 206 | $(QUIET)$(TOOL_GXX3PLAIN_PCH) -c\
|
---|
[3566] | 207 | $(flags) $(qaddprefix sh,-I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[380] | 208 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 209 | -o $(obj)\
|
---|
[697] | 210 | $(abspath $(source))
|
---|
[3258] | 211 | $(INSTALL) --hard-link-files-when-possible -m 0644 -- "$(obj)" "$($(target)_1_GCC_PCH_FILE)"
|
---|
[2431] | 212 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[93] | 213 | endef
|
---|
| 214 |
|
---|
| 215 |
|
---|
[461] | 216 | ## Compile Assembly source.
|
---|
| 217 | # @param $(target) Normalized main target name.
|
---|
| 218 | # @param $(source) Source filename (relative).
|
---|
| 219 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 220 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 221 | # @param $(flags) Flags.
|
---|
| 222 | # @param $(defs) Definitions. No -D or something.
|
---|
| 223 | # @param $(incs) Includes. No -I or something.
|
---|
| 224 | # @param $(dirdep) Directory creation dependency.
|
---|
| 225 | # @param $(deps) Other dependencies.
|
---|
| 226 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 227 | # @param $(objsuff) Object suffix.
|
---|
| 228 | #
|
---|
[971] | 229 | TOOL_GXX3PLAIN_COMPILE_AS_OUTPUT =
|
---|
| 230 | TOOL_GXX3PLAIN_COMPILE_AS_DEPEND =
|
---|
| 231 | TOOL_GXX3PLAIN_COMPILE_AS_DEPORD =
|
---|
| 232 | define TOOL_GXX3PLAIN_COMPILE_AS_CMDS
|
---|
| 233 | $(QUIET)$(TOOL_GXX3PLAIN_AS) -c\
|
---|
[3566] | 234 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[461] | 235 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 236 | -o $(obj)\
|
---|
[697] | 237 | $(abspath $(source))
|
---|
[2431] | 238 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[461] | 239 | endef
|
---|
| 240 |
|
---|
| 241 |
|
---|
[93] | 242 | ## Link library
|
---|
| 243 | # @param $(target) Normalized main target name.
|
---|
[380] | 244 | # @param $(out) Library name.
|
---|
[93] | 245 | # @param $(objs) Object files to put in the library.
|
---|
| 246 | # @param $(flags) Flags.
|
---|
[235] | 247 | # @param $(dirdep) Directory creation dependency.
|
---|
| 248 | # @param $(deps) Other dependencies.
|
---|
| 249 | # @param $(othersrc) Unhandled sources.
|
---|
[93] | 250 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[1099] | 251 | TOOL_GXX3PLAIN_LINK_LIBRARY_OUTPUT =
|
---|
[971] | 252 | TOOL_GXX3PLAIN_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
| 253 | TOOL_GXX3PLAIN_LINK_LIBRARY_DEPORD =
|
---|
| 254 | define TOOL_GXX3PLAIN_LINK_LIBRARY_CMDS
|
---|
[3258] | 255 | $(call xargs,$(QUIET)$(TOOL_GXX3PLAIN_AR) $(flags) $(out),$(filter-out %.h.gch,$(objs)))
|
---|
[847] | 256 | $(foreach lib,$(othersrc)\
|
---|
| 257 | ,$(NL)$(TAB)$(call MSG_AR_MERGE,$(target),$(out),$(lib)) \
|
---|
| 258 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))ar.tmp.dir/* \
|
---|
| 259 | $(NL)$(TAB)$(QUIET)$(MKDIR) -p $(dir $(outbase))/ar.tmp.dir/ \
|
---|
| 260 | $(NL)$(TAB)$(QUIET)(cd $(dir $(outbase))ar.tmp.dir/ \
|
---|
[971] | 261 | && $(TOOL_GXX3PLAIN_AR) x $(abspath $(lib)) \
|
---|
| 262 | && $(TOOL_GXX3PLAIN_AR) $(flags) $(out) *) \
|
---|
[847] | 263 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))/ar.tmp.dir/* \
|
---|
| 264 | $(NL)$(TAB)$(QUIET)$(RMDIR) $(dir $(outbase))ar.tmp.dir/)
|
---|
[971] | 265 | $(QUIET)$(TOOL_GXX3PLAIN_RANLIB) $(out)
|
---|
[772] | 266 | endef
|
---|
[206] | 267 |
|
---|
| 268 |
|
---|
[93] | 269 | ## Link program
|
---|
| 270 | # @param $(target) Normalized main target name.
|
---|
[353] | 271 | # @param $(out) Program name.
|
---|
[93] | 272 | # @param $(objs) Object files to link together.
|
---|
| 273 | # @param $(libs) Libraries to search.
|
---|
| 274 | # @param $(libpath) Library search paths.
|
---|
| 275 | # @param $(flags) Flags.
|
---|
[235] | 276 | # @param $(dirdep) Directory creation dependency.
|
---|
| 277 | # @param $(deps) Other dependencies.
|
---|
| 278 | # @param $(othersrc) Unhandled sources.
|
---|
| 279 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 280 | # @param $(custom_post) Custom step invoked after linking.
|
---|
[93] | 281 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[1034] | 282 | TOOL_GXX3PLAIN_LINK_PROGRAM_OUTPUT =
|
---|
| 283 | TOOL_GXX3PLAIN_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map
|
---|
[971] | 284 | TOOL_GXX3PLAIN_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
|
---|
[572] | 285 | $(filter %.def, $(othersrc))
|
---|
[971] | 286 | TOOL_GXX3PLAIN_LINK_PROGRAM_DEPORD =
|
---|
| 287 | define TOOL_GXX3PLAIN_LINK_PROGRAM_CMDS
|
---|
[3258] | 288 | $(QUIET)$(TOOL_GXX3PLAIN_LD) $(flags) -o $(out) $(filter-out %.h.gch,$(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)))
|
---|
[93] | 292 | endef
|
---|
| 293 |
|
---|
[130] | 294 |
|
---|
| 295 | ## Link DLL
|
---|
| 296 | # @param $(target) Normalized main target name.
|
---|
[353] | 297 | # @param $(out) Program name.
|
---|
[130] | 298 | # @param $(objs) Object files to link together.
|
---|
| 299 | # @param $(libs) Libraries to search.
|
---|
| 300 | # @param $(libpath) Library search paths.
|
---|
| 301 | # @param $(flags) Flags.
|
---|
[235] | 302 | # @param $(dirdep) Directory creation dependency.
|
---|
| 303 | # @param $(deps) Other dependencies.
|
---|
| 304 | # @param $(othersrc) Unhandled sources.
|
---|
| 305 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 306 | # @param $(custom_post) Custom step invoked after linking.
|
---|
[130] | 307 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[1034] | 308 | TOOL_GXX3PLAIN_LINK_DLL_OUTPUT =
|
---|
| 309 | TOOL_GXX3PLAIN_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
|
---|
[971] | 310 | TOOL_GXX3PLAIN_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
|
---|
[572] | 311 | $(filter %.def, $(othersrc))
|
---|
[971] | 312 | TOOL_GXX3PLAIN_LINK_DLL_DEPORD =
|
---|
| 313 | define TOOL_GXX3PLAIN_LINK_DLL_CMDS
|
---|
| 314 | $(QUIET)$(TOOL_GXX3PLAIN_LD) $(TOOL_GXX3PLAIN_LDFLAGS.dll) $(flags) -o $(out)\
|
---|
[1504] | 315 | $(if $(filter-out win32 os2, $(KBUILD_TARGET)),$(call TOOL_GXX3PLAIN_LD_SONAME,$(target),$(out)))\
|
---|
[3258] | 316 | $(filter-out %.h.gch,$(objs))\
|
---|
[572] | 317 | $(filter %.def, $(othersrc))\
|
---|
[380] | 318 | $(foreach p,$(libpath), -L$(p))\
|
---|
[1259] | 319 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
|
---|
[130] | 320 | endef
|
---|
| 321 |
|
---|
[1084] | 322 |
|
---|
| 323 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
[1259] | 324 | # This tool target might not work everywhere, but is provided for the
|
---|
[1084] | 325 | # platforms where it works (Solaris, etc).
|
---|
| 326 | #
|
---|
| 327 | # @param $(target) Normalized main target name.
|
---|
| 328 | # @param $(out) System module name.
|
---|
| 329 | # @param $(objs) Object files to link together.
|
---|
| 330 | # @param $(libs) Libraries to search.
|
---|
| 331 | # @param $(libpath) Library search paths.
|
---|
| 332 | # @param $(flags) Flags.
|
---|
| 333 | # @param $(dirdep) Directory creation dependency.
|
---|
| 334 | # @param $(deps) Other dependencies.
|
---|
| 335 | # @param $(othersrc) Unhandled sources.
|
---|
| 336 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 337 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 338 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 339 | TOOL_GXX3PLAIN_LINK_SYSMOD_OUTPUT =
|
---|
| 340 | TOOL_GXX3PLAIN_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
|
---|
| 341 | TOOL_GXX3PLAIN_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
|
---|
| 342 | $(filter %.def, $(othersrc))
|
---|
| 343 | TOOL_GXX3PLAIN_LINK_SYSMOD_DEPORD =
|
---|
| 344 | define TOOL_GXX3PLAIN_LINK_SYSMOD_CMDS
|
---|
| 345 | $(QUIET)$(if $(TOOL_GXX3PLAIN_LD_SYSMOD.$(bld_trg)),$(TOOL_GXX3PLAIN_LD_SYSMOD.$(bld_trg)),$(TOOL_GXX3PLAIN_LD_SYSMOD))\
|
---|
| 346 | $(TOOL_GXX3PLAIN_LDFLAGS_SYSMOD.$(bld_trg)) $(flags) -o $(out) \
|
---|
[3258] | 347 | $(filter-out %.h.gch,$(objs))\
|
---|
[1084] | 348 | $(filter %.def, $(othersrc))\
|
---|
| 349 | $(foreach p,$(libpath), -L$(p))\
|
---|
[1612] | 350 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
|
---|
[1084] | 351 | endef
|
---|
| 352 |
|
---|