source: trunk/kBuild/tools/MASM510.kmk@ 3325

Last change on this file since 3325 was 3121, checked in by bird, 8 years ago

(C) year)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.1 KB
Line 
1# $Id: MASM510.kmk 3121 2017-10-31 10:58:59Z bird $
2## @file
3# kBuild Tool Config - MASM v5.10
4#
5
6#
7# Copyright (c) 2008-2017 knut st. osmundsen <bird-kBuild-spam-xviiv@anduin.net>
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# 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.
31#
32#
33
34TOOL_MASM510 := Microsoft Macro Assembler v5.10
35
36# Tool Specific Properties
37ifndef TOOL_MASM510_AS
38 TOOL_MASM510_AS := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/masm/v5.10*/masm$(HOSTSUFF_EXE))))
39 ifeq ($(TOOL_MASM510_AS),)
40 TOOL_MASM510_AS := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_TRG)/masm/v5.10*/masm$(HOSTSUFF_EXE))))
41 endif
42 ifeq ($(TOOL_MASM510_AS),)
43 TOOL_MASM510_AS := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS)/os2.x86/ddk/*/base/tools/masm$(HOSTSUFF_EXE))))
44 endif
45 ifeq ($(TOOL_MASM510_AS),)
46 TOOL_MASM510_AS := $(firstword $(rsort $(wildcard \
47 $(KBUILD_DEVTOOLS)/os2.x86/ddk/*/video/tools/os2.386/lx.386/bin/masm$(HOSTSUFF_EXE) \
48 $(KBUILD_DEVTOOLS)/os2.x86/ddk/*/base32/tools/os2.386/bin/masm$(HOSTSUFF_EXE) \
49 $(KBUILD_DEVTOOLS)/os2.x86/ddk/*/base32/tools/os2.386/lx.386/bin/masm$(HOSTSUFF_EXE) \
50 $(KBUILD_DEVTOOLS)/os2.x86/ddk/*/print/tools/os2.386/lx.386/bin/masm$(HOSTSUFF_EXE) \
51 $(KBUILD_DEVTOOLS)/os2.x86/ddk/*/wpshell/tools/os2.386/lx.386/bin/masm$(HOSTSUFF_EXE) \
52 $(KBUILD_DEVTOOLS)/os2.x86/ddk/*/mme/tools/os2.386/lx.386/bin/masm$(HOSTSUFF_EXE) \
53 )))
54 endif
55 ifneq ($(TOOL_MASM510_AS),)
56 TOOL_MASM510_AS := $(TOOL_MASM510_AS)
57 endif
58endif
59ifeq ($(TOOL_MASM510_AS),)
60 TOOL_MASM510_AS := $(firstword $(which masm$(HOSTSUFF_EXE)) path/notfound/masm$(HOSTSUFF_EXE))
61endif
62
63# General Properties used by kBuild
64TOOL_MASM510_ASFLAGS ?= -t -z -Zd -Zi -t
65
66
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.
77#
78# @param $(outbase) Output basename (full). Use this for list files and such.
79# @param $(objsuff) Object suffix.
80#
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.
86TOOL_MASM510_COMPILE_AS_OUTPUT = $(outbase).lst
87TOOL_MASM510_COMPILE_AS_DEPEND =
88TOOL_MASM510_COMPILE_AS_DEPORD =
89define TOOL_MASM510_COMPILE_AS_CMDS
90 $(QUIET)$(REDIRECT) \
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))))' \
94 -- \
95 $(subst /,\\,$(TOOL_MASM510_AS)) $(strip $(flags)) '$(subst /,\,$(source),$(obj),$(outbase).lst);'
96endef
97
Note: See TracBrowser for help on using the repository browser.