summaryrefslogtreecommitdiff
path: root/Mkfiles/Makefile.vc
blob: 1e8ec7d3102ba7a98b50030908a10dd9b407089d (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
# Makefile for the Netwide Assembler under Win32
#
# 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 as a Win32 command-
# line executable. It's been tested with Visual C++ 1.10.

CC = cl /c /Ox /GF /I.
QCL = cl /c
LINK = cl
LINKFLAGS =
LIBRARIES =
EXE = .exe#
OBJ = obj#
SUFFIX = w#  # by default, this makefile produces nasmw.exe and ndisasmw.exe

.c.$(OBJ):
	$(CC) $*.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) \
	   preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) output/outrdf2.$(OBJ) \
	   output/outieee.$(OBJ)

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

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

# We have to have a horrible kludge here to get round the 128 character
# limit, as usual...
LINKOBJS = a*.obj e*.obj f*.obj insnsa.obj l*.obj na*.obj o*.obj p*.obj z*.obj
nasm$(SUFFIX)$(EXE): $(NASMOBJS)
	cl /Fenasm$(SUFFIX).exe $(LINKOBJS)

ndisasm$(SUFFIX)$(EXE): $(NDISASMOBJS)
	cl /Fendisasm$(SUFFIX).exe $(NDISASMOBJS)

assemble.$(OBJ): assemble.c nasm.h version.h insnsi.h assemble.h insns.h
disasm.$(OBJ): disasm.c nasm.h version.h insnsi.h disasm.h sync.h insns.h names.c insnsn.c
eval.$(OBJ): eval.c nasm.h version.h insnsi.h nasmlib.h eval.h
float.$(OBJ): float.c nasm.h version.h insnsi.h
labels.$(OBJ): labels.c nasm.h version.h insnsi.h nasmlib.h
listing.$(OBJ): listing.c nasm.h version.h insnsi.h nasmlib.h listing.h
nasm.$(OBJ): nasm.c nasm.h version.h insnsi.h nasmlib.h parser.h assemble.h labels.h \
	listing.h outform.h
nasmlib.$(OBJ): nasmlib.c nasm.h version.h insnsi.h nasmlib.h names.c insnsn.c
ndisasm.$(OBJ): ndisasm.c nasm.h version.h insnsi.h sync.h disasm.h
output/outas86.$(OBJ): output/outas86.c nasm.h version.h insnsi.h nasmlib.h
output/outaout.$(OBJ): output/outaout.c nasm.h version.h insnsi.h nasmlib.h
output/outbin.$(OBJ): output/outbin.c nasm.h version.h insnsi.h nasmlib.h
output/outcoff.$(OBJ): output/outcoff.c nasm.h version.h insnsi.h nasmlib.h
output/outdbg.$(OBJ): output/outdbg.c nasm.h version.h insnsi.h nasmlib.h
output/outelf.$(OBJ): output/outelf.c nasm.h version.h insnsi.h nasmlib.h
output/outobj.$(OBJ): output/outobj.c nasm.h version.h insnsi.h nasmlib.h
output/outrdf2.$(OBJ): output/outrdf2.c nasm.h version.h insnsi.h nasmlib.h
output/outieee.$(OBJ): output/outieee.c nasm.h version.h insnsi.h nasmlib.h
outform.$(OBJ): outform.c outform.h nasm.h version.h insnsi.h
parser.$(OBJ): parser.c nasm.h version.h insnsi.h nasmlib.h parser.h float.h names.c insnsn.c
preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h version.h insnsi.h nasmlib.h
sync.$(OBJ): sync.c sync.h

# Another grotty hack: QC is less likely to run out of memory than
# CL proper; and we don't need any optimisation in these modules
# since they're just data.
insnsa.$(OBJ): insnsa.c nasm.h version.h insnsi.h insns.h
	$(QCL) insnsa.c
insnsd.$(OBJ): insnsd.c nasm.h version.h insnsi.h insns.h
	$(QCL) insnsd.c

clean :
	del *.obj
	del nasm$(SUFFIX)$(EXE)
	del ndisasm$(SUFFIX)$(EXE)