source: trunk/kBuild/tools/YASM.kmk@ 650

Last change on this file since 650 was 650, checked in by bird, 19 years ago

PATH_DEV -> PATH_DEV_BLD w/ compatability hack.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1# $Id: YASM.kmk 650 2006-12-03 23:41:26Z bird $
2## @file
3#
4# kBuild Tool Config - YASM 0.4.0 or later.
5#
6# Copyright (c) 2006 knut st. osmundsen <bird-srcspam@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
28TOOL_YASM := Yasm, the modular assembler v0.4.0+
29ifndef PATH_TOOL_YASM
30PATH_DEV_BLD ?= $(PATH_DEV)/$(BUILD_PLATFORM_ARCH).$(BUILD_PLATFORM)
31PATH_TOOL_YASM := $(sort $(wildcard $(PATH_DEV_BLD)/yasm/v*.*))
32ifneq ($(PATH_TOOL_YASM),)
33PATH_TOOL_YASM := $(call lastword,$(PATH_TOOL_YASM))
34endif
35endif
36
37ifneq ($(PATH_TOOL_YASM),)
38TOOL_YASM_AS := $(PATH_TOOL_YASM)/yasm$(HOSTSUFF_EXE)
39else
40TOOL_YASM_AS := yasm$(HOSTSUFF_EXE)
41endif
42TOOL_YASM_ASFLAGS :=
43
44
45## Compile Assembly source.
46# @param $(target) Normalized main target name.
47# @param $(source) Source filename (relative).
48# @param $(obj) Object file name. This shall be (re)created by the compilation.
49# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
50# @param $(flags) Flags.
51# @param $(defs) Definitions. No -D or something.
52# @param $(incs) Includes. No -I or something.
53# @param $(dirdep) Directory creation dependency.
54# @param $(deps) Other dependencies.
55# @param $(outbase) Output basename (full). Use this for list files and such.
56# @param $(objsuff) Object suffix.
57#
58TOOL_YASM_COMPILE_AS_OUTPUT = $(outbase).lst
59TOOL_YASM_COMPILE_AS_DEPEND =
60TOOL_YASM_COMPILE_AS_DEPORD =
61define TOOL_YASM_COMPILE_AS_CMDS
62 $(TOOL_YASM_AS)\
63 $(flags) $(addsuffix /,$(addprefix -I, $(incs))) $(addprefix -D, $(defs))\
64 -l $(outbase).lst\
65 -o $(obj)\
66 $(call ABSPATH,$(source))
67 $(TOOL_YASM_AS)\
68 $(flags) $(addsuffix /,$(addprefix -I, $(incs))) $(addprefix -D, $(defs))\
69 -o $(obj) \
70 $(call ABSPATH,$(source)) \
71 -M > $(dep)
72endef
73
Note: See TracBrowser for help on using the repository browser.