2 # target: dos 16bit and 32bit
3 # Makefile for the Netwide Assembler
5 # This is a modification (by John Fine) of makefile.dj
7 # It uses the syntax of "Opus Make", which is the make program I prefer.
9 # It builds five targets:
11 # nasm16.exe 16-bit built with Turbo-C
12 # nasm.exe 32-bit built with DJGPP
13 # nasmd.exe nasm.exe with debug information (for use with gdb etc.)
14 # nasml.exe nasm.exe with logging version of malloc (to find memory leaks)
15 # ndisasm.exe NASM disassembler (DJGPP version)
18 .SUFFIXES: .exe .ol .o .obj .c .dat .pl
20 # The Netwide Assembler is copyright (C) 1996 Simon Tatham and
21 # Julian Hall. All rights reserved. The software is
22 # redistributable under the licence given in the file "Licence"
23 # distributed in the NASM archive.
25 # makefile designed for djgpp 2.xx
26 # djgpp is GNU C compiler ported by mighty DJ Delorie
27 # www.delorie.com and any simtel mirror
33 # redir -eo $(CC) -g -c -O2 -finline-functions -Wall -ansi -pedantic $*.c >$*.err
34 $(CC) -g -c -O2 -finline-functions -Wall -ansi -pedantic $*.c
37 $(CC) -DLOGALLOC -g -c -o $*.ol $(CFLAGS) $*.c
40 tcc -O -Z -c -ml -d -DOF_ONLY -DOF_BIN -DOF_OBJ -If:\public\turboc -I. $*.c >$*.err
42 NASM = nasm.o nasmlib.o float.o insnsa.o assemble.o labels.o \
43 parser.o outform.o output/outbin.o output/outaout.o output/outcoff.o output/outelf.o \
44 output/outobj.o output/outas86.o output/outrdf.o output/outrdf2.o output/outieee.o output/outdbg.o preproc.o listing.o \
47 NASML = nasm.ol nasmlib.ol float.ol insnsa.ol assemble.ol labels.ol \
48 parser.ol outform.ol output/outbin.ol output/outaout.ol output/outcoff.ol output/outelf.ol \
49 output/outobj.ol output/outas86.ol output/outrdf.ol output/outrdf2.ol output/outieee.ol output/outdbg.ol preproc.ol listing.ol \
52 NASM16 = nasm.obj nasmlib.obj float.obj insnsa.obj assemble.obj labels.obj \
53 parser.obj outform.obj output/outbin.obj \
54 output/outobj.obj preproc.obj listing.obj \
57 NDISASM = ndisasm.o disasm.o sync.o nasmlib.o insnsd.o
65 ndisasm.exe: $(NDISASM)
78 f:\public\turboc\lib\c0l.obj $(NASM16)
81 f:\public\turboc\lib\cl.lib
90 assemble.o: assemble.c nasm.h version.h insnsi.h nasmlib.h assemble.h insns.h
91 disasm.o: disasm.c nasm.h version.h insnsi.h disasm.h sync.h insns.h names.c insnsn.c
92 eval.o: eval.c eval.h nasm.h version.h insnsi.h nasmlib.h
93 float.o: float.c nasm.h version.h insnsi.h
94 insnsa.o: insnsa.c nasm.h version.h insnsi.h insns.h
95 insnsd.o: insnsd.c nasm.h version.h insnsi.h insns.h
96 labels.o: labels.c nasm.h version.h insnsi.h nasmlib.h
97 listing.o: listing.c nasm.h version.h insnsi.h nasmlib.h listing.h
98 nasm.o: nasm.c nasm.h version.h insnsi.h nasmlib.h preproc.h parser.h assemble.h labels.h \
100 nasmlib.o: nasmlib.c nasm.h version.h insnsi.h nasmlib.h names.c insnsn.c
101 ndisasm.o: ndisasm.c nasm.h version.h insnsi.h nasmlib.h sync.h disasm.h
102 output/outaout.o: output/outaout.c nasm.h version.h insnsi.h nasmlib.h outform.h
103 output/outas86.o: output/outas86.c nasm.h version.h insnsi.h nasmlib.h outform.h
104 output/outbin.o: output/outbin.c nasm.h version.h insnsi.h nasmlib.h outform.h
105 output/outcoff.o: output/outcoff.c nasm.h version.h insnsi.h nasmlib.h outform.h
106 output/outdbg.o: output/outdbg.c nasm.h version.h insnsi.h nasmlib.h outform.h
107 output/outelf.o: output/outelf.c nasm.h version.h insnsi.h nasmlib.h outform.h
108 outform.o: outform.c outform.h nasm.h version.h insnsi.h
109 output/outobj.o: output/outobj.c nasm.h version.h insnsi.h nasmlib.h outform.h
110 output/outrdf2.o: output/outrdf2.c nasm.h version.h insnsi.h nasmlib.h outform.h
111 parser.o: parser.c nasm.h version.h insnsi.h nasmlib.h parser.h float.h names.c insnsn.c
112 preproc.o: preproc.c nasm.h version.h insnsi.h nasmlib.h macros.c
113 sync.o: sync.c sync.h
114 output/outieee.o: output/outieee.c nasm.h version.h insnsi.h nasmlib.h outform.h
116 assemble.ol: assemble.c nasm.h version.h insnsi.h nasmlib.h assemble.h insns.h
117 disasm.ol: disasm.c nasm.h version.h insnsi.h disasm.h sync.h insns.h names.c insnsn.c
118 eval.ol: eval.c eval.h nasm.h version.h insnsi.h nasmlib.h
119 float.ol: float.c nasm.h version.h insnsi.h
120 insnsa.ol: insnsa.c nasm.h version.h insnsi.h insns.h
121 insnsd.ol: insnsd.c nasm.h version.h insnsi.h insns.h
122 labels.ol: labels.c nasm.h version.h insnsi.h nasmlib.h
123 listing.ol: listing.c nasm.h version.h insnsi.h nasmlib.h listing.h
124 nasm.ol: nasm.c nasm.h version.h insnsi.h nasmlib.h preproc.h parser.h assemble.h labels.h \
126 nasmlib.ol: nasmlib.c nasm.h version.h insnsi.h nasmlib.h
127 ndisasm.ol: ndisasm.c nasm.h version.h insnsi.h nasmlib.h sync.h disasm.h
128 output/outaout.ol: output/outaout.c nasm.h version.h insnsi.h nasmlib.h outform.h
129 output/outas86.ol: output/outas86.c nasm.h version.h insnsi.h nasmlib.h outform.h
130 output/outbin.ol: output/outbin.c nasm.h version.h insnsi.h nasmlib.h outform.h
131 output/outcoff.ol: output/outcoff.c nasm.h version.h insnsi.h nasmlib.h outform.h
132 output/outdbg.ol: output/outdbg.c nasm.h version.h insnsi.h nasmlib.h outform.h
133 output/outelf.ol: output/outelf.c nasm.h version.h insnsi.h nasmlib.h outform.h
134 outform.ol: outform.c outform.h nasm.h version.h insnsi.h
135 output/outobj.ol: output/outobj.c nasm.h version.h insnsi.h nasmlib.h outform.h
136 output/outrdf2.ol: output/outrdf2.c nasm.h version.h insnsi.h nasmlib.h outform.h
137 parser.ol: parser.c nasm.h version.h insnsi.h nasmlib.h parser.h float.h names.c insnsn.c
138 preproc.ol: preproc.c nasm.h version.h insnsi.h nasmlib.h macros.c
139 sync.ol: sync.c sync.h
140 output/outieee.ol: output/outieee.c nasm.h version.h insnsi.h nasmlib.h outform.h
142 assemble.obj: assemble.c nasm.h version.h insnsi.h nasmlib.h assemble.h insns.h
143 disasm.obj: disasm.c nasm.h version.h insnsi.h disasm.h sync.h insns.h names.c insnsn.c
144 eval.obj: eval.c eval.h nasm.h version.h insnsi.h nasmlib.h
145 float.obj: float.c nasm.h version.h insnsi.h
146 insnsa.obj: insnsa.c nasm.h version.h insnsi.h insns.h
147 insnsd.obj: insnsd.c nasm.h version.h insnsi.h insns.h
148 labels.obj: labels.c nasm.h version.h insnsi.h nasmlib.h
149 listing.obj: listing.c nasm.h version.h insnsi.h nasmlib.h listing.h
150 nasm.obj: nasm.c nasm.h version.h insnsi.h nasmlib.h preproc.h parser.h assemble.h labels.h \
152 nasmlib.obj: nasmlib.c nasm.h version.h insnsi.h nasmlib.h
153 ndisasm.obj: ndisasm.c nasm.h version.h insnsi.h nasmlib.h sync.h disasm.h
154 output/outaout.obj: output/outaout.c nasm.h version.h insnsi.h nasmlib.h outform.h
155 output/outas86.obj: output/outas86.c nasm.h version.h insnsi.h nasmlib.h outform.h
156 output/outbin.obj: output/outbin.c nasm.h version.h insnsi.h nasmlib.h outform.h
157 output/outcoff.obj: output/outcoff.c nasm.h version.h insnsi.h nasmlib.h outform.h
158 output/outdbg.obj: output/outdbg.c nasm.h version.h insnsi.h nasmlib.h outform.h
159 output/outelf.obj: output/outelf.c nasm.h version.h insnsi.h nasmlib.h outform.h
160 outform.obj: outform.c outform.h nasm.h version.h insnsi.h
161 output/outobj.obj: output/outobj.c nasm.h version.h insnsi.h nasmlib.h outform.h
162 output/outrdf2.obj: output/outrdf2.c nasm.h version.h insnsi.h nasmlib.h outform.h
163 parser.obj: parser.c nasm.h version.h insnsi.h nasmlib.h parser.h float.h names.c insnsn.c
164 preproc.obj: preproc.c nasm.h version.h insnsi.h nasmlib.h macros.c
165 sync.obj: sync.c sync.h
166 output/outieee.obj: output/outieee.c nasm.h version.h insnsi.h nasmlib.h outform.h
168 # These four source files are automagically generated from a single
169 # instruction-table file by a Perl script. They're distributed,
170 # though, so it isn't necessary to have Perl just to recompile NASM
171 # from the distribution.
173 insnsa.c insnsd.c insnsi.h insnsn.c: insns.dat insns.pl
174 perl insns.pl insns.dat
176 # These files contains all the standard macros that are derived from
177 # the version number.
178 version.h: version version.pl
179 perl $(srcdir)/version.pl h < $(srcdir)/version > version.h
181 version.mac: version version.pl
182 perl $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
184 # This source file is generated from the standard macros file
185 # `standard.mac' by another Perl script. Again, it's part of the
186 # standard distribution.
188 macros.c: standard.mac macros.pl version.mac
189 perl macros.pl standard.mac version.mac
192 rm -f *.o nasm ndisasm