1 # Makefile for the Netwide Assembler
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 for use under Unix (probably fairly
9 # portably). It can also be used without change to build NASM using
10 # DJGPP. The makefile "Makefile.dos" can be used to build NASM using
11 # a 16-bit DOS C compiler such as Microsoft C.
13 # The `make dist' section at the end of the Makefile is not
14 # guaranteed to work anywhere except Linux. Come to think of it,
15 # I'm not sure I want to guarantee it to work anywhere except on
19 CCFLAGS = -c -g -O -Wall -ansi -pedantic
22 DLINKFLAGS = -o ndisasm
31 NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \
32 assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \
33 outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \
34 outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \
37 NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
40 all : nasm$(EXE) ndisasm$(EXE)
42 nasm$(EXE): $(NASMOBJS)
43 $(LINK) $(LINKFLAGS) $(NASMOBJS) $(LIBRARIES)
45 ndisasm$(EXE): $(NDISASMOBJS)
46 $(LINK) $(DLINKFLAGS) $(NDISASMOBJS) $(LIBRARIES)
48 assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h
49 disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c
50 float.$(OBJ): float.c nasm.h
51 insnsa.$(OBJ): insnsa.c nasm.h insns.h
52 insnsd.$(OBJ): insnsd.c nasm.h insns.h
53 labels.$(OBJ): labels.c nasm.h nasmlib.h
54 nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h outform.h
55 nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h
56 ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h
57 outas86.$(OBJ): outas86.c nasm.h nasmlib.h
58 outaout.$(OBJ): outaout.c nasm.h nasmlib.h
59 outbin.$(OBJ): outbin.c nasm.h nasmlib.h
60 outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h
61 outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h
62 outelf.$(OBJ): outelf.c nasm.h nasmlib.h
63 outobj.$(OBJ): outobj.c nasm.h nasmlib.h
64 outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h
65 outform.$(OBJ): outform.c outform.h nasm.h
66 parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c
67 preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h
68 sync.$(OBJ): sync.c sync.h
70 # These two source files are automagically generated from a single
71 # instruction-table file by a Perl script. They're distributed,
72 # though, so it isn't necessary to have Perl just to recompile NASM
73 # from the distribution.
75 AUTOSRCS = insnsa.c insnsd.c
76 $(AUTOSRCS): insns.dat insns.pl
79 # This source file is generated from the standard macros file
80 # `standard.mac' by another Perl script. Again, it's part of the
81 # standard distribution.
83 macros.c: standard.mac
86 # Clean the whole thing up after compilation.
89 rm -f $(NASMOBJS) $(NDISASMOBJS) nasm$(EXE) ndisasm$(EXE)
93 # Here the `make dist' section begins. Nothing is guaranteed hereafter
94 # unless you're using the Makefile under Linux, running bash, with
95 # gzip, GNU tar and a sensible version of zip readily available.
97 DOSEXES = nasm.exe ndisasm.exe
98 MANPAGES = nasm.man ndisasm.man
105 dist: $(AUTOSRCS) $(MANPAGES) $(DOSEXES) clean