1 # Makefile for the Netwide Assembler under 16-bit DOS
3 # The Netwide Assembler is copyright (C) 1996 Simon Tatham and
4 # Julian Hall. All rights reserved. The software is
5 # redistributable under the licence given in the file "Licence"
6 # distributed in the NASM archive.
8 # This Makefile is designed to build NASM using a 16-bit DOS C
9 # compiler such as Microsoft C, provided you have a compatible MAKE.
10 # It's been tested with Microsoft C 5.x plus Borland Make. (Yes, I
11 # know it's silly, but...)
13 # update: MSC 5.1 will not compile 'nasmlib.c' (arg lists don't match)
14 # MSC 6.00A will not compile 'insnsa.c' (qcl is required)
15 # MSC 7.00 will compile all
17 # GNU software compiled by DJGPP is also required:
22 # Source and DOS/Windows binaries may be downloaded from:
24 # ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/
26 # Compilation has been tested under Windows 98 & Windows 2000
27 # MSC 7.00 & DJGPP applications require a DPMI interface, which is
28 # a part of MSC 7.00 under DOS. It is also a part of Windows.
31 # For a 16-bit compiler, we don't need all the formats
33 CONFIG = -DOF_ONLY -DOF_BIN -DOF_OBJ -DOF_WIN32 -DOF_AS86
35 #CC = cl /c /O /AL /Gt
36 # Compile for a 286, ain't nobody using an 8086 anymore
37 CC = cl /c /Oz /AL /Gt256 /G2 /I.. # MSC 7.00
40 QCL = $(CC) # MSC 7.00
43 LINKFLAGS = /F4000 /Fm
49 $(CC) $(CONFIG) /Fo$@ $*.c
51 NASMOBJS1 = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \
52 assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ)
53 NASMOBJS2 = output\outbin.$(OBJ) output\outaout.$(OBJ) output\outcoff.$(OBJ)
54 NASMOBJS3 = output\outelf.$(OBJ) output\outobj.$(OBJ) output\outas86.$(OBJ)
55 NASMOBJS4 = output\outrdf.$(OBJ) output\outrdf2.$(OBJ) output\outieee.$(OBJ)
56 NASMOBJS5 = output\outdbg.$(OBJ) preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ)
58 NASMOBJS = $(NASMOBJS1) $(NASMOBJS2) $(NASMOBJS3) $(NASMOBJS4) $(NASMOBJS5)
60 NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
63 all : nasm$(EXE) ndisasm$(EXE)
65 # We have to have a horrible kludge here to get round the 128 character
67 LINKOBJS = a*.obj e*.obj f*.obj insnsa.obj l*.obj na*.obj o*.obj p*.obj
68 nasm$(EXE): $(NASMOBJS)
69 echo $(NASMOBJS1) + >foo
70 echo $(NASMOBJS2) + >>foo
71 echo $(NASMOBJS3) + >>foo
72 echo $(NASMOBJS4) + >>foo
73 echo $(NASMOBJS5) >> foo
74 $(LINK) /st:4096 @foo,nasm;
76 ndisasm$(EXE): $(NDISASMOBJS)
77 $(LINK) $(NDISASMOBJS), ndisasm;
82 output\insnsi.h: insnsi.h
85 output\nasmlib.h: nasmlib.h
88 output\outform.h: outform.h
92 assemble.$(OBJ): assemble.c nasm.h insnsi.h assemble.h insns.h
93 disasm.$(OBJ): disasm.c nasm.h insnsi.h disasm.h sync.h insns.h names.c insnsn.c
94 eval.$(OBJ): eval.c eval.h nasm.h insnsi.h nasmlib.h
95 float.$(OBJ): float.c nasm.h insnsi.h
96 labels.$(OBJ): labels.c nasm.h insnsi.h nasmlib.h
97 listing.$(OBJ): listing.c nasm.h insnsi.h nasmlib.h listing.h
98 nasm.$(OBJ): nasm.c nasm.h insnsi.h nasmlib.h parser.h assemble.h labels.h \
100 nasmlib.$(OBJ): nasmlib.c nasm.h insnsi.h nasmlib.h names.c insnsn.c
101 ndisasm.$(OBJ): ndisasm.c nasm.h insnsi.h sync.h disasm.h
102 outform.$(OBJ): outform.c outform.h nasm.h insnsi.h
103 output\outas86.$(OBJ): output\outas86.c output\nasm.h output\insnsi.h output\nasmlib.h output\outform.h
104 output\outaout.$(OBJ): output\outaout.c output\nasm.h output\insnsi.h output\nasmlib.h output\outform.h
105 output\outbin.$(OBJ): output\outbin.c output\nasm.h output\insnsi.h output\nasmlib.h output\outform.h
106 output\outcoff.$(OBJ): output\outcoff.c output\nasm.h output\insnsi.h output\nasmlib.h output\outform.h
107 output\outdbg.$(OBJ): output\outdbg.c output\nasm.h output\insnsi.h output\nasmlib.h output\outform.h
108 output\outelf.$(OBJ): output\outelf.c output\nasm.h output\insnsi.h output\nasmlib.h output\outform.h
109 output\outobj.$(OBJ): output\outobj.c output\nasm.h output\insnsi.h output\nasmlib.h output\outform.h
110 output\outrdf.$(OBJ): output\outrdf.c output\nasm.h output\insnsi.h output\nasmlib.h output\outform.h
111 output\outrdf2.$(OBJ): output\outrdf2.c output\nasm.h output\insnsi.h output\nasmlib.h output\outform.h
112 output\outieee.$(OBJ): output\outieee.c output\nasm.h output\insnsi.h output\nasmlib.h output\outform.h
113 parser.$(OBJ): parser.c nasm.h insnsi.h nasmlib.h parser.h float.h names.c insnsn.c
114 preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h insnsi.h nasmlib.h
115 sync.$(OBJ): sync.c sync.h
118 insnsa.c insnsd.c insnsi.h insnsn.c: insns16.dat insns.pl
119 perl insns.pl insns16.dat
121 insns16.dat: insns.dat
122 grep -v WILLAMETTE insns.dat | grep -v KATMAI | grep -v SSE | \
123 grep -v MMX | grep -v 3DNOW | grep -v UNDOC >insns16.dat
125 # Another grotty hack: QC is less likely to run out of memory than
126 # CL proper; and we don't need any optimisation in these modules
127 # since they're just data.
128 insnsa.$(OBJ): insnsa.c nasm.h insnsi.h insns.h
131 insnsd.$(OBJ): insnsd.c nasm.h insnsi.h insns.h