| 1 | # $Id: GXX3OMF.kmk 3567 2022-06-26 20:00:02Z bird $
|
|---|
| 2 | ## @file
|
|---|
| 3 | # kBuild Tool Config - GCC v3 targeting OS/2 OMF, for building C++ code.
|
|---|
| 4 | #
|
|---|
| 5 |
|
|---|
| 6 | #
|
|---|
| 7 | # Copyright (c) 2004-2017 knut st. osmundsen <bird-kBuild-spam-xviiv@anduin.net>
|
|---|
| 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 | #
|
|---|
| 26 | # As a special exception you are granted permission to include this file, via
|
|---|
| 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.
|
|---|
| 29 | # This exception does not however invalidate any other reasons why the makefile,
|
|---|
| 30 | # program, whatever should not be covered the GPL.
|
|---|
| 31 | #
|
|---|
| 32 | #
|
|---|
| 33 |
|
|---|
| 34 | TOOL_GXX3OMF := GCC v3 targeting OS/2 OMF, for building C++ code.
|
|---|
| 35 |
|
|---|
| 36 | # Tool Specific Properties
|
|---|
| 37 | ifndef TOOL_GXX3OMF_PREFIX
|
|---|
| 38 | TOOL_GXX3OMF_PREFIX :=
|
|---|
| 39 | endif
|
|---|
| 40 | ifndef TOOL_GXX3OMF_SUFFIX
|
|---|
| 41 | TOOL_GXX3OMF_SUFFIX := $(HOSTSUFF_EXE)
|
|---|
| 42 | endif
|
|---|
| 43 | TOOL_GXX3OMF_PREFIX2 ?=
|
|---|
| 44 | TOOL_GXX3OMF_SUFFIX2 ?= $(HOSTSUFF_EXE)
|
|---|
| 45 | TOOL_GXX3OMF_PREFIX3 ?=
|
|---|
| 46 | TOOL_GXX3OMF_SUFFIX3 ?= $(HOSTSUFF_EXE)
|
|---|
| 47 | TOOL_GXX3OMF_CC ?= $(TOOL_GXX3OMF_PREFIX)gcc$(TOOL_GXX3OMF_SUFFIX)
|
|---|
| 48 | TOOL_GXX3OMF_CXX ?= $(TOOL_GXX3OMF_PREFIX)g++$(TOOL_GXX3OMF_SUFFIX)
|
|---|
| 49 | TOOL_GXX3OMF_PCH ?= $(TOOL_GXX3OMF_CXX)
|
|---|
| 50 | TOOL_GXX3OMF_AS ?= $(TOOL_GXX3OMF_PREFIX)gcc$(TOOL_GXX3OMF_SUFFIX)
|
|---|
| 51 | TOOL_GXX3OMF_AR ?= $(TOOL_GXX3OMF_PREFIX2)emxomfar$(TOOL_GXX3OMF_SUFFIX2)
|
|---|
| 52 | TOOL_GXX3OMF_AR_IMP ?= $(TOOL_GXX3OMF_PREFIX2)emximp$(TOOL_GXX3OMF_SUFFIX2)
|
|---|
| 53 | TOOL_GXX3OMF_LD ?= $(TOOL_GXX3OMF_PREFIX)g++$(TOOL_GXX3OMF_SUFFIX)
|
|---|
| 54 | TOOL_GXX3OMF_LD_SYSMOD ?= $(TOOL_GXX3OMF_PREFIX)g++$(TOOL_GXX3OMF_SUFFIX)
|
|---|
| 55 | ifndef TOOL_GXX3OMF_LDFLAGS.$(KBUILD_TARGET)
|
|---|
| 56 | TOOL_GXX3OMF_LDFLAGS.dll ?= -shared -Zdll
|
|---|
| 57 | else
|
|---|
| 58 | TOOL_GXX3OMF_LDFLAGS.dll ?= $(TOOL_GXX3OMF_LDFLAGS.$(KBUILD_TARGET))
|
|---|
| 59 | endif
|
|---|
| 60 | TOOL_GXX3OMF_LDFLAGS.sysmod ?= -nostdlib
|
|---|
| 61 | TOOL_GXX3OMF_LD_MAP ?= -Zmap=$(1)
|
|---|
| 62 | TOOL_GXX3OMF_LD_SYSMOD_MAP ?= -Zmap=$(1)
|
|---|
| 63 |
|
|---|
| 64 | TOOL_GXX3OMF_RC = $(TOOL_GXX3OMF_PREFIX3)rc$(TOOL_GXX3OMF_SUFFIX3)
|
|---|
| 65 |
|
|---|
| 66 | # General Properties used by kBuild
|
|---|
| 67 | TOOL_GXX3OMF_COBJSUFF ?= .o
|
|---|
| 68 | TOOL_GXX3OMF_CFLAGS ?= -Zomf
|
|---|
| 69 | TOOL_GXX3OMF_CFLAGS.debug ?= -g
|
|---|
| 70 | TOOL_GXX3OMF_CFLAGS.profile ?= -O2 #-g -pg
|
|---|
| 71 | TOOL_GXX3OMF_CFLAGS.release ?= -O2
|
|---|
| 72 | TOOL_GXX3OMF_CINCS ?=
|
|---|
| 73 | TOOL_GXX3OMF_CDEFS ?=
|
|---|
| 74 |
|
|---|
| 75 | TOOL_GXX3OMF_CXXOBJSUFF ?= .o
|
|---|
| 76 | TOOL_GXX3OMF_CXXFLAGS ?= -Zomf
|
|---|
| 77 | TOOL_GXX3OMF_CXXFLAGS.debug ?= -g
|
|---|
| 78 | TOOL_GXX3OMF_CXXFLAGS.profile ?= -O2 #-g -pg
|
|---|
| 79 | TOOL_GXX3OMF_CXXFLAGS.release ?= -O2
|
|---|
| 80 | TOOL_GXX3OMF_CXXINCS ?=
|
|---|
| 81 | TOOL_GXX3OMF_CXXDEFS ?=
|
|---|
| 82 |
|
|---|
| 83 | TOOL_GXX3OMF_PCHOBJSUFF ?= .h.gch
|
|---|
| 84 | TOOL_GXX3OMF_PCHFLAGS ?= $(TOOL_GXX3OMF_CXXFLAGS)
|
|---|
| 85 | TOOL_GXX3OMF_PCHFLAGS.debug ?= $(TOOL_GXX3OMF_CXXFLAGS.debug)
|
|---|
| 86 | TOOL_GXX3OMF_PCHFLAGS.profile ?= $(TOOL_GXX3OMF_CXXFLAGS.profile)
|
|---|
| 87 | TOOL_GXX3OMF_PCHFLAGS.release ?= $(TOOL_GXX3OMF_CXXFLAGS.release)
|
|---|
| 88 | TOOL_GXX3OMF_PCHINCS ?= $(TOOL_GXX3OMF_CXXINCS)
|
|---|
| 89 | TOOL_GXX3OMF_PCHDEFS ?= $(TOOL_GXX3OMF_CXXDEFS)
|
|---|
| 90 |
|
|---|
| 91 | TOOL_GXX3OMF_ASFLAGS ?= -x assembler-with-cpp -Zomf
|
|---|
| 92 | TOOL_GXX3OMF_ASFLAGS.debug ?= -g
|
|---|
| 93 | TOOL_GXX3OMF_ASFLAGS.profile ?= -g
|
|---|
| 94 | TOOL_GXX3OMF_ASOBJSUFF ?= .obj
|
|---|
| 95 |
|
|---|
| 96 | TOOL_GXX3OMF_RCOBJSUFF ?= .res
|
|---|
| 97 | TOOL_GXX3OMF_RCFLAGS ?= -n
|
|---|
| 98 | TOOL_GXX3OMF_RCINCS ?= $(shell $(TOOL_GXX3OMF_CXX) -E -x c++ - 2>&1 < /dev/null \
|
|---|
| 99 | | $(SED_EXT) -e "/search starts here/,/[Ee]nd of search list/!d" -e "/^ /!d")
|
|---|
| 100 |
|
|---|
| 101 | TOOL_GXX3OMF_ARFLAGS ?= cr
|
|---|
| 102 | TOOL_GXX3OMF_ARLIBSUFF ?= .lib
|
|---|
| 103 |
|
|---|
| 104 | TOOL_GXX3OMF_LDFLAGS ?= -Zomf
|
|---|
| 105 | TOOL_GXX3OMF_LDFLAGS.debug ?= -g
|
|---|
| 106 | TOOL_GXX3OMF_LDFLAGS.profile ?= -g
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 | ## Compile C source.
|
|---|
| 110 | # @param $(target) Normalized main target name.
|
|---|
| 111 | # @param $(source) Source filename (relative).
|
|---|
| 112 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 113 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 114 | # @param $(flags) Flags.
|
|---|
| 115 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 116 | # @param $(incs) Includes. No -I or something.
|
|---|
| 117 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 118 | # @param $(deps) Other dependencies.
|
|---|
| 119 | #
|
|---|
| 120 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 121 | # @param $(objsuff) Object suffix.
|
|---|
| 122 | TOOL_GXX3OMF_COMPILE_C_DEPEND =
|
|---|
| 123 | TOOL_GXX3OMF_COMPILE_C_DEPORD =
|
|---|
| 124 | TOOL_GXX3OMF_COMPILE_C_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).i,)
|
|---|
| 125 | TOOL_GXX3OMF_COMPILE_C_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,)
|
|---|
| 126 | define TOOL_GXX3OMF_COMPILE_C_CMDS
|
|---|
| 127 | if "$(use_objcache)" != ""
|
|---|
| 128 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
|---|
| 129 | --kObjCache-cpp $(outbase).i\
|
|---|
| 130 | $(TOOL_GXX3OMF_CC) -E -o -\
|
|---|
| 131 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
|---|
| 132 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
|---|
| 133 | $(abspath $(source))\
|
|---|
| 134 | --kObjCache-cc $(obj)\
|
|---|
| 135 | $(TOOL_GXX3OMF_CC) -c\
|
|---|
| 136 | $(flags) -fpreprocessed -x c\
|
|---|
| 137 | -o $(obj)\
|
|---|
| 138 | -
|
|---|
| 139 | else
|
|---|
| 140 | $(QUIET)$(TOOL_GXX3OMF_CC) -c\
|
|---|
| 141 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
|---|
| 142 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
|---|
| 143 | -o $(obj)\
|
|---|
| 144 | $(abspath $(source))
|
|---|
| 145 | endif
|
|---|
| 146 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
|---|
| 147 | endef
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 | ## Compile C++ source.
|
|---|
| 151 | # @param $(target) Normalized main target name.
|
|---|
| 152 | # @param $(source) Source filename (relative).
|
|---|
| 153 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 154 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 155 | # @param $(flags) Flags.
|
|---|
| 156 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 157 | # @param $(incs) Includes. No -I or something.
|
|---|
| 158 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 159 | # @param $(deps) Other dependencies.
|
|---|
| 160 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 161 | # @param $(objsuff) Object suffix.
|
|---|
| 162 | TOOL_GXX3OMF_COMPILE_CXX_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).ii,)
|
|---|
| 163 | TOOL_GXX3OMF_COMPILE_CXX_DEPEND = $($(target)_1_GCC_PCH_FILE)
|
|---|
| 164 | TOOL_GXX3OMF_COMPILE_CXX_DEPORD =
|
|---|
| 165 | TOOL_GXX3OMF_COMPILE_CXX_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,)
|
|---|
| 166 | define TOOL_GXX3OMF_COMPILE_CXX_CMDS
|
|---|
| 167 | if "$(use_objcache)" != ""
|
|---|
| 168 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
|---|
| 169 | --kObjCache-cpp $(outbase).ii\
|
|---|
| 170 | $(TOOL_GXX3OMF_CXX) -E -o - $(if-expr defined($(target)_PCH_HDR)\
|
|---|
| 171 | ,-fpch-preprocess -Winvalid-pch -I$($(target)_1_GCC_PCH_DIR) -include $(basename $($(target)_1_GCC_PCH_FILE)),)\
|
|---|
| 172 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
|---|
| 173 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
|---|
| 174 | $(abspath $(source))\
|
|---|
| 175 | --kObjCache-cc $(obj)\
|
|---|
| 176 | $(TOOL_GXX3OMF_CXX) -c\
|
|---|
| 177 | $(flags) -fpreprocessed $(if-expr defined($(target)_PCH_HDR),-fpch-preprocess,) -x c++\
|
|---|
| 178 | -o $(obj)\
|
|---|
| 179 | -
|
|---|
| 180 | else
|
|---|
| 181 | $(QUIET)$(TOOL_GXX3OMF_CXX) -c\
|
|---|
| 182 | $(flags) $(qaddprefix sh,-I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(qaddprefix sh,-D, $(defs))\
|
|---|
| 183 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
|---|
| 184 | -o $(obj) $(if-expr defined($(target)_PCH_HDR) \
|
|---|
| 185 | ,-Winvalid-pch -include $(basename $($(target)_1_GCC_PCH_FILE)),) \
|
|---|
| 186 | $(abspath $(source))
|
|---|
| 187 | endif
|
|---|
| 188 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
|---|
| 189 | endef
|
|---|
| 190 |
|
|---|
| 191 |
|
|---|
| 192 | ## Precompile C++ header.
|
|---|
| 193 | # @param $(target) Normalized main target name.
|
|---|
| 194 | # @param $(source) Source filename (relative).
|
|---|
| 195 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 196 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 197 | # @param $(flags) Flags.
|
|---|
| 198 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 199 | # @param $(incs) Includes. No -I or something.
|
|---|
| 200 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 201 | # @param $(deps) Other dependencies.
|
|---|
| 202 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 203 | # @param $(objsuff) Object suffix.
|
|---|
| 204 | TOOL_GXX3OMF_COMPILE_PCH_OUTPUT = $($(target)_1_GCC_PCH_FILE)
|
|---|
| 205 | TOOL_GXX3OMF_COMPILE_PCH_DEPEND =
|
|---|
| 206 | TOOL_GXX3OMF_COMPILE_PCH_DEPORD = $($(target)_1_GCC_PCH_DIR)
|
|---|
| 207 | define TOOL_GXX3OMF_COMPILE_PCH_CMDS
|
|---|
| 208 | $(QUIET)$(TOOL_GXX3OMF_PCH) -c\
|
|---|
| 209 | $(flags) $(qaddprefix sh,-I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(qaddprefix sh,-D, $(defs))\
|
|---|
| 210 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
|---|
| 211 | -o $(obj)\
|
|---|
| 212 | $(abspath $(source))
|
|---|
| 213 | $(INSTALL) --hard-link-files-when-possible -m 0644 -- "$(obj)" "$($(target)_1_GCC_PCH_FILE)"
|
|---|
| 214 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
|---|
| 215 | endef
|
|---|
| 216 |
|
|---|
| 217 |
|
|---|
| 218 | ## Compile Assembly source.
|
|---|
| 219 | # @param $(target) Normalized main target name.
|
|---|
| 220 | # @param $(source) Source filename (relative).
|
|---|
| 221 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 222 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 223 | # @param $(flags) Flags.
|
|---|
| 224 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 225 | # @param $(incs) Includes. No -I or something.
|
|---|
| 226 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 227 | # @param $(deps) Other dependencies.
|
|---|
| 228 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 229 | # @param $(objsuff) Object suffix.
|
|---|
| 230 | #
|
|---|
| 231 | TOOL_GXX3OMF_COMPILE_AS_OUTPUT =
|
|---|
| 232 | TOOL_GXX3OMF_COMPILE_AS_DEPEND =
|
|---|
| 233 | TOOL_GXX3OMF_COMPILE_AS_DEPORD =
|
|---|
| 234 | define TOOL_GXX3OMF_COMPILE_AS_CMDS
|
|---|
| 235 | $(QUIET)$(TOOL_GXX3OMF_AS) -c\
|
|---|
| 236 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
|---|
| 237 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
|---|
| 238 | -o $(obj)\
|
|---|
| 239 | $(abspath $(source))
|
|---|
| 240 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
|---|
| 241 | endef
|
|---|
| 242 |
|
|---|
| 243 |
|
|---|
| 244 | ## Compile resource source.
|
|---|
| 245 | # @param $(target) Normalized main target name.
|
|---|
| 246 | # @param $(source) Source filename (relative).
|
|---|
| 247 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 248 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 249 | # @param $(flags) Flags.
|
|---|
| 250 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 251 | # @param $(incs) Includes. No -I or something.
|
|---|
| 252 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 253 | # @param $(deps) Other dependencies.
|
|---|
| 254 | #
|
|---|
| 255 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 256 | # @param $(objsuff) Object suffix.
|
|---|
| 257 | TOOL_GXX3OMF_COMPILE_RC_OUTPUT =
|
|---|
| 258 | TOOL_GXX3OMF_COMPILE_RC_DEPEND =
|
|---|
| 259 | TOOL_GXX3OMF_COMPILE_RC_DEPORD =
|
|---|
| 260 | define TOOL_GXX3OMF_COMPILE_RC_CMDS
|
|---|
| 261 | $(QUIET)$(REDIRECT) -E 'INCLUDE=' -- $(TOOL_GXX3OMF_RC) -r \
|
|---|
| 262 | $(flags) $(addprefix -i, $(subst /,\\,$(subst /@unixroot,$(UNIXROOT),$(incs)))) $(addprefix -d, $(defs))\
|
|---|
| 263 | $(subst /,\\,$(abspath $(source))) \
|
|---|
| 264 | $(obj)
|
|---|
| 265 | endef
|
|---|
| 266 |
|
|---|
| 267 |
|
|---|
| 268 | ## Link library
|
|---|
| 269 | # @param $(target) Normalized main target name.
|
|---|
| 270 | # @param $(out) Library name.
|
|---|
| 271 | # @param $(objs) Object files to put in the library.
|
|---|
| 272 | # @param $(flags) Flags.
|
|---|
| 273 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 274 | # @param $(deps) Other dependencies.
|
|---|
| 275 | # @param $(othersrc) Unhandled sources.
|
|---|
| 276 | #
|
|---|
| 277 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 278 | TOOL_GXX3OMF_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
|---|
| 279 | TOOL_GXX3OMF_LINK_LIBRARY_DEPEND = $(othersrc)
|
|---|
| 280 | TOOL_GXX3OMF_LINK_LIBRARY_DEPORD =
|
|---|
| 281 | define TOOL_GXX3OMF_LINK_LIBRARY_CMDS
|
|---|
| 282 | $(if $(filter %.def %.imp %.dll,$(othersrc))\
|
|---|
| 283 | ,$(QUIET)$(APPEND) -n $(outbase).rsp $(filter %.def %.imp %.dll,$(othersrc))\
|
|---|
| 284 | $(NL)$(TAB)$(QUIET)$(QUIET)$(TOOL_GXX3OMF_AR_IMP) -o $(out) @$(outbase).rsp\
|
|---|
| 285 | $(NL)$(TAB)$(QUIET)$(RM) -f $(outbase).rsp)
|
|---|
| 286 | $(QUIET)$(APPEND) -n $(outbase).rsp $(flags) $(out) $(filter-out %.h.gch,$(objs)) $(filter-out %.def %.imp %.dll,$(othersrc))
|
|---|
| 287 | $(QUIET)$(TOOL_GXX3OMF_AR) @$(outbase).rsp
|
|---|
| 288 | endef
|
|---|
| 289 |
|
|---|
| 290 |
|
|---|
| 291 | ## Link program
|
|---|
| 292 | # @param $(target) Normalized main target name.
|
|---|
| 293 | # @param $(out) Program name.
|
|---|
| 294 | # @param $(objs) Object files to link together.
|
|---|
| 295 | # @param $(libs) Libraries to search.
|
|---|
| 296 | # @param $(libpath) Library search paths.
|
|---|
| 297 | # @param $(flags) Flags.
|
|---|
| 298 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 299 | # @param $(deps) Other dependencies.
|
|---|
| 300 | # @param $(othersrc) Unhandled sources.
|
|---|
| 301 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 302 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 303 | #
|
|---|
| 304 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 305 | TOOL_GXX3OMF_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp
|
|---|
| 306 | TOOL_GXX3OMF_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 307 | TOOL_GXX3OMF_LINK_PROGRAM_DEPORD =
|
|---|
| 308 | define TOOL_GXX3OMF_LINK_PROGRAM_CMDS
|
|---|
| 309 | $(QUIET)$(APPEND) -n $(outbase).rsp\
|
|---|
| 310 | $(flags)\
|
|---|
| 311 | -o $(out)\
|
|---|
| 312 | $(filter-out %.h.gch,$(objs))\
|
|---|
| 313 | $(foreach p,$(libpath), -L$(p))\
|
|---|
| 314 | $(othersrc)\
|
|---|
| 315 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
|---|
| 316 | -Zmap=$(outbase).map
|
|---|
| 317 | $(QUIET)$(TOOL_GXX3OMF_LD) @$(outbase).rsp
|
|---|
| 318 | endef
|
|---|
| 319 |
|
|---|
| 320 |
|
|---|
| 321 | ## Link DLL
|
|---|
| 322 | # @param $(target) Normalized main target name.
|
|---|
| 323 | # @param $(out) Program name.
|
|---|
| 324 | # @param $(objs) Object files to link together.
|
|---|
| 325 | # @param $(libs) Libraries to search.
|
|---|
| 326 | # @param $(libpath) Library search paths.
|
|---|
| 327 | # @param $(flags) Flags.
|
|---|
| 328 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 329 | # @param $(deps) Other dependencies.
|
|---|
| 330 | # @param $(othersrc) Unhandled sources.
|
|---|
| 331 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 332 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 333 | #
|
|---|
| 334 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 335 | TOOL_GXX3OMF_LINK_DLL_OUTPUT = $(outbase).map $(outbase).rsp
|
|---|
| 336 | TOOL_GXX3OMF_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 337 | TOOL_GXX3OMF_LINK_DLL_DEPORD =
|
|---|
| 338 | define TOOL_GXX3OMF_LINK_DLL_CMDS
|
|---|
| 339 | $(QUIET)$(APPEND) -n $(outbase).rsp\
|
|---|
| 340 | $(TOOL_GXX3OMF_LDFLAGS.dll)\
|
|---|
| 341 | $(flags)\
|
|---|
| 342 | -o $(out)\
|
|---|
| 343 | $(filter-out %.h.gch,$(objs))\
|
|---|
| 344 | $(foreach p,$(libpath), -L$(p))\
|
|---|
| 345 | $(othersrc)\
|
|---|
| 346 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
|---|
| 347 | -Zmap=$(outbase).map
|
|---|
| 348 | $(QUIET)$(TOOL_GXX3OMF_LD) @$(outbase).rsp
|
|---|
| 349 | endef
|
|---|
| 350 |
|
|---|
| 351 |
|
|---|
| 352 | ## Link system module (windows aka driver, linux aka kernel module)
|
|---|
| 353 | # @param $(target) Normalized main target name.
|
|---|
| 354 | # @param $(out) System module name.
|
|---|
| 355 | # @param $(objs) Object files to link together.
|
|---|
| 356 | # @param $(libs) Libraries to search.
|
|---|
| 357 | # @param $(libpath) Library search paths.
|
|---|
| 358 | # @param $(flags) Flags.
|
|---|
| 359 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 360 | # @param $(deps) Other dependencies.
|
|---|
| 361 | # @param $(othersrc) Unhandled sources.
|
|---|
| 362 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 363 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 364 | #
|
|---|
| 365 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 366 | TOOL_GXX3OMF_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp
|
|---|
| 367 | TOOL_GXX3OMF_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 368 | TOOL_GXX3OMF_LINK_SYSMOD_DEPORD =
|
|---|
| 369 | define TOOL_GXX3OMF_LINK_SYSMOD_CMDS
|
|---|
| 370 | $(QUIET)$(APPEND) -n $(outbase).rsp\
|
|---|
| 371 | $(TOOL_GXX3OMF_LDFLAGS.sysmod)\
|
|---|
| 372 | $(flags)\
|
|---|
| 373 | -o $(out)\
|
|---|
| 374 | $(filter-out %.h.gch,$(objs))\
|
|---|
| 375 | $(foreach p,$(libpath), -L$(p))\
|
|---|
| 376 | $(othersrc)\
|
|---|
| 377 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
|---|
| 378 | -Zmap=$(outbase).map
|
|---|
| 379 | $(QUIET)$(TOOL_GXX3OMF_LD_SYSMOD) @$(outbase).rsp
|
|---|
| 380 | endef
|
|---|
| 381 |
|
|---|