| 1 | # $Id: NASM.kmk 380 2005-12-18 13:52:47Z bird $
|
|---|
| 2 | ## @file
|
|---|
| 3 | #
|
|---|
| 4 | # kBuild Tool Config - NASM 0.98 or later.
|
|---|
| 5 | #
|
|---|
| 6 | # Copyright (c) 2004-2005 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 |
|
|---|
| 28 | TOOL_NASM := Netwide Assembler 0.98+
|
|---|
| 29 | ifndef PATH_TOOL_NASM
|
|---|
| 30 | PATH_TOOL_NASM := $(sort $(wildcard $(PATH_DEV)/$(BUILD_PLATFORM_ARCH).$(BUILD_PLATFORM)/nasm/v*.*))
|
|---|
| 31 | ifneq ($(PATH_TOOL_NASM),)
|
|---|
| 32 | PATH_TOOL_NASM := $(call lastword,$(PATH_TOOL_NASM))
|
|---|
| 33 | endif
|
|---|
| 34 | endif
|
|---|
| 35 |
|
|---|
| 36 | ifneq ($(PATH_TOOL_NASM),)
|
|---|
| 37 | TOOL_NASM_AS := $(PATH_TOOL_NASM)/nasm$(HOSTSUFF_EXE)
|
|---|
| 38 | else
|
|---|
| 39 | TOOL_NASM_AS := nasm$(HOSTSUFF_EXE)
|
|---|
| 40 | endif
|
|---|
| 41 | TOOL_NASM_ASFLAGS :=
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 | ## Compile Assembly source.
|
|---|
| 45 | # @param $(target) Normalized main target name.
|
|---|
| 46 | # @param $(source) Source filename (relative).
|
|---|
| 47 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 48 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 49 | # @param $(flags) Flags.
|
|---|
| 50 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 51 | # @param $(incs) Includes. No -I or something.
|
|---|
| 52 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 53 | # @param $(deps) Other dependencies.
|
|---|
| 54 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 55 | # @param $(objsuff) Object suffix.
|
|---|
| 56 | #
|
|---|
| 57 | TOOL_NASM_COMPILE_AS_OUTPUT = $(outbase).lst
|
|---|
| 58 | TOOL_NASM_COMPILE_AS_DEPEND =
|
|---|
| 59 | TOOL_NASM_COMPILE_AS_DEPORD =
|
|---|
| 60 | define TOOL_NASM_COMPILE_AS_CMDS
|
|---|
| 61 | $(TOOL_NASM_AS)\
|
|---|
| 62 | $(flags) $(addsuffix /,$(addprefix -i, $(incs))) $(addprefix -D, $(defs))\
|
|---|
| 63 | -l $(outbase).lst\
|
|---|
| 64 | -o $(obj)\
|
|---|
| 65 | $(call ABSPATH,$(source))
|
|---|
| 66 | endef
|
|---|
| 67 |
|
|---|