source: trunk/kBuild/tools/NASM.kmk@ 1257

Last change on this file since 1257 was 782, checked in by bird, 18 years ago

copyright 2007

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1# $Id: NASM.kmk 782 2007-01-24 20:19:57Z bird $
2## @file
3#
4# kBuild Tool Config - Netwide Assembler v0.98+.
5#
6# Copyright (c) 2004-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
27TOOL_NASM := Netwide Assembler v0.98+
28
29# Tool Specific Properties
30ifndef PATH_TOOL_NASM
31 PATH_TOOL_NASM := $(sort $(wildcard $(PATH_DEVTOOLS_BLD)/nasm/v*.*))
32 ifneq ($(PATH_TOOL_NASM),)
33 PATH_TOOL_NASM := $(call lastword,$(PATH_TOOL_NASM))
34 endif
35else
36 # Resolve any fancy stuff once and for all.
37 PATH_TOOL_NASM := $(PATH_TOOL_NASM)
38endif
39
40ifneq ($(PATH_TOOL_NASM),)
41 TOOL_NASM_AS ?= $(PATH_TOOL_NASM)/nasm$(HOSTSUFF_EXE)
42else
43 TOOL_NASM_AS ?= nasm$(HOSTSUFF_EXE)
44endif
45
46# General Properties used by kBuild
47TOOL_NASM_ASFLAGS ?=
48
49
50## Compile Assembly source.
51# @param $(target) Normalized main target name.
52# @param $(source) Source filename (relative).
53# @param $(obj) Object file name. This shall be (re)created by the compilation.
54# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
55# @param $(flags) Flags.
56# @param $(defs) Definitions. No -D or something.
57# @param $(incs) Includes. No -I or something.
58# @param $(dirdep) Directory creation dependency.
59# @param $(deps) Other dependencies.
60# @param $(outbase) Output basename (full). Use this for list files and such.
61# @param $(objsuff) Object suffix.
62#
63TOOL_NASM_COMPILE_AS_OUTPUT = $(outbase).lst
64TOOL_NASM_COMPILE_AS_DEPEND =
65TOOL_NASM_COMPILE_AS_DEPORD =
66define TOOL_NASM_COMPILE_AS_CMDS
67 $(QUIET)$(TOOL_NASM_AS)\
68 $(flags) $(addsuffix /,$(addprefix -i, $(incs))) $(addprefix -D, $(defs))\
69 -l $(outbase).lst\
70 -o $(obj)\
71 $(abspath $(source))
72 $(QUIET)$(TOOL_NASM_AS)\
73 $(flags) $(addsuffix /,$(addprefix -i, $(incs))) $(addprefix -D, $(defs))\
74 -l $(outbase).lst\
75 -o $(obj)\
76 $(abspath $(source)) \
77 -M >> $(dep)
78endef
79
Note: See TracBrowser for help on using the repository browser.