[182] | 1 | # $Id: GXX3OMF.kmk 3567 2022-06-26 20:00:02Z bird $
|
---|
| 2 | ## @file
|
---|
[971] | 3 | # kBuild Tool Config - GCC v3 targeting OS/2 OMF, for building C++ code.
|
---|
[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
|
---|
[2018] | 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 |
|
---|
[971] | 34 | TOOL_GXX3OMF := GCC v3 targeting OS/2 OMF, for building C++ code.
|
---|
[182] | 35 |
|
---|
[667] | 36 | # Tool Specific Properties
|
---|
[3391] | 37 | ifndef TOOL_GXX3OMF_PREFIX
|
---|
[3393] | 38 | TOOL_GXX3OMF_PREFIX :=
|
---|
[3391] | 39 | endif
|
---|
| 40 | ifndef TOOL_GXX3OMF_SUFFIX
|
---|
[3393] | 41 | TOOL_GXX3OMF_SUFFIX := $(HOSTSUFF_EXE)
|
---|
[3391] | 42 | endif
|
---|
[3393] | 43 | TOOL_GXX3OMF_PREFIX2 ?=
|
---|
| 44 | TOOL_GXX3OMF_SUFFIX2 ?= $(HOSTSUFF_EXE)
|
---|
| 45 | TOOL_GXX3OMF_PREFIX3 ?=
|
---|
| 46 | TOOL_GXX3OMF_SUFFIX3 ?= $(HOSTSUFF_EXE)
|
---|
[3391] | 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)
|
---|
[3393] | 51 | TOOL_GXX3OMF_AR ?= $(TOOL_GXX3OMF_PREFIX2)emxomfar$(TOOL_GXX3OMF_SUFFIX2)
|
---|
| 52 | TOOL_GXX3OMF_AR_IMP ?= $(TOOL_GXX3OMF_PREFIX2)emximp$(TOOL_GXX3OMF_SUFFIX2)
|
---|
[3391] | 53 | TOOL_GXX3OMF_LD ?= $(TOOL_GXX3OMF_PREFIX)g++$(TOOL_GXX3OMF_SUFFIX)
|
---|
| 54 | TOOL_GXX3OMF_LD_SYSMOD ?= $(TOOL_GXX3OMF_PREFIX)g++$(TOOL_GXX3OMF_SUFFIX)
|
---|
[1504] | 55 | ifndef TOOL_GXX3OMF_LDFLAGS.$(KBUILD_TARGET)
|
---|
[3391] | 56 | TOOL_GXX3OMF_LDFLAGS.dll ?= -shared -Zdll
|
---|
[182] | 57 | else
|
---|
[3391] | 58 | TOOL_GXX3OMF_LDFLAGS.dll ?= $(TOOL_GXX3OMF_LDFLAGS.$(KBUILD_TARGET))
|
---|
[182] | 59 | endif
|
---|
[971] | 60 | TOOL_GXX3OMF_LDFLAGS.sysmod ?= -nostdlib
|
---|
[3391] | 61 | TOOL_GXX3OMF_LD_MAP ?= -Zmap=$(1)
|
---|
| 62 | TOOL_GXX3OMF_LD_SYSMOD_MAP ?= -Zmap=$(1)
|
---|
[182] | 63 |
|
---|
[3393] | 64 | TOOL_GXX3OMF_RC = $(TOOL_GXX3OMF_PREFIX3)rc$(TOOL_GXX3OMF_SUFFIX3)
|
---|
[3391] | 65 |
|
---|
[667] | 66 | # General Properties used by kBuild
|
---|
[971] | 67 | TOOL_GXX3OMF_COBJSUFF ?= .o
|
---|
| 68 | TOOL_GXX3OMF_CFLAGS ?= -Zomf
|
---|
| 69 | TOOL_GXX3OMF_CFLAGS.debug ?= -g
|
---|
[1058] | 70 | TOOL_GXX3OMF_CFLAGS.profile ?= -O2 #-g -pg
|
---|
[971] | 71 | TOOL_GXX3OMF_CFLAGS.release ?= -O2
|
---|
| 72 | TOOL_GXX3OMF_CINCS ?=
|
---|
| 73 | TOOL_GXX3OMF_CDEFS ?=
|
---|
[182] | 74 |
|
---|
[971] | 75 | TOOL_GXX3OMF_CXXOBJSUFF ?= .o
|
---|
| 76 | TOOL_GXX3OMF_CXXFLAGS ?= -Zomf
|
---|
| 77 | TOOL_GXX3OMF_CXXFLAGS.debug ?= -g
|
---|
[1058] | 78 | TOOL_GXX3OMF_CXXFLAGS.profile ?= -O2 #-g -pg
|
---|
[971] | 79 | TOOL_GXX3OMF_CXXFLAGS.release ?= -O2
|
---|
| 80 | TOOL_GXX3OMF_CXXINCS ?=
|
---|
| 81 | TOOL_GXX3OMF_CXXDEFS ?=
|
---|
[667] | 82 |
|
---|
[3258] | 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 |
|
---|
[1062] | 91 | TOOL_GXX3OMF_ASFLAGS ?= -x assembler-with-cpp -Zomf
|
---|
[971] | 92 | TOOL_GXX3OMF_ASFLAGS.debug ?= -g
|
---|
| 93 | TOOL_GXX3OMF_ASFLAGS.profile ?= -g
|
---|
| 94 | TOOL_GXX3OMF_ASOBJSUFF ?= .obj
|
---|
[667] | 95 |
|
---|
[2776] | 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 |
|
---|
[971] | 101 | TOOL_GXX3OMF_ARFLAGS ?= cr
|
---|
| 102 | TOOL_GXX3OMF_ARLIBSUFF ?= .lib
|
---|
[667] | 103 |
|
---|
[971] | 104 | TOOL_GXX3OMF_LDFLAGS ?= -Zomf
|
---|
| 105 | TOOL_GXX3OMF_LDFLAGS.debug ?= -g
|
---|
| 106 | TOOL_GXX3OMF_LDFLAGS.profile ?= -g
|
---|
[667] | 107 |
|
---|
| 108 |
|
---|
[182] | 109 | ## Compile C source.
|
---|
| 110 | # @param $(target) Normalized main target name.
|
---|
| 111 | # @param $(source) Source filename (relative).
|
---|
[235] | 112 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
[182] | 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.
|
---|
[235] | 117 | # @param $(dirdep) Directory creation dependency.
|
---|
| 118 | # @param $(deps) Other dependencies.
|
---|
[182] | 119 | #
|
---|
| 120 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[235] | 121 | # @param $(objsuff) Object suffix.
|
---|
[971] | 122 | TOOL_GXX3OMF_COMPILE_C_DEPEND =
|
---|
| 123 | TOOL_GXX3OMF_COMPILE_C_DEPORD =
|
---|
[3258] | 124 | TOOL_GXX3OMF_COMPILE_C_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).i,)
|
---|
| 125 | TOOL_GXX3OMF_COMPILE_C_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,)
|
---|
[971] | 126 | define TOOL_GXX3OMF_COMPILE_C_CMDS
|
---|
[3258] | 127 | if "$(use_objcache)" != ""
|
---|
[1058] | 128 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 129 | --kObjCache-cpp $(outbase).i\
|
---|
[1015] | 130 | $(TOOL_GXX3OMF_CC) -E -o -\
|
---|
[3566] | 131 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1015] | 132 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[1058] | 133 | $(abspath $(source))\
|
---|
| 134 | --kObjCache-cc $(obj)\
|
---|
[1015] | 135 | $(TOOL_GXX3OMF_CC) -c\
|
---|
[1058] | 136 | $(flags) -fpreprocessed -x c\
|
---|
[1015] | 137 | -o $(obj)\
|
---|
[1058] | 138 | -
|
---|
[3258] | 139 | else
|
---|
[971] | 140 | $(QUIET)$(TOOL_GXX3OMF_CC) -c\
|
---|
[3566] | 141 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[3258] | 142 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[380] | 143 | -o $(obj)\
|
---|
[697] | 144 | $(abspath $(source))
|
---|
[3258] | 145 | endif
|
---|
[2431] | 146 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[182] | 147 | endef
|
---|
| 148 |
|
---|
| 149 |
|
---|
| 150 | ## Compile C++ source.
|
---|
| 151 | # @param $(target) Normalized main target name.
|
---|
| 152 | # @param $(source) Source filename (relative).
|
---|
[235] | 153 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
[3258] | 154 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
[182] | 155 | # @param $(flags) Flags.
|
---|
| 156 | # @param $(defs) Definitions. No -D or something.
|
---|
| 157 | # @param $(incs) Includes. No -I or something.
|
---|
[235] | 158 | # @param $(dirdep) Directory creation dependency.
|
---|
[3258] | 159 | # @param $(deps) Other dependencies.
|
---|
[182] | 160 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[235] | 161 | # @param $(objsuff) Object suffix.
|
---|
[3258] | 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,)
|
---|
[971] | 166 | define TOOL_GXX3OMF_COMPILE_CXX_CMDS
|
---|
[3258] | 167 | if "$(use_objcache)" != ""
|
---|
[1058] | 168 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 169 | --kObjCache-cpp $(outbase).ii\
|
---|
[3258] | 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)),)\
|
---|
[3566] | 172 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1015] | 173 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[1058] | 174 | $(abspath $(source))\
|
---|
| 175 | --kObjCache-cc $(obj)\
|
---|
[1015] | 176 | $(TOOL_GXX3OMF_CXX) -c\
|
---|
[3258] | 177 | $(flags) -fpreprocessed $(if-expr defined($(target)_PCH_HDR),-fpch-preprocess,) -x c++\
|
---|
[1015] | 178 | -o $(obj)\
|
---|
[1058] | 179 | -
|
---|
[3258] | 180 | else
|
---|
| 181 | $(QUIET)$(TOOL_GXX3OMF_CXX) -c\
|
---|
[3566] | 182 | $(flags) $(qaddprefix sh,-I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[3258] | 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
|
---|
[2431] | 188 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[1015] | 189 | endef
|
---|
[3258] | 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\
|
---|
[3566] | 209 | $(flags) $(qaddprefix sh,-I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[3258] | 210 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[380] | 211 | -o $(obj)\
|
---|
[697] | 212 | $(abspath $(source))
|
---|
[3258] | 213 | $(INSTALL) --hard-link-files-when-possible -m 0644 -- "$(obj)" "$($(target)_1_GCC_PCH_FILE)"
|
---|
[2431] | 214 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[182] | 215 | endef
|
---|
| 216 |
|
---|
| 217 |
|
---|
[465] | 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 | #
|
---|
[971] | 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\
|
---|
[3566] | 236 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[465] | 237 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 238 | -o $(obj)\
|
---|
[697] | 239 | $(abspath $(source))
|
---|
[2431] | 240 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[465] | 241 | endef
|
---|
| 242 |
|
---|
| 243 |
|
---|
[2776] | 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 |
|
---|
[182] | 268 | ## Link library
|
---|
| 269 | # @param $(target) Normalized main target name.
|
---|
[380] | 270 | # @param $(out) Library name.
|
---|
[182] | 271 | # @param $(objs) Object files to put in the library.
|
---|
| 272 | # @param $(flags) Flags.
|
---|
[235] | 273 | # @param $(dirdep) Directory creation dependency.
|
---|
| 274 | # @param $(deps) Other dependencies.
|
---|
| 275 | # @param $(othersrc) Unhandled sources.
|
---|
[182] | 276 | #
|
---|
| 277 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[971] | 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
|
---|
[2775] | 282 | $(if $(filter %.def %.imp %.dll,$(othersrc))\
|
---|
| 283 | ,$(QUIET)$(APPEND) -n $(outbase).rsp $(filter %.def %.imp %.dll,$(othersrc))\
|
---|
[971] | 284 | $(NL)$(TAB)$(QUIET)$(QUIET)$(TOOL_GXX3OMF_AR_IMP) -o $(out) @$(outbase).rsp\
|
---|
[773] | 285 | $(NL)$(TAB)$(QUIET)$(RM) -f $(outbase).rsp)
|
---|
[3258] | 286 | $(QUIET)$(APPEND) -n $(outbase).rsp $(flags) $(out) $(filter-out %.h.gch,$(objs)) $(filter-out %.def %.imp %.dll,$(othersrc))
|
---|
[2774] | 287 | $(QUIET)$(TOOL_GXX3OMF_AR) @$(outbase).rsp
|
---|
[182] | 288 | endef
|
---|
| 289 |
|
---|
| 290 |
|
---|
| 291 | ## Link program
|
---|
| 292 | # @param $(target) Normalized main target name.
|
---|
[353] | 293 | # @param $(out) Program name.
|
---|
[182] | 294 | # @param $(objs) Object files to link together.
|
---|
| 295 | # @param $(libs) Libraries to search.
|
---|
| 296 | # @param $(libpath) Library search paths.
|
---|
| 297 | # @param $(flags) Flags.
|
---|
[235] | 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.
|
---|
[182] | 303 | #
|
---|
| 304 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[971] | 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
|
---|
[840] | 309 | $(QUIET)$(APPEND) -n $(outbase).rsp\
|
---|
| 310 | $(flags)\
|
---|
| 311 | -o $(out)\
|
---|
[3258] | 312 | $(filter-out %.h.gch,$(objs))\
|
---|
[380] | 313 | $(foreach p,$(libpath), -L$(p))\
|
---|
[840] | 314 | $(othersrc)\
|
---|
[1259] | 315 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
---|
[840] | 316 | -Zmap=$(outbase).map
|
---|
[971] | 317 | $(QUIET)$(TOOL_GXX3OMF_LD) @$(outbase).rsp
|
---|
[182] | 318 | endef
|
---|
| 319 |
|
---|
| 320 |
|
---|
| 321 | ## Link DLL
|
---|
| 322 | # @param $(target) Normalized main target name.
|
---|
[353] | 323 | # @param $(out) Program name.
|
---|
[182] | 324 | # @param $(objs) Object files to link together.
|
---|
| 325 | # @param $(libs) Libraries to search.
|
---|
| 326 | # @param $(libpath) Library search paths.
|
---|
| 327 | # @param $(flags) Flags.
|
---|
[235] | 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.
|
---|
[182] | 333 | #
|
---|
| 334 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[971] | 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
|
---|
[840] | 339 | $(QUIET)$(APPEND) -n $(outbase).rsp\
|
---|
[971] | 340 | $(TOOL_GXX3OMF_LDFLAGS.dll)\
|
---|
[840] | 341 | $(flags)\
|
---|
| 342 | -o $(out)\
|
---|
[3258] | 343 | $(filter-out %.h.gch,$(objs))\
|
---|
[380] | 344 | $(foreach p,$(libpath), -L$(p))\
|
---|
[840] | 345 | $(othersrc)\
|
---|
[1259] | 346 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
---|
[840] | 347 | -Zmap=$(outbase).map
|
---|
[2774] | 348 | $(QUIET)$(TOOL_GXX3OMF_LD) @$(outbase).rsp
|
---|
[182] | 349 | endef
|
---|
| 350 |
|
---|
[840] | 351 |
|
---|
[182] | 352 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
| 353 | # @param $(target) Normalized main target name.
|
---|
[353] | 354 | # @param $(out) System module name.
|
---|
[182] | 355 | # @param $(objs) Object files to link together.
|
---|
| 356 | # @param $(libs) Libraries to search.
|
---|
| 357 | # @param $(libpath) Library search paths.
|
---|
| 358 | # @param $(flags) Flags.
|
---|
[235] | 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.
|
---|
[182] | 364 | #
|
---|
| 365 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[971] | 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
|
---|
[840] | 370 | $(QUIET)$(APPEND) -n $(outbase).rsp\
|
---|
[971] | 371 | $(TOOL_GXX3OMF_LDFLAGS.sysmod)\
|
---|
[840] | 372 | $(flags)\
|
---|
| 373 | -o $(out)\
|
---|
[3258] | 374 | $(filter-out %.h.gch,$(objs))\
|
---|
[380] | 375 | $(foreach p,$(libpath), -L$(p))\
|
---|
[840] | 376 | $(othersrc)\
|
---|
[1259] | 377 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
---|
[840] | 378 | -Zmap=$(outbase).map
|
---|
[971] | 379 | $(QUIET)$(TOOL_GXX3OMF_LD_SYSMOD) @$(outbase).rsp
|
---|
[182] | 380 | endef
|
---|
[184] | 381 |
|
---|