| 1 | # $Id: YASM.kmk 782 2007-01-24 20:19:57Z bird $
|
|---|
| 2 | ## @file
|
|---|
| 3 | #
|
|---|
| 4 | # kBuild Tool Config - YASM 0.4.0 or later.
|
|---|
| 5 | #
|
|---|
| 6 | # Copyright (c) 2006-2007 knut st. osmundsen <bird-kBuild-spam@anduin.net>
|
|---|
| 7 | #
|
|---|
| 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 |
|
|---|
| 27 | TOOL_YASM := YASM v0.4.0+
|
|---|
| 28 |
|
|---|
| 29 | # Tool Specific Properties
|
|---|
| 30 | ifndef PATH_TOOL_YASM
|
|---|
| 31 | PATH_TOOL_YASM := $(sort $(wildcard $(PATH_DEVTOOLS_BLD)/yasm/v*.*))
|
|---|
| 32 | ifneq ($(PATH_TOOL_YASM),)
|
|---|
| 33 | PATH_TOOL_YASM := $(call lastword,$(PATH_TOOL_YASM))
|
|---|
| 34 | endif
|
|---|
| 35 | else
|
|---|
| 36 | # Resolve any fancy stuff once and for all.
|
|---|
| 37 | PATH_TOOL_YASM := $(PATH_TOOL_YASM)
|
|---|
| 38 | endif
|
|---|
| 39 | ifneq ($(PATH_TOOL_YASM),)
|
|---|
| 40 | TOOL_YASM_AS ?= $(PATH_TOOL_YASM)/yasm$(HOSTSUFF_EXE)
|
|---|
| 41 | else
|
|---|
| 42 | TOOL_YASM_AS ?= yasm$(HOSTSUFF_EXE)
|
|---|
| 43 | endif
|
|---|
| 44 |
|
|---|
| 45 | # General Properties used by kBuild
|
|---|
| 46 | TOOL_YASM_ASFLAGS ?=
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 | ## Compile Assembly source.
|
|---|
| 50 | # @param $(target) Normalized main target name.
|
|---|
| 51 | # @param $(source) Source filename (relative).
|
|---|
| 52 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 53 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 54 | # @param $(flags) Flags.
|
|---|
| 55 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 56 | # @param $(incs) Includes. No -I or something.
|
|---|
| 57 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 58 | # @param $(deps) Other dependencies.
|
|---|
| 59 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 60 | # @param $(objsuff) Object suffix.
|
|---|
| 61 | #
|
|---|
| 62 | TOOL_YASM_COMPILE_AS_OUTPUT = $(outbase).lst
|
|---|
| 63 | TOOL_YASM_COMPILE_AS_DEPEND =
|
|---|
| 64 | TOOL_YASM_COMPILE_AS_DEPORD =
|
|---|
| 65 | define TOOL_YASM_COMPILE_AS_CMDS
|
|---|
| 66 | $(QUIET)$(TOOL_YASM_AS)\
|
|---|
| 67 | $(flags) $(addsuffix /,$(addprefix -I, $(incs))) $(addprefix -D, $(defs))\
|
|---|
| 68 | -l $(outbase).lst\
|
|---|
| 69 | -o $(obj)\
|
|---|
| 70 | $(abspath $(source))
|
|---|
| 71 | $(QUIET)$(TOOL_YASM_AS)\
|
|---|
| 72 | $(flags) $(addsuffix /,$(addprefix -I, $(incs))) $(addprefix -D, $(defs))\
|
|---|
| 73 | -o $(obj) \
|
|---|
| 74 | $(abspath $(source)) \
|
|---|
| 75 | -M > $(dep)
|
|---|
| 76 | endef
|
|---|
| 77 |
|
|---|