3 # kBuild Tool Config - MASM v5.10
7 # Copyright (c) 2008-2009 knut st. osmundsen <bird-kBuild-spamix@anduin.net>
9 # This file is part of kBuild.
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.
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.
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
26 # As a special exception you are granted permission to include this file, via
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.
29 # This exception does not however invalidate any other reasons why the makefile,
30 # program, whatever should not be covered the GPL.
34 TOOL_MASM510
:= Microsoft Macro Assembler v5.10
36 # Tool Specific Properties
37 ifndef TOOL_MASM510_AS
38 TOOL_MASM510_AS
:= $(firstword $(rsort
$(wildcard $(PATH_DEVTOOLS_BLD
)/masm
/v5.10
*/masm
$(HOSTSUFF_EXE
))))
39 ifeq ($(TOOL_MASM510_AS
),)
40 TOOL_MASM510_AS
:= $(firstword $(rsort
$(wildcard $(PATH_DEVTOOLS_TRG
)/masm
/v5.10
*/masm
$(HOSTSUFF_EXE
))))
42 ifeq ($(TOOL_MASM510_AS
),)
43 TOOL_MASM510_AS
:= $(firstword $(rsort
$(wildcard $(PATH_DEVTOOLS
)/os2.x86
/ddk
/*/base
/tools
/masm
$(HOSTSUFF_EXE
))))
45 ifeq ($(TOOL_MASM510_AS
),)
46 TOOL_MASM510_AS
:= $(firstword $(rsort
$(wildcard \
47 $(PATH_DEVTOOLS
)/os2.x86
/ddk
/*/video
/tools
/os2.386
/lx
.386/bin
/masm
$(HOSTSUFF_EXE
) \
48 $(PATH_DEVTOOLS
)/os2.x86
/ddk
/*/base32
/tools
/os2.386
/bin
/masm
$(HOSTSUFF_EXE
) \
49 $(PATH_DEVTOOLS
)/os2.x86
/ddk
/*/base32
/tools
/os2.386
/lx
.386/bin
/masm
$(HOSTSUFF_EXE
) \
50 $(PATH_DEVTOOLS
)/os2.x86
/ddk
/*/print/tools
/os2.386
/lx
.386/bin
/masm
$(HOSTSUFF_EXE
) \
51 $(PATH_DEVTOOLS
)/os2.x86
/ddk
/*/wpshell
/tools
/os2.386
/lx
.386/bin
/masm
$(HOSTSUFF_EXE
) \
52 $(PATH_DEVTOOLS
)/os2.x86
/ddk
/*/mme
/tools
/os2.386
/lx
.386/bin
/masm
$(HOSTSUFF_EXE
) \
55 ifneq ($(TOOL_MASM510_AS
),)
56 TOOL_MASM510_AS
:= $(TOOL_MASM510_AS
)
59 ifeq ($(TOOL_MASM510_AS
),)
60 TOOL_MASM510_AS
:= $(firstword $(which masm
$(HOSTSUFF_EXE
)) path
/notfound
/masm
$(HOSTSUFF_EXE
))
63 # General Properties used by kBuild
64 TOOL_MASM510_ASFLAGS ?
= -t
-z
-Zd
-Zi
-t
67 ## Compile Assembly source.
68 # @param $(target) Normalized main target name.
69 # @param $(source) Source filename (relative).
70 # @param $(obj) Object file name. This shall be (re)created by the compilation.
71 # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
72 # @param $(flags) Flags.
73 # @param $(defs) Definitions. No -D or something.
74 # @param $(incs) Includes. No -I or something.
75 # @param $(dirdep) Directory creation dependency.
76 # @param $(deps) Other dependencies.
78 # @param $(outbase) Output basename (full). Use this for list files and such.
79 # @param $(objsuff) Object suffix.
81 # @remarks MASM v5.10 has severe length limitations in several places and will respond with
82 # crashing when these are exceeded. Thus, we use MASM and INCLUDE to avoid exceeding
83 # the command line length (and the MASM length).
84 # The closing of file handles and zapping of environment is to make sure it doesn't
85 # mess up due handles left behind by some device init or because the env is too big.
86 TOOL_MASM510_COMPILE_AS_OUTPUT
= $(outbase
).lst
87 TOOL_MASM510_COMPILE_AS_DEPEND
=
88 TOOL_MASM510_COMPILE_AS_DEPORD
=
89 define TOOL_MASM510_COMPILE_AS_CMDS
91 -c3
-c4
-c5
-c6
-c7
-c8
-c9
-c10
-c11
-c12
-c13
-c14
-c15
-c16
-c17
-c18
-c19
-Z \
92 -E
'MASM=$(addprefix -D, $(subst /,\,$(defs)))' \
93 -E
'INCLUDE=$(subst $(SP),,$(addsuffix ;,$(subst /,\,$(incs))))' \
95 $(subst /,\\,$(TOOL_MASM510_AS
)) $(strip $(flags
)) '$(subst /,\,$(source),$(obj),$(outbase).lst);'