summaryrefslogtreecommitdiff
path: root/Mkfiles/Makefile.b32
blob: c9cb7203a2df3f0700aa5a823ac1e76aebe95d8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# Makefile for the Netwide Assembler under 32 bit NT console
#
# The Netwide Assembler is copyright (C) 1996 Simon Tatham and
# Julian Hall. All rights reserved. The software is
# redistributable under the licence given in the file "Licence"
# distributed in the NASM archive.
#
# This Makefile is designed to build NASM with the latest
# version of Borland C++Builder and has been tested with 
# Borland C++ 5.5 (Borland C++Builder 5.0) in combination
# Borland MAKE 5.2
#
# Additionally, the free Borland C++ Compiler 5.5 is supported;
# see
#
#   http://www.borland.com/bcppbuilder/freecompiler/
#
# MAKEFILE is maintained by Stefan.Hoffmeister@Econos.de
#

PERL=perl

srcdir=.
#BINDIR=e:\devel\bcb5\cbuilder5\bin

# If "BINDIR=C:\...." has not been defined on the command line
# assume that the binary files are in the same directory as the
# MAKE utility
!message ****************************************************
!message Note:
!message -----
!if $d(BINDIR)
  !message Path to tools set to $(BINDIR)
!else
  BINDIR=$(MAKEDIR)
  !message Assuming path to tools to be $(BINDIR)
  !message
  !message You can change this assumption by specifying
  !message   -DBINDIR=C:\my_path
  !message as a command line paramter for MAKE
!endif
!message ****************************************************


CC=$(BINDIR)\bcc32
CCFLAGS=-q -Q -tWC -c -O2 -A -d -w-8057
  # /q:    Suppress compiler identification banner
  # /Q:    Extended compiler error information
  # /-tWC: Windows console mode application
  # /c:    Compile, do not link
  # /O2:   Optimize for speed
  # /A:    ANSI compatible code only
  # /d:    Merge duplicate strings
  # /-w-8057: Turn off "Parameter <param> never used in function <func>" warning

LINK=$(BINDIR)\ilink32
LINKFLAGS=/V4.0 /q /x /c /ap /L$(BINDIR)\..\LIB     # /L -> default LIB directory
  # /V4.0: marked as Win95 / NT application in PE header
  # /q:    suppress command-line banner
  # /x:    no map file
  # /c:    case sensitive link
  # /ap:   link for 32-bit console application
  # /L...: path to .lib directory


# default libraries for Win32 console applications
LIBRARIES=cw32.lib import32.lib
# default startup code for Win32 console applications
STARTUP=c0x32.obj

# default extension for our EXE
EXE=.exe
# default extension for OBJ files
OBJ=obj


SUFFIX= w#       # by default, this makefile produces nasmw.exe and ndisasmw.exe


# Builds C files to OBJ
.c.$(OBJ):
  $(CC) $(CCFLAGS) $*.c


NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \
	     assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \
		  output\outbin.$(OBJ) output\outaout.$(OBJ) output\outcoff.$(OBJ) output\outelf.$(OBJ) \
		  output\outobj.$(OBJ) output\outas86.$(OBJ) output\outrdf.$(OBJ) output\outdbg.$(OBJ) \
        output\outrdf2.$(OBJ) output\outieee.$(OBJ) \
		  preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ)

NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
	      insnsd.$(OBJ)


BuildAll: nasm$(SUFFIX)$(EXE) ndisasm$(SUFFIX)$(EXE)


# NASM
nasm$(SUFFIX)$(EXE): $(NASMOBJS)
  $(LINK) $(LINKFLAGS) @&&|     #open temp response file
    $(STARTUP) $**
    nasm$(SUFFIX)$(EXE)
    # default MAP file name for EXE
    $(LIBRARIES)
|                                # close temp file, first column!


# NDISASM
ndisasm$(SUFFIX)$(EXE): $(NDISASMOBJS)
  $(LINK) $(LINKFLAGS) @&&|     #open temp response file
    $(STARTUP) $**
    ndisasm$(SUFFIX)$(EXE)
    # default MAP file name for EXE
    $(LIBRARIES)
|                                # close temp file, first column!

# These source files are automagically generated from a single
# instruction-table file by a Perl script. They're distributed,
# though, so it isn't necessary to have Perl just to recompile NASM
# from the distribution.

insnsa.c: insns.dat insns.pl
	$(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat

insnsd.c: insns.dat insns.pl
	$(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat

insnsi.h: insns.dat insns.pl
	$(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat

insnsn.c: insns.dat insns.pl
	$(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat

# This source file is generated from the standard macros file
# `standard.mac' by another Perl script. Again, it's part of the
# standard distribution.

macros.c: macros.pl standard.mac version.mac
	$(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac

# These files contains all the standard macros that are derived from
# the version number.
version.h: version version.pl
        $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h

version.mac: version version.pl
        $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac

# These source files are generated from regs.dat by yet another
# perl script.
regs.c: regs.dat regs.pl
	$(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
regflags.c: regs.dat regs.pl
	$(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
regdis.c: regs.dat regs.pl
	$(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
regvals.c: regs.dat regs.pl
	$(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
regs.h: regs.dat regs.pl
	$(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h

clean:
  @-del /S *.obj  2> NUL 1>&2
  @-del /S *.il?  2> NUL 1>&2
  @-del /S *.tds  2> NUL 1>&2
  @-del /S *.~*  2> NUL 1>&2
  @-del /S nasm$(SUFFIX)$(EXE)  2> NUL 1>&2
  @-del /S ndisasm$(SUFFIX)$(EXE)  2> NUL 1>&2

#-- Magic hints to mkdep.pl --#
# @object-ending: ".$(OBJ)"
# @path-separator: "\"
#-- Everything below is generated by mkdep.pl - do not edit --#
assemble.$(OBJ): assemble.c insns.h assemble.h regvals.c nasm.h regs.h \
 insnsi.h nasmlib.h version.h
disasm.$(OBJ): disasm.c insns.h regs.c sync.h names.c nasm.h disasm.h regs.h \
 insnsn.c insnsi.h version.h regdis.c
eval.$(OBJ): eval.c nasm.h regs.h labels.h nasmlib.h version.h eval.h
float.$(OBJ): float.c nasm.h regs.h version.h
insnsa.$(OBJ): insnsa.c insns.h nasm.h regs.h insnsi.h version.h
insnsd.$(OBJ): insnsd.c insns.h nasm.h regs.h insnsi.h version.h
insnsn.$(OBJ): insnsn.c
labels.$(OBJ): labels.c nasm.h regs.h nasmlib.h version.h
listing.$(OBJ): listing.c listing.h nasm.h regs.h nasmlib.h version.h
macros.$(OBJ): macros.c
names.$(OBJ): names.c regs.c insnsn.c
nasm.$(OBJ): nasm.c listing.h preproc.h insns.h outform.h assemble.h \
 parser.h nasm.h regs.h labels.h insnsi.h nasmlib.h version.h eval.h
nasmlib.$(OBJ): nasmlib.c insns.h regs.c names.c nasm.h regs.h insnsn.c \
 insnsi.h nasmlib.h version.h
ndisasm.$(OBJ): ndisasm.c insns.h sync.h nasm.h disasm.h regs.h insnsi.h \
 nasmlib.h version.h
outform.$(OBJ): outform.c outform.h nasm.h regs.h version.h
output\outaout.$(OBJ): output\outaout.c outform.h nasm.h regs.h nasmlib.h \
 version.h
output\outas86.$(OBJ): output\outas86.c outform.h nasm.h regs.h nasmlib.h \
 version.h
output\outbin.$(OBJ): output\outbin.c outform.h nasm.h regs.h nasmlib.h \
 version.h
output\outcoff.$(OBJ): output\outcoff.c outform.h nasm.h regs.h nasmlib.h \
 version.h
output\outdbg.$(OBJ): output\outdbg.c outform.h nasm.h regs.h nasmlib.h \
 version.h
output\outelf.$(OBJ): output\outelf.c outform.h nasm.h regs.h nasmlib.h \
 version.h
output\outieee.$(OBJ): output\outieee.c outform.h nasm.h regs.h nasmlib.h \
 version.h
output\outobj.$(OBJ): output\outobj.c outform.h nasm.h regs.h nasmlib.h \
 version.h
output\outrdf.$(OBJ): output\outrdf.c outform.h nasm.h regs.h nasmlib.h \
 version.h
output\outrdf2.$(OBJ): output\outrdf2.c outform.h nasm.h regs.h nasmlib.h \
 version.h
parser.$(OBJ): parser.c insns.h parser.h nasm.h regs.h insnsi.h regflags.c \
 float.h nasmlib.h version.h
preproc.$(OBJ): preproc.c nasm.h macros.c regs.h nasmlib.h version.h
regdis.$(OBJ): regdis.c
regflags.$(OBJ): regflags.c
regs.$(OBJ): regs.c
regvals.$(OBJ): regvals.c
sync.$(OBJ): sync.c sync.h