[182] | 1 | # $Id: GCC3OMF.kmk 3567 2022-06-26 20:00:02Z bird $
|
---|
| 2 | ## @file
|
---|
[667] | 3 | # kBuild Tool Config - GCC v3 targeting OS/2 OMF.
|
---|
[182] | 4 | #
|
---|
[1547] | 5 |
|
---|
| 6 | #
|
---|
[3121] | 7 | # Copyright (c) 2004-2017 knut st. osmundsen <bird-kBuild-spam-xviiv@anduin.net>
|
---|
[182] | 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
|
---|
[2243] | 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 | #
|
---|
[182] | 33 |
|
---|
[667] | 34 | TOOL_GCC3OMF := GCC v3 targeting OS/2 OMF.
|
---|
[182] | 35 |
|
---|
[667] | 36 | # Tool Specific Properties
|
---|
[3393] | 37 | ifndef TOOL_GCC3OMF_PREFIX
|
---|
| 38 | TOOL_GCC3OMF_PREFIX :=
|
---|
| 39 | endif
|
---|
| 40 | ifndef TOOL_GCC3OMF_SUFFIX
|
---|
| 41 | TOOL_GCC3OMF_SUFFIX := $(HOSTSUFF_EXE)
|
---|
| 42 | endif
|
---|
| 43 | TOOL_GCC3OMF_PREFIX2 ?=
|
---|
| 44 | TOOL_GCC3OMF_SUFFIX2 ?= $(HOSTSUFF_EXE)
|
---|
| 45 | TOOL_GCC3OMF_PREFIX3 ?=
|
---|
| 46 | TOOL_GCC3OMF_SUFFIX3 ?= $(HOSTSUFF_EXE)
|
---|
| 47 | TOOL_GCC3OMF_CC ?= $(TOOL_GCC3OMF_PREFIX)gcc$(TOOL_GCC3OMF_SUFFIX)
|
---|
| 48 | TOOL_GCC3OMF_CXX ?= $(TOOL_GCC3OMF_PREFIX)g++$(TOOL_GCC3OMF_SUFFIX)
|
---|
| 49 | TOOL_GCC3OMF_AS ?= $(TOOL_GCC3OMF_PREFIX)gcc$(TOOL_GCC3OMF_SUFFIX)
|
---|
| 50 | TOOL_GCC3OMF_AR ?= $(TOOL_GCC3OMF_PREFIX2)emxomfar$(TOOL_GCC3OMF_SUFFIX2)
|
---|
| 51 | TOOL_GCC3OMF_AR_IMP ?= $(TOOL_GCC3OMF_PREFIX2)emximp$(TOOL_GCC3OMF_SUFFIX2)
|
---|
| 52 | TOOL_GCC3OMF_LD ?= $(TOOL_GCC3OMF_PREFIX)gcc$(TOOL_GCC3OMF_SUFFIX)
|
---|
| 53 | TOOL_GCC3OMF_LD_SYSMOD ?= $(TOOL_GCC3OMF_PREFIX)gcc$(TOOL_GCC3OMF_SUFFIX)
|
---|
[667] | 54 | TOOL_GCC3OMF_LDFLAGS.dll ?= -shared -Zdll
|
---|
| 55 | TOOL_GCC3OMF_LDFLAGS.sysmod ?= -nostdlib
|
---|
| 56 | TOOL_GCC3OMF_LD_MAP ?= -Zmap=$(1)
|
---|
| 57 | TOOL_GCC3OMF_LD_SYSMOD_MAP ?= -Zmap=$(1)
|
---|
[182] | 58 |
|
---|
[3393] | 59 | TOOL_GCC3OMF_RC = $(TOOL_GCC3OMF_PREFIX3)rc$(TOOL_GCC3OMF_SUFFIX3)
|
---|
| 60 |
|
---|
[667] | 61 | # General Properties used by kBuild
|
---|
| 62 | TOOL_GCC3OMF_COBJSUFF ?= .o
|
---|
| 63 | TOOL_GCC3OMF_CFLAGS ?= -Zomf
|
---|
| 64 | TOOL_GCC3OMF_CFLAGS.debug ?= -g
|
---|
[1058] | 65 | TOOL_GCC3OMF_CFLAGS.profile ?= -O2 #-g -pg
|
---|
[667] | 66 | TOOL_GCC3OMF_CFLAGS.release ?= -O2
|
---|
| 67 | TOOL_GCC3OMF_CINCS ?=
|
---|
| 68 | TOOL_GCC3OMF_CDEFS ?=
|
---|
[182] | 69 |
|
---|
[667] | 70 | TOOL_GCC3OMF_CXXOBJSUFF ?= .o
|
---|
| 71 | TOOL_GCC3OMF_CXXOBJSUFF ?= .o
|
---|
| 72 | TOOL_GCC3OMF_CXXFLAGS ?= -Zomf
|
---|
| 73 | TOOL_GCC3OMF_CXXFLAGS.debug ?= -g
|
---|
[1058] | 74 | TOOL_GCC3OMF_CXXFLAGS.profile ?= -O2 #-g -pg
|
---|
[667] | 75 | TOOL_GCC3OMF_CXXFLAGS.release ?= -O2
|
---|
| 76 | TOOL_GCC3OMF_CXXINCS ?=
|
---|
| 77 | TOOL_GCC3OMF_CXXDEFS ?=
|
---|
| 78 |
|
---|
[1062] | 79 | TOOL_GCC3OMF_ASFLAGS ?= -x assembler-with-cpp -Zomf
|
---|
[667] | 80 | TOOL_GCC3OMF_ASFLAGS.debug ?= -g
|
---|
| 81 | TOOL_GCC3OMF_ASFLAGS.profile ?= -g
|
---|
| 82 | TOOL_GCC3OMF_ASOBJSUFF ?= .obj
|
---|
| 83 |
|
---|
[2776] | 84 | TOOL_GCC3OMF_RCOBJSUFF ?= .res
|
---|
| 85 | TOOL_GCC3OMF_RCFLAGS ?= -n
|
---|
| 86 | TOOL_GCC3OMF_RCINCS ?= $(shell $(TOOL_GCC3OMF_CXX) -E -x c++ - 2>&1 < /dev/null \
|
---|
| 87 | | $(SED_EXT) -e "/search starts here/,/[Ee]nd of search list/!d" -e "/^ /!d")
|
---|
| 88 |
|
---|
[667] | 89 | TOOL_GCC3OMF_ARFLAGS ?= cr
|
---|
| 90 | TOOL_GCC3OMF_ARLIBSUFF ?= .lib
|
---|
| 91 |
|
---|
| 92 | TOOL_GCC3OMF_LDFLAGS ?= -Zomf
|
---|
| 93 | TOOL_GCC3OMF_LDFLAGS.debug ?= -g
|
---|
| 94 | TOOL_GCC3OMF_LDFLAGS.profile ?= -g
|
---|
| 95 |
|
---|
| 96 |
|
---|
[182] | 97 | ## Compile C source.
|
---|
| 98 | # @param $(target) Normalized main target name.
|
---|
| 99 | # @param $(source) Source filename (relative).
|
---|
[235] | 100 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
[182] | 101 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 102 | # @param $(flags) Flags.
|
---|
| 103 | # @param $(defs) Definitions. No -D or something.
|
---|
| 104 | # @param $(incs) Includes. No -I or something.
|
---|
[235] | 105 | # @param $(dirdep) Directory creation dependency.
|
---|
| 106 | # @param $(deps) Other dependencies.
|
---|
[182] | 107 | #
|
---|
| 108 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[235] | 109 | # @param $(objsuff) Object suffix.
|
---|
[380] | 110 | TOOL_GCC3OMF_COMPILE_C_DEPEND =
|
---|
| 111 | TOOL_GCC3OMF_COMPILE_C_DEPORD =
|
---|
[1418] | 112 | ifdef KBUILD_USE_KOBJCACHE
|
---|
[1015] | 113 | TOOL_GCC3OMF_COMPILE_C_USES_KOBJCACHE = 1
|
---|
| 114 | TOOL_GCC3OMF_COMPILE_C_OUTPUT = $(outbase).i
|
---|
[380] | 115 | define TOOL_GCC3OMF_COMPILE_C_CMDS
|
---|
[1058] | 116 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 117 | --kObjCache-cpp $(outbase).i\
|
---|
[1015] | 118 | $(TOOL_GCC3OMF_CC) -E -o -\
|
---|
[3566] | 119 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1015] | 120 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[1058] | 121 | $(abspath $(source))\
|
---|
| 122 | --kObjCache-cc $(obj)\
|
---|
[1015] | 123 | $(TOOL_GCC3OMF_CC) -c\
|
---|
[1058] | 124 | $(flags) -fpreprocessed -x c\
|
---|
[1015] | 125 | -o $(obj)\
|
---|
[1058] | 126 | -
|
---|
[2431] | 127 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[1015] | 128 | endef
|
---|
[1418] | 129 | else # !KBUILD_USE_KOBJCACHE
|
---|
[1015] | 130 | TOOL_GCC3OMF_COMPILE_C_OUTPUT =
|
---|
| 131 | define TOOL_GCC3OMF_COMPILE_C_CMDS
|
---|
[696] | 132 | $(QUIET)$(TOOL_GCC3OMF_CC) -c\
|
---|
[3566] | 133 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[380] | 134 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \
|
---|
| 135 | -o $(obj)\
|
---|
[697] | 136 | $(abspath $(source))
|
---|
[2431] | 137 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[182] | 138 | endef
|
---|
[1418] | 139 | endif # !KBUILD_USE_KOBJCACHE
|
---|
[182] | 140 |
|
---|
| 141 |
|
---|
| 142 | ## Compile C++ source.
|
---|
| 143 | # @param $(target) Normalized main target name.
|
---|
| 144 | # @param $(source) Source filename (relative).
|
---|
[235] | 145 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
[182] | 146 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 147 | # @param $(flags) Flags.
|
---|
| 148 | # @param $(defs) Definitions. No -D or something.
|
---|
| 149 | # @param $(incs) Includes. No -I or something.
|
---|
[235] | 150 | # @param $(dirdep) Directory creation dependency.
|
---|
| 151 | # @param $(deps) Other dependencies.
|
---|
[182] | 152 | #
|
---|
| 153 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[235] | 154 | # @param $(objsuff) Object suffix.
|
---|
[380] | 155 | TOOL_GCC3OMF_COMPILE_CXX_DEPEND =
|
---|
| 156 | TOOL_GCC3OMF_COMPILE_CXX_DEPORD =
|
---|
[1418] | 157 | ifdef KBUILD_USE_KOBJCACHE
|
---|
[1015] | 158 | TOOL_GCC3OMF_COMPILE_CXX_USES_KOBJCACHE = 1
|
---|
| 159 | TOOL_GCC3OMF_COMPILE_CXX_OUTPUT = $(outbase).ii
|
---|
[380] | 160 | define TOOL_GCC3OMF_COMPILE_CXX_CMDS
|
---|
[1058] | 161 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 162 | --kObjCache-cpp $(outbase).ii\
|
---|
[1015] | 163 | $(TOOL_GCC3OMF_CXX) -E -o -\
|
---|
[3566] | 164 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1015] | 165 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[1058] | 166 | $(abspath $(source))\
|
---|
| 167 | --kObjCache-cc $(obj)\
|
---|
[1015] | 168 | $(TOOL_GCC3OMF_CXX) -c\
|
---|
[1058] | 169 | $(flags) -fpreprocessed -x c++\
|
---|
[1015] | 170 | -o $(obj)\
|
---|
[1058] | 171 | -
|
---|
[2431] | 172 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[1015] | 173 | endef
|
---|
[1418] | 174 | else # !KBUILD_USE_KOBJCACHE
|
---|
[1015] | 175 | TOOL_GCC3OMF_COMPILE_CXX_OUTPUT =
|
---|
| 176 | define TOOL_GCC3OMF_COMPILE_CXX_CMDS
|
---|
[696] | 177 | $(QUIET)$(TOOL_GCC3OMF_CXX) -c\
|
---|
[3566] | 178 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[380] | 179 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \
|
---|
| 180 | -o $(obj)\
|
---|
[697] | 181 | $(abspath $(source))
|
---|
[2431] | 182 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[182] | 183 | endef
|
---|
[1418] | 184 | endif # !KBUILD_USE_KOBJCACHE
|
---|
[182] | 185 |
|
---|
| 186 |
|
---|
[465] | 187 | ## Compile Assembly source.
|
---|
| 188 | # @param $(target) Normalized main target name.
|
---|
| 189 | # @param $(source) Source filename (relative).
|
---|
| 190 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 191 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 192 | # @param $(flags) Flags.
|
---|
| 193 | # @param $(defs) Definitions. No -D or something.
|
---|
| 194 | # @param $(incs) Includes. No -I or something.
|
---|
| 195 | # @param $(dirdep) Directory creation dependency.
|
---|
| 196 | # @param $(deps) Other dependencies.
|
---|
| 197 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 198 | # @param $(objsuff) Object suffix.
|
---|
| 199 | #
|
---|
[469] | 200 | TOOL_GCC3OMF_COMPILE_AS_OUTPUT =
|
---|
[465] | 201 | TOOL_GCC3OMF_COMPILE_AS_DEPEND =
|
---|
| 202 | TOOL_GCC3OMF_COMPILE_AS_DEPORD =
|
---|
| 203 | define TOOL_GCC3OMF_COMPILE_AS_CMDS
|
---|
[696] | 204 | $(QUIET)$(TOOL_GCC3OMF_AS) -c\
|
---|
[3566] | 205 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[465] | 206 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 207 | -o $(obj)\
|
---|
[697] | 208 | $(abspath $(source))
|
---|
[2431] | 209 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[465] | 210 | endef
|
---|
| 211 |
|
---|
| 212 |
|
---|
[2776] | 213 | ## Compile resource source.
|
---|
| 214 | # @param $(target) Normalized main target name.
|
---|
| 215 | # @param $(source) Source filename (relative).
|
---|
| 216 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 217 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 218 | # @param $(flags) Flags.
|
---|
| 219 | # @param $(defs) Definitions. No -D or something.
|
---|
| 220 | # @param $(incs) Includes. No -I or something.
|
---|
| 221 | # @param $(dirdep) Directory creation dependency.
|
---|
| 222 | # @param $(deps) Other dependencies.
|
---|
| 223 | #
|
---|
| 224 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 225 | # @param $(objsuff) Object suffix.
|
---|
| 226 | TOOL_GCC3OMF_COMPILE_RC_OUTPUT =
|
---|
| 227 | TOOL_GCC3OMF_COMPILE_RC_DEPEND =
|
---|
| 228 | TOOL_GCC3OMF_COMPILE_RC_DEPORD =
|
---|
| 229 | define TOOL_GCC3OMF_COMPILE_RC_CMDS
|
---|
| 230 | $(QUIET)$(REDIRECT) -E 'INCLUDE=' -- $(TOOL_GCC3OMF_RC) -r \
|
---|
| 231 | $(flags) $(addprefix -i, $(subst /,\\,$(subst /@unixroot,$(UNIXROOT),$(incs)))) $(addprefix -d, $(defs))\
|
---|
| 232 | $(subst /,\\,$(abspath $(source))) \
|
---|
| 233 | $(obj)
|
---|
| 234 | endef
|
---|
[182] | 235 | ## Link library
|
---|
| 236 | # @param $(target) Normalized main target name.
|
---|
[380] | 237 | # @param $(out) Library name.
|
---|
[182] | 238 | # @param $(objs) Object files to put in the library.
|
---|
| 239 | # @param $(flags) Flags.
|
---|
[235] | 240 | # @param $(dirdep) Directory creation dependency.
|
---|
| 241 | # @param $(deps) Other dependencies.
|
---|
| 242 | # @param $(othersrc) Unhandled sources.
|
---|
[182] | 243 | #
|
---|
| 244 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[798] | 245 | TOOL_GCC3OMF_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
---|
| 246 | TOOL_GCC3OMF_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
[380] | 247 | TOOL_GCC3OMF_LINK_LIBRARY_DEPORD =
|
---|
| 248 | define TOOL_GCC3OMF_LINK_LIBRARY_CMDS
|
---|
[2775] | 249 | $(if $(filter %.def %.imp %.dll,$(othersrc))\
|
---|
| 250 | ,$(QUIET)$(APPEND) -n $(outbase).rsp $(filter %.def %.imp %.dll,$(othersrc))\
|
---|
[773] | 251 | $(NL)$(TAB)$(QUIET)$(QUIET)$(TOOL_GCC3OMF_AR_IMP) -o $(out) @$(outbase).rsp\
|
---|
| 252 | $(NL)$(TAB)$(QUIET)$(RM) -f $(outbase).rsp)
|
---|
[2775] | 253 | $(QUIET)$(APPEND) -n $(outbase).rsp $(flags) $(out) $(objs) $(filter-out %.def %.imp %.dll,$(othersrc))
|
---|
[2774] | 254 | $(QUIET)$(TOOL_GCC3OMF_AR) @$(outbase).rsp
|
---|
[182] | 255 | endef
|
---|
| 256 |
|
---|
| 257 |
|
---|
| 258 | ## Link program
|
---|
| 259 | # @param $(target) Normalized main target name.
|
---|
[353] | 260 | # @param $(out) Program name.
|
---|
[182] | 261 | # @param $(objs) Object files to link together.
|
---|
| 262 | # @param $(libs) Libraries to search.
|
---|
| 263 | # @param $(libpath) Library search paths.
|
---|
| 264 | # @param $(flags) Flags.
|
---|
[235] | 265 | # @param $(dirdep) Directory creation dependency.
|
---|
| 266 | # @param $(deps) Other dependencies.
|
---|
| 267 | # @param $(othersrc) Unhandled sources.
|
---|
| 268 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 269 | # @param $(custom_post) Custom step invoked after linking.
|
---|
[182] | 270 | #
|
---|
| 271 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[840] | 272 | TOOL_GCC3OMF_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp
|
---|
| 273 | TOOL_GCC3OMF_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
[380] | 274 | TOOL_GCC3OMF_LINK_PROGRAM_DEPORD =
|
---|
| 275 | define TOOL_GCC3OMF_LINK_PROGRAM_CMDS
|
---|
[840] | 276 | $(QUIET)$(APPEND) -n $(outbase).rsp\
|
---|
| 277 | $(flags)\
|
---|
| 278 | -o $(out)\
|
---|
| 279 | $(objs)\
|
---|
[380] | 280 | $(foreach p,$(libpath), -L$(p))\
|
---|
[840] | 281 | $(othersrc)\
|
---|
[1259] | 282 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
---|
[840] | 283 | -Zmap=$(outbase).map
|
---|
| 284 | $(QUIET)$(TOOL_GCC3OMF_LD) @$(outbase).rsp
|
---|
[182] | 285 | endef
|
---|
| 286 |
|
---|
| 287 |
|
---|
| 288 | ## Link DLL
|
---|
| 289 | # @param $(target) Normalized main target name.
|
---|
[353] | 290 | # @param $(out) Program name.
|
---|
[182] | 291 | # @param $(objs) Object files to link together.
|
---|
| 292 | # @param $(libs) Libraries to search.
|
---|
| 293 | # @param $(libpath) Library search paths.
|
---|
| 294 | # @param $(flags) Flags.
|
---|
[235] | 295 | # @param $(dirdep) Directory creation dependency.
|
---|
| 296 | # @param $(deps) Other dependencies.
|
---|
| 297 | # @param $(othersrc) Unhandled sources.
|
---|
| 298 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 299 | # @param $(custom_post) Custom step invoked after linking.
|
---|
[182] | 300 | #
|
---|
| 301 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[840] | 302 | TOOL_GCC3OMF_LINK_DLL_OUTPUT = $(outbase).map $(outbase).rsp
|
---|
| 303 | TOOL_GCC3OMF_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
[380] | 304 | TOOL_GCC3OMF_LINK_DLL_DEPORD =
|
---|
| 305 | define TOOL_GCC3OMF_LINK_DLL_CMDS
|
---|
[840] | 306 | $(QUIET)$(APPEND) -n $(outbase).rsp\
|
---|
| 307 | $(TOOL_GCC3OMF_LDFLAGS.dll)\
|
---|
| 308 | $(flags)\
|
---|
| 309 | -o $(out)\
|
---|
| 310 | $(objs)\
|
---|
[380] | 311 | $(foreach p,$(libpath), -L$(p))\
|
---|
[840] | 312 | $(othersrc)\
|
---|
[1259] | 313 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
---|
[840] | 314 | -Zmap=$(outbase).map
|
---|
[2774] | 315 | $(QUIET)$(TOOL_GCC3OMF_LD) @$(outbase).rsp
|
---|
[182] | 316 | endef
|
---|
| 317 |
|
---|
[840] | 318 |
|
---|
[182] | 319 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
| 320 | # @param $(target) Normalized main target name.
|
---|
[353] | 321 | # @param $(out) System module name.
|
---|
[182] | 322 | # @param $(objs) Object files to link together.
|
---|
| 323 | # @param $(libs) Libraries to search.
|
---|
| 324 | # @param $(libpath) Library search paths.
|
---|
| 325 | # @param $(flags) Flags.
|
---|
[235] | 326 | # @param $(dirdep) Directory creation dependency.
|
---|
| 327 | # @param $(deps) Other dependencies.
|
---|
| 328 | # @param $(othersrc) Unhandled sources.
|
---|
| 329 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 330 | # @param $(custom_post) Custom step invoked after linking.
|
---|
[182] | 331 | #
|
---|
| 332 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[840] | 333 | TOOL_GCC3OMF_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp
|
---|
| 334 | TOOL_GCC3OMF_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
[380] | 335 | TOOL_GCC3OMF_LINK_SYSMOD_DEPORD =
|
---|
| 336 | define TOOL_GCC3OMF_LINK_SYSMOD_CMDS
|
---|
[840] | 337 | $(QUIET)$(APPEND) -n $(outbase).rsp\
|
---|
| 338 | $(TOOL_GCC3OMF_LDFLAGS.sysmod)\
|
---|
| 339 | $(flags)\
|
---|
| 340 | -o $(out)\
|
---|
| 341 | $(objs)\
|
---|
[380] | 342 | $(foreach p,$(libpath), -L$(p))\
|
---|
[840] | 343 | $(othersrc)\
|
---|
[1259] | 344 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
---|
[840] | 345 | -Zmap=$(outbase).map
|
---|
| 346 | $(QUIET)$(TOOL_GCC3OMF_LD_SYSMOD) @$(outbase).rsp
|
---|
[182] | 347 | endef
|
---|
[184] | 348 |
|
---|