[665] | 1 | # $Id: GCC4MACHO.kmk 3567 2022-06-26 20:00:02Z bird $
|
---|
[557] | 2 | ## @file
|
---|
[2547] | 3 | # kBuild Tool Config - GCC v4 targeting Darwin (Mac OS X) Mach-O.
|
---|
[557] | 4 | #
|
---|
[1547] | 5 |
|
---|
| 6 | #
|
---|
[3121] | 7 | # Copyright (c) 2004-2017 knut st. osmundsen <bird-kBuild-spam-xviiv@anduin.net>
|
---|
[557] | 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 | #
|
---|
[557] | 33 |
|
---|
[2547] | 34 | TOOL_GCC4MACHO := GCC v4 targeting Darwin (Mac OS X) Mach-O.
|
---|
[557] | 35 |
|
---|
[667] | 36 | # Tool Specific Properties
|
---|
[3393] | 37 | ifndef TOOL_GCC4MACHO_PREFIX
|
---|
| 38 | TOOL_GCC4MACHO_PREFIX :=
|
---|
| 39 | endif
|
---|
| 40 | ifndef TOOL_GCC4MACHO_SUFFIX
|
---|
| 41 | TOOL_GCC4MACHO_SUFFIX := $(HOSTSUFF_EXE)
|
---|
| 42 | endif
|
---|
| 43 | TOOL_GCC4MACHO_PREFIX2 ?=
|
---|
| 44 | TOOL_GCC4MACHO_SUFFIX2 ?= $(HOSTSUFF_EXE)
|
---|
[2379] | 45 | TOOL_GCC4MACHO_CC ?= $(TOOL_GCC4MACHO_PREFIX)gcc$(TOOL_GCC4MACHO_SUFFIX)
|
---|
| 46 | TOOL_GCC4MACHO_CXX ?= $(TOOL_GCC4MACHO_PREFIX)g++$(TOOL_GCC4MACHO_SUFFIX)
|
---|
| 47 | TOOL_GCC4MACHO_OBJC ?= $(TOOL_GCC4MACHO_PREFIX)gcc$(TOOL_GCC4MACHO_SUFFIX)
|
---|
| 48 | TOOL_GCC4MACHO_OBJCXX ?= $(TOOL_GCC4MACHO_PREFIX)gcc$(TOOL_GCC4MACHO_SUFFIX)
|
---|
| 49 | TOOL_GCC4MACHO_AS ?= $(TOOL_GCC4MACHO_PREFIX)gcc$(TOOL_GCC4MACHO_SUFFIX)
|
---|
| 50 | TOOL_GCC4MACHO_LD ?= $(TOOL_GCC4MACHO_PREFIX)gcc$(TOOL_GCC4MACHO_SUFFIX)
|
---|
| 51 | TOOL_GCC4MACHO_LD_SYSMOD ?= $(TOOL_GCC4MACHO_PREFIX)gcc$(TOOL_GCC4MACHO_SUFFIX)
|
---|
[667] | 52 | TOOL_GCC4MACHO_LDFLAGS.dll ?= -dynamiclib
|
---|
| 53 | TOOL_GCC4MACHO_LDFLAGS.sysmod ?= -r
|
---|
[1504] | 54 | #TOOL_GCC4MACHO_LD_SONAME = -Wl,-dylib_install_name $(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2)))
|
---|
[557] | 55 |
|
---|
[3393] | 56 | TOOL_GCC4MACHO_AR ?= $(TOOL_GCC4MACHO_PREFIX2)ar$(TOOL_GCC4MACHO_SUFFIX2)
|
---|
| 57 | TOOL_GCC4MACHO_DSYMUTIL ?= $(TOOL_GCC4MACHO_PREFIX2)dsymutil$(TOOL_GCC4MACHO_SUFFIX2)
|
---|
| 58 | TOOL_GCC4MACHO_STRIP ?= $(TOOL_GCC4MACHO_PREFIX2)strip$(TOOL_GCC4MACHO_SUFFIX2)
|
---|
| 59 | TOOL_GCC4MACHO_STRIP_PROGRAM ?= $(TOOL_GCC4MACHO_STRIP) -SXxru
|
---|
| 60 | TOOL_GCC4MACHO_STRIP_DLL ?= $(TOOL_GCC4MACHO_STRIP) -Sxru
|
---|
| 61 | TOOL_GCC4MACHO_STRIP_SYSMOD ?= $(TOOL_GCC4MACHO_STRIP) -Sru
|
---|
| 62 |
|
---|
[667] | 63 | # General Properties used by kBuild
|
---|
| 64 | TOOL_GCC4MACHO_COBJSUFF ?= .o
|
---|
[772] | 65 | TOOL_GCC4MACHO_CFLAGS ?=
|
---|
[667] | 66 | TOOL_GCC4MACHO_CFLAGS.debug ?= -g
|
---|
| 67 | TOOL_GCC4MACHO_CFLAGS.profile ?= -g -O2 #-pg
|
---|
[772] | 68 | TOOL_GCC4MACHO_CFLAGS.release ?= -O2
|
---|
[667] | 69 | TOOL_GCC4MACHO_CINCS ?=
|
---|
| 70 | TOOL_GCC4MACHO_CDEFS ?=
|
---|
[557] | 71 |
|
---|
[667] | 72 | TOOL_GCC4MACHO_CXXOBJSUFF ?= .o
|
---|
[772] | 73 | TOOL_GCC4MACHO_CXXFLAGS ?=
|
---|
[667] | 74 | TOOL_GCC4MACHO_CXXFLAGS.debug ?= -g
|
---|
| 75 | TOOL_GCC4MACHO_CXXFLAGS.profile ?= -g -O2 #-pg
|
---|
| 76 | TOOL_GCC4MACHO_CXXFLAGS.release ?= -O2
|
---|
| 77 | TOOL_GCC4MACHO_CXXINCS ?=
|
---|
| 78 | TOOL_GCC4MACHO_CXXDEFS ?=
|
---|
| 79 |
|
---|
[1257] | 80 | TOOL_GCC4MACHO_OBJCOBJSUFF ?= .o
|
---|
| 81 | TOOL_GCC4MACHO_OBJCFLAGS ?=
|
---|
| 82 | TOOL_GCC4MACHO_OBJCFLAGS.debug ?= -g
|
---|
| 83 | TOOL_GCC4MACHO_OBJCFLAGS.profile?= -O2 #-g -pg
|
---|
| 84 | TOOL_GCC4MACHO_OBJCFLAGS.release?= -O2
|
---|
| 85 | TOOL_GCC4MACHO_OBJCINCS ?=
|
---|
| 86 | TOOL_GCC4MACHO_OBJCDEFS ?=
|
---|
| 87 |
|
---|
[2356] | 88 | TOOL_GCC4MACHO_OBJCXXOBJSUFF ?= .o
|
---|
| 89 | TOOL_GCC4MACHO_OBJCXXFLAGS ?=
|
---|
| 90 | TOOL_GCC4MACHO_OBJCXXFLAGS.debug ?= -g
|
---|
| 91 | TOOL_GCC4MACHO_OBJCXXFLAGS.profile ?= -O2 #-g -pg
|
---|
| 92 | TOOL_GCC4MACHO_OBJCXXFLAGS.release ?= -O2
|
---|
| 93 | TOOL_GCC4MACHO_OBJCXXINCS ?=
|
---|
| 94 | TOOL_GCC4MACHO_OBJCXXDEFS ?=
|
---|
| 95 |
|
---|
[667] | 96 | TOOL_GCC4MACHO_ASFLAGS ?= -x assembler-with-cpp
|
---|
| 97 | TOOL_GCC4MACHO_ASFLAGS.debug ?= -g
|
---|
| 98 | TOOL_GCC4MACHO_ASFLAGS.profile ?= -g
|
---|
| 99 | TOOL_GCC4MACHO_ASOBJSUFF ?= .o
|
---|
| 100 |
|
---|
| 101 | TOOL_GCC4MACHO_ARFLAGS ?= -c -rs
|
---|
| 102 | TOOL_GCC4MACHO_ARLIBSUFF ?= .a
|
---|
| 103 |
|
---|
| 104 | TOOL_GCC4MACHO_LDFLAGS ?=
|
---|
| 105 | TOOL_GCC4MACHO_LDFLAGS.debug ?= -g
|
---|
| 106 | TOOL_GCC4MACHO_LDFLAGS.profile ?= -g
|
---|
| 107 |
|
---|
| 108 |
|
---|
[2523] | 109 | ##
|
---|
| 110 | # Calculate the files in the debug bundle.
|
---|
| 111 | # @param 1 The whole output filename.
|
---|
[2535] | 112 | # @param 2 The output filename sans suffix.
|
---|
[2523] | 113 | TOOL_GCC4MACHO_DEBUG_BUNDLE_FN = \
|
---|
| 114 | $(1).dSYM/ \
|
---|
| 115 | $(1).dSYM/Contents/ \
|
---|
| 116 | $(1).dSYM/Contents/Resources/ \
|
---|
| 117 | $(1).dSYM/Contents/Resources/DWARF/ \
|
---|
| 118 | $(1).dSYM/Contents/Info.plist \
|
---|
| 119 | $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1))
|
---|
| 120 |
|
---|
| 121 | ##
|
---|
| 122 | # Calculate the files in the debug bundle.
|
---|
| 123 | # @param 1 The whole linker output filename.
|
---|
[2535] | 124 | # @param 2 The linker output filename sans suffix.
|
---|
[2523] | 125 | # @param 3 The desired install name (no dir slash).
|
---|
[2535] | 126 | # @remarks The Info.plist has some reference to the original name, but gdb
|
---|
| 127 | # does not care and only check for a symbol file in the DWARF
|
---|
| 128 | # directory with the same name as the debugged module.
|
---|
[2523] | 129 | TOOL_GCC4MACHO_DEBUG_INSTALL_FN= \
|
---|
| 130 | $(3).dSYM/ \
|
---|
| 131 | $(3).dSYM/Contents/ \
|
---|
| 132 | $(3).dSYM/Contents/Resources/ \
|
---|
| 133 | $(3).dSYM/Contents/Resources/DWARF/ \
|
---|
| 134 | $(1).dSYM/Contents/Info.plist=>$(3).dSYM/Contents/Info.plist \
|
---|
[2535] | 135 | $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1))=>$(3).dSYM/Contents/Resources/DWARF/$(notdir $(3))
|
---|
[2523] | 136 |
|
---|
| 137 |
|
---|
[557] | 138 | ## Compile C source.
|
---|
| 139 | # @param $(target) Normalized main target name.
|
---|
| 140 | # @param $(source) Source filename (relative).
|
---|
| 141 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 142 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 143 | # @param $(flags) Flags.
|
---|
| 144 | # @param $(defs) Definitions. No -D or something.
|
---|
| 145 | # @param $(incs) Includes. No -I or something.
|
---|
| 146 | # @param $(dirdep) Directory creation dependency.
|
---|
| 147 | # @param $(deps) Other dependencies.
|
---|
| 148 | #
|
---|
| 149 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 150 | # @param $(objsuff) Object suffix.
|
---|
[560] | 151 | TOOL_GCC4MACHO_COMPILE_C_DEPEND =
|
---|
| 152 | TOOL_GCC4MACHO_COMPILE_C_DEPORD =
|
---|
[1418] | 153 | ifdef KBUILD_USE_KOBJCACHE
|
---|
[1013] | 154 | TOOL_GCC4MACHO_COMPILE_C_USES_KOBJCACHE = 1
|
---|
| 155 | TOOL_GCC4MACHO_COMPILE_C_OUTPUT = $(outbase).i
|
---|
[560] | 156 | define TOOL_GCC4MACHO_COMPILE_C_CMDS
|
---|
[1052] | 157 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 158 | --kObjCache-cpp $(outbase).i\
|
---|
[1013] | 159 | $(TOOL_GCC4MACHO_CC) -E -o -\
|
---|
[3566] | 160 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1013] | 161 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[1052] | 162 | $(abspath $(source))\
|
---|
| 163 | --kObjCache-cc $(obj)\
|
---|
[1013] | 164 | $(TOOL_GCC4MACHO_CC) -c\
|
---|
[1052] | 165 | $(flags) -fpreprocessed -x c\
|
---|
[1013] | 166 | -o $(obj)\
|
---|
[1052] | 167 | -
|
---|
[2431] | 168 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[1013] | 169 | endef
|
---|
[1418] | 170 | else # !KBUILD_USE_KOBJCACHE
|
---|
[1013] | 171 | TOOL_GCC4MACHO_COMPILE_C_OUTPUT =
|
---|
| 172 | define TOOL_GCC4MACHO_COMPILE_C_CMDS
|
---|
[696] | 173 | $(QUIET)$(TOOL_GCC4MACHO_CC) -c\
|
---|
[3566] | 174 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[557] | 175 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 176 | -o $(obj)\
|
---|
[697] | 177 | $(abspath $(source))
|
---|
[2431] | 178 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[557] | 179 | endef
|
---|
[1013] | 180 | endif # !KUSE_OBJCACHE
|
---|
[557] | 181 |
|
---|
| 182 |
|
---|
| 183 | ## Compile C++ source.
|
---|
| 184 | # @param $(target) Normalized main target name.
|
---|
| 185 | # @param $(source) Source filename (relative).
|
---|
| 186 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 187 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 188 | # @param $(flags) Flags.
|
---|
| 189 | # @param $(defs) Definitions. No -D or something.
|
---|
| 190 | # @param $(incs) Includes. No -I or something.
|
---|
| 191 | # @param $(dirdep) Directory creation dependency.
|
---|
| 192 | # @param $(deps) Other dependencies.
|
---|
| 193 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 194 | # @param $(objsuff) Object suffix.
|
---|
[560] | 195 | TOOL_GCC4MACHO_COMPILE_CXX_DEPEND =
|
---|
| 196 | TOOL_GCC4MACHO_COMPILE_CXX_DEPORD =
|
---|
[1418] | 197 | ifdef KBUILD_USE_KOBJCACHE
|
---|
[1013] | 198 | TOOL_GCC4MACHO_COMPILE_CXX_USES_KOBJCACHE = 1
|
---|
| 199 | TOOL_GCC4MACHO_COMPILE_CXX_OUTPUT = $(outbase).ii
|
---|
[560] | 200 | define TOOL_GCC4MACHO_COMPILE_CXX_CMDS
|
---|
[1052] | 201 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 202 | --kObjCache-cpp $(outbase).ii\
|
---|
[1013] | 203 | $(TOOL_GCC4MACHO_CXX) -E -o -\
|
---|
[3566] | 204 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1013] | 205 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
[1052] | 206 | $(abspath $(source))\
|
---|
| 207 | --kObjCache-cc $(obj)\
|
---|
[1013] | 208 | $(TOOL_GCC4MACHO_CXX) -c\
|
---|
[1052] | 209 | $(flags) -fpreprocessed -x c++\
|
---|
[1013] | 210 | -o $(obj)\
|
---|
[1052] | 211 | -
|
---|
[2431] | 212 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[1013] | 213 | endef
|
---|
[1418] | 214 | else # !KBUILD_USE_KOBJCACHE
|
---|
[1013] | 215 | TOOL_GCC4MACHO_COMPILE_CXX_OUTPUT =
|
---|
| 216 | define TOOL_GCC4MACHO_COMPILE_CXX_CMDS
|
---|
[696] | 217 | $(QUIET)$(TOOL_GCC4MACHO_CXX) -c\
|
---|
[3566] | 218 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[557] | 219 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 220 | -o $(obj)\
|
---|
[697] | 221 | $(abspath $(source))
|
---|
[2431] | 222 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[557] | 223 | endef
|
---|
[1418] | 224 | endif # !KBUILD_USE_KOBJCACHE
|
---|
[557] | 225 |
|
---|
| 226 |
|
---|
[1257] | 227 | ## Compile Objective-C source.
|
---|
| 228 | # @param $(target) Normalized main target name.
|
---|
| 229 | # @param $(source) Source filename (relative).
|
---|
| 230 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 231 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 232 | # @param $(flags) Flags.
|
---|
| 233 | # @param $(defs) Definitions. No -D or something.
|
---|
| 234 | # @param $(incs) Includes. No -I or something.
|
---|
| 235 | # @param $(dirdep) Directory creation dependency.
|
---|
| 236 | # @param $(deps) Other dependencies.
|
---|
| 237 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 238 | # @param $(objsuff) Object suffix.
|
---|
| 239 | TOOL_GCC4MACHO_COMPILE_OBJC_DEPEND =
|
---|
| 240 | TOOL_GCC4MACHO_COMPILE_OBJC_DEPORD =
|
---|
[1418] | 241 | ifdef KBUILD_USE_KOBJCACHE
|
---|
[1257] | 242 | TOOL_GCC4MACHO_COMPILE_OBJC_USES_KOBJCACHE = 1
|
---|
| 243 | TOOL_GCC4MACHO_COMPILE_OBJC_OUTPUT = $(outbase).mi
|
---|
| 244 | define TOOL_GCC4MACHO_COMPILE_OBJC_CMDS
|
---|
| 245 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 246 | --kObjCache-cpp $(outbase).ii\
|
---|
| 247 | $(TOOL_GCC4MACHO_OBJC) -E -o -\
|
---|
[3566] | 248 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1257] | 249 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 250 | $(abspath $(source))\
|
---|
| 251 | --kObjCache-cc $(obj)\
|
---|
| 252 | $(TOOL_GCC4MACHO_OBJC) -c\
|
---|
| 253 | $(flags) -fpreprocessed -x cbjective-c\
|
---|
| 254 | -o $(obj)\
|
---|
| 255 | -
|
---|
[2431] | 256 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[1257] | 257 | endef
|
---|
[1418] | 258 | else # !KBUILD_USE_KOBJCACHE
|
---|
[1257] | 259 | TOOL_GCC4MACHO_COMPILE_OBJC_OUTPUT =
|
---|
| 260 | define TOOL_GCC4MACHO_COMPILE_OBJC_CMDS
|
---|
| 261 | $(QUIET)$(TOOL_GCC4MACHO_OBJC) -c\
|
---|
[3566] | 262 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[1257] | 263 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 264 | -o $(obj)\
|
---|
| 265 | $(abspath $(source))
|
---|
[2431] | 266 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[1257] | 267 | endef
|
---|
[1418] | 268 | endif # !KBUILD_USE_KOBJCACHE
|
---|
[1257] | 269 |
|
---|
| 270 |
|
---|
[2356] | 271 | ## Compile Objective-C++ source.
|
---|
| 272 | # @param $(target) Normalized main target name.
|
---|
| 273 | # @param $(source) Source filename (relative).
|
---|
| 274 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 275 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 276 | # @param $(flags) Flags.
|
---|
| 277 | # @param $(defs) Definitions. No -D or something.
|
---|
| 278 | # @param $(incs) Includes. No -I or something.
|
---|
| 279 | # @param $(dirdep) Directory creation dependency.
|
---|
| 280 | # @param $(deps) Other dependencies.
|
---|
| 281 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 282 | # @param $(objsuff) Object suffix.
|
---|
| 283 | TOOL_GCC4MACHO_COMPILE_OBJCXX_DEPEND =
|
---|
| 284 | TOOL_GCC4MACHO_COMPILE_OBJCXX_DEPORD =
|
---|
| 285 | ifdef KBUILD_USE_KOBJCACHE
|
---|
| 286 | TOOL_GCC4MACHO_COMPILE_OBJCXX_USES_KOBJCACHE = 1
|
---|
| 287 | TOOL_GCC4MACHO_COMPILE_OBJCXX_OUTPUT = $(outbase).mii
|
---|
| 288 | define TOOL_GCC4MACHO_COMPILE_OBJCXX_CMDS
|
---|
| 289 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
| 290 | --kObjCache-cpp $(outbase).mii\
|
---|
| 291 | $(TOOL_GCC4MACHO_OBJCXX) -E -o -\
|
---|
[3566] | 292 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2356] | 293 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 294 | $(abspath $(source))\
|
---|
| 295 | --kObjCache-cc $(obj)\
|
---|
| 296 | $(TOOL_GCC4MACHO_OBJCXX) -c\
|
---|
[2360] | 297 | $(flags) -fpreprocessed -x objective-c++\
|
---|
[2356] | 298 | -o $(obj)\
|
---|
| 299 | -
|
---|
[2431] | 300 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[2356] | 301 | endef
|
---|
| 302 | else # !KBUILD_USE_KOBJCACHE
|
---|
| 303 | TOOL_GCC4MACHO_COMPILE_OBJCXX_OUTPUT =
|
---|
| 304 | define TOOL_GCC4MACHO_COMPILE_OBJCXX_CMDS
|
---|
| 305 | $(QUIET)$(TOOL_GCC4MACHO_OBJCXX) -c\
|
---|
[3566] | 306 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2356] | 307 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 308 | -o $(obj)\
|
---|
| 309 | $(abspath $(source))
|
---|
[2431] | 310 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[2356] | 311 | endef
|
---|
| 312 | endif # !KBUILD_USE_KOBJCACHE
|
---|
| 313 |
|
---|
| 314 |
|
---|
[557] | 315 | ## Compile Assembly source.
|
---|
| 316 | # @param $(target) Normalized main target name.
|
---|
| 317 | # @param $(source) Source filename (relative).
|
---|
| 318 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 319 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 320 | # @param $(flags) Flags.
|
---|
| 321 | # @param $(defs) Definitions. No -D or something.
|
---|
| 322 | # @param $(incs) Includes. No -I or something.
|
---|
| 323 | # @param $(dirdep) Directory creation dependency.
|
---|
| 324 | # @param $(deps) Other dependencies.
|
---|
| 325 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 326 | # @param $(objsuff) Object suffix.
|
---|
| 327 | #
|
---|
[560] | 328 | TOOL_GCC4MACHO_COMPILE_AS_OUTPUT =
|
---|
| 329 | TOOL_GCC4MACHO_COMPILE_AS_DEPEND =
|
---|
| 330 | TOOL_GCC4MACHO_COMPILE_AS_DEPORD =
|
---|
| 331 | define TOOL_GCC4MACHO_COMPILE_AS_CMDS
|
---|
[696] | 332 | $(QUIET)$(TOOL_GCC4MACHO_AS) -c\
|
---|
[3566] | 333 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[557] | 334 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
| 335 | -o $(obj)\
|
---|
[697] | 336 | $(abspath $(source))
|
---|
[2431] | 337 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
[557] | 338 | endef
|
---|
| 339 |
|
---|
| 340 |
|
---|
| 341 | ## Link library
|
---|
| 342 | # @param $(target) Normalized main target name.
|
---|
| 343 | # @param $(out) Library name.
|
---|
| 344 | # @param $(objs) Object files to put in the library.
|
---|
| 345 | # @param $(flags) Flags.
|
---|
| 346 | # @param $(dirdep) Directory creation dependency.
|
---|
| 347 | # @param $(deps) Other dependencies.
|
---|
| 348 | # @param $(othersrc) Unhandled sources.
|
---|
| 349 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[772] | 350 | TOOL_GCC4MACHO_LINK_LIBRARY_OUTPUT =
|
---|
| 351 | TOOL_GCC4MACHO_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
[560] | 352 | TOOL_GCC4MACHO_LINK_LIBRARY_DEPORD =
|
---|
| 353 | define TOOL_GCC4MACHO_LINK_LIBRARY_CMDS
|
---|
[1174] | 354 | $(if $(strip $(objs)),$(call xargs,$(QUIET)$(TOOL_GCC4MACHO_AR) $(flags) $(out),$(objs)))
|
---|
[844] | 355 | $(foreach lib,$(othersrc)\
|
---|
| 356 | ,$(NL)$(TAB)$(call MSG_AR_MERGE,$(target),$(out),$(lib)) \
|
---|
| 357 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))ar.tmp.dir/* \
|
---|
| 358 | $(NL)$(TAB)$(QUIET)$(MKDIR) -p $(dir $(outbase))/ar.tmp.dir/ \
|
---|
| 359 | $(NL)$(TAB)$(QUIET)(cd $(dir $(outbase))ar.tmp.dir/ \
|
---|
| 360 | && $(TOOL_GCC4MACHO_AR) -x $(abspath $(lib)) \
|
---|
[856] | 361 | && $(RM_EXT) -f ./__.SYMDEF* \
|
---|
[844] | 362 | && $(TOOL_GCC4MACHO_AR) $(flags) $(out) *) \
|
---|
| 363 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))/ar.tmp.dir/* \
|
---|
| 364 | $(NL)$(TAB)$(QUIET)$(RMDIR) $(dir $(outbase))ar.tmp.dir/)
|
---|
[557] | 365 | endef
|
---|
| 366 |
|
---|
| 367 |
|
---|
| 368 | ## Link program
|
---|
| 369 | # @param $(target) Normalized main target name.
|
---|
| 370 | # @param $(out) Program name.
|
---|
| 371 | # @param $(objs) Object files to link together.
|
---|
| 372 | # @param $(libs) Libraries to search.
|
---|
| 373 | # @param $(libpath) Library search paths.
|
---|
| 374 | # @param $(flags) Flags.
|
---|
| 375 | # @param $(dirdep) Directory creation dependency.
|
---|
| 376 | # @param $(deps) Other dependencies.
|
---|
| 377 | # @param $(othersrc) Unhandled sources.
|
---|
| 378 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 379 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 380 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[1023] | 381 | TOOL_GCC4MACHO_LINK_PROGRAM_OUTPUT = $(outbase).rsp
|
---|
[2523] | 382 | TOOL_GCC4MACHO_LINK_PROGRAM_OUTPUT_DEBUG = $(call TOOL_GCC4MACHO_DEBUG_BUNDLE_FN,$(out))
|
---|
| 383 | TOOL_GCC4MACHO_LINK_PROGRAM_DEBUG_INSTALL_FN = $(TOOL_GCC4MACHO_DEBUG_INSTALL_FN)
|
---|
[560] | 384 | TOOL_GCC4MACHO_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
| 385 | TOOL_GCC4MACHO_LINK_PROGRAM_DEPORD =
|
---|
| 386 | define TOOL_GCC4MACHO_LINK_PROGRAM_CMDS
|
---|
[844] | 387 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs)
|
---|
| 388 | $(QUIET)$(TOOL_GCC4MACHO_LD) $(flags) -o $(out)\
|
---|
| 389 | -filelist $(outbase).rsp\
|
---|
[557] | 390 | $(foreach p,$(libpath), -L$(p))\
|
---|
[1259] | 391 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
|
---|
[2523] | 392 | ifeq ($(ld_debug),split)
|
---|
[2535] | 393 | $(QUIET)$(TOOL_GCC4MACHO_DSYMUTIL) -o $(out).dSYM/ $(out)
|
---|
| 394 | $(QUIET)$(TOOL_GCC4MACHO_STRIP_PROGRAM) $(out)
|
---|
[2523] | 395 | endif
|
---|
[557] | 396 | endef
|
---|
| 397 |
|
---|
| 398 |
|
---|
[2523] | 399 |
|
---|
[557] | 400 | ## Link DLL
|
---|
| 401 | # @param $(target) Normalized main target name.
|
---|
| 402 | # @param $(out) Program name.
|
---|
| 403 | # @param $(objs) Object files to link together.
|
---|
| 404 | # @param $(libs) Libraries to search.
|
---|
| 405 | # @param $(libpath) Library search paths.
|
---|
| 406 | # @param $(flags) Flags.
|
---|
| 407 | # @param $(dirdep) Directory creation dependency.
|
---|
| 408 | # @param $(deps) Other dependencies.
|
---|
| 409 | # @param $(othersrc) Unhandled sources.
|
---|
| 410 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 411 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 412 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[844] | 413 | TOOL_GCC4MACHO_LINK_DLL_OUTPUT = $(outbase).rsp
|
---|
[2523] | 414 | TOOL_GCC4MACHO_LINK_DLL_OUTPUT_DEBUG = $(call TOOL_GCC4MACHO_DEBUG_BUNDLE_FN,$(out))
|
---|
| 415 | TOOL_GCC4MACHO_LINK_DLL_DEBUG_INSTALL_FN = $(TOOL_GCC4MACHO_DEBUG_INSTALL_FN)
|
---|
[560] | 416 | TOOL_GCC4MACHO_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
| 417 | TOOL_GCC4MACHO_LINK_DLL_DEPORD =
|
---|
| 418 | define TOOL_GCC4MACHO_LINK_DLL_CMDS
|
---|
[844] | 419 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs)
|
---|
[696] | 420 | $(QUIET)$(TOOL_GCC4MACHO_LD) $(TOOL_GCC4MACHO_LDFLAGS.dll) $(flags) -o $(out)\
|
---|
[844] | 421 | $(call TOOL_GCC4MACHO_LD_SONAME,$(target),$(out))\
|
---|
| 422 | -filelist $(outbase).rsp\
|
---|
[557] | 423 | $(foreach p,$(libpath), -L$(p))\
|
---|
[1259] | 424 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
|
---|
[2523] | 425 | ifeq ($(ld_debug),split)
|
---|
[2535] | 426 | $(QUIET)$(TOOL_GCC4MACHO_DSYMUTIL) -o $(out).dSYM/ $(out)
|
---|
| 427 | $(QUIET)$(TOOL_GCC4MACHO_STRIP_DLL) $(out)
|
---|
[2523] | 428 | endif
|
---|
[557] | 429 | endef
|
---|
| 430 |
|
---|
| 431 |
|
---|
| 432 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
| 433 | # @param $(target) Normalized main target name.
|
---|
| 434 | # @param $(out) System module name.
|
---|
| 435 | # @param $(objs) Object files to link together.
|
---|
| 436 | # @param $(libs) Libraries to search.
|
---|
| 437 | # @param $(libpath) Library search paths.
|
---|
| 438 | # @param $(flags) Flags.
|
---|
| 439 | # @param $(dirdep) Directory creation dependency.
|
---|
| 440 | # @param $(deps) Other dependencies.
|
---|
| 441 | # @param $(othersrc) Unhandled sources.
|
---|
| 442 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 443 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 444 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[844] | 445 | TOOL_GCC4MACHO_LINK_SYSMOD_OUTPUT = $(outbase).rsp
|
---|
[2523] | 446 | TOOL_GCC4MACHO_LINK_SYSMOD_OUTPUT_DEBUG = $(call TOOL_GCC4MACHO_DEBUG_BUNDLE_FN,$(out))
|
---|
| 447 | TOOL_GCC4MACHO_LINK_SYSMOD_DEBUG_INSTALL_FN = $(TOOL_GCC4MACHO_DEBUG_INSTALL_FN)
|
---|
[560] | 448 | TOOL_GCC4MACHO_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
| 449 | TOOL_GCC4MACHO_LINK_SYSMOD_DEPORD =
|
---|
| 450 | define TOOL_GCC4MACHO_LINK_SYSMOD_CMDS
|
---|
[844] | 451 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs)
|
---|
| 452 | $(QUIET)$(TOOL_GCC4MACHO_LD_SYSMOD) $(TOOL_GCC4MACHO_LDFLAGS.sysmod) $(flags) -o $(out)\
|
---|
| 453 | -filelist $(outbase).rsp\
|
---|
[557] | 454 | $(foreach p,$(libpath), -L$(p))\
|
---|
[1259] | 455 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
|
---|
[2523] | 456 | ifeq ($(ld_debug),split)
|
---|
[2535] | 457 | $(QUIET)$(TOOL_GCC4MACHO_DSYMUTIL) -o $(out).dSYM/ $(out)
|
---|
| 458 | $(QUIET)$(TOOL_GCC4MACHO_STRIP_SYSMOD) $(out)
|
---|
[2523] | 459 | endif
|
---|
[557] | 460 | endef
|
---|
| 461 |
|
---|