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
)
36 NDISASMOBJS
= ndisasm.
$(OBJ
) disasm.
$(OBJ
) sync.
$(OBJ
) nasmlib.
$(OBJ
) \
39 all : nasm
$(EXE
) ndisasm
$(EXE
)
41 nasm
$(EXE
): $(NASMOBJS
)
42 $(LINK
) $(LINKFLAGS
) $(NASMOBJS
) $(LIBRARIES
)
44 ndisasm
$(EXE
): $(NDISASMOBJS
)
45 $(LINK
) $(DLINKFLAGS
) $(NDISASMOBJS
) $(LIBRARIES
)
47 assemble.
$(OBJ
): assemble.c nasm.h assemble.h insns.h
48 disasm.
$(OBJ
): disasm.c nasm.h disasm.h sync.h insns.h names.c
49 float.
$(OBJ
): float.c nasm.h
50 insnsa.
$(OBJ
): insnsa.c nasm.h insns.h
51 insnsd.
$(OBJ
): insnsd.c nasm.h insns.h
52 labels.
$(OBJ
): labels.c nasm.h nasmlib.h
53 nasm.
$(OBJ
): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h outform.h
54 nasmlib.
$(OBJ
): nasmlib.c nasm.h nasmlib.h
55 ndisasm.
$(OBJ
): ndisasm.c nasm.h sync.h disasm.h
56 outas86.
$(OBJ
): outas86.c nasm.h nasmlib.h
57 outaout.
$(OBJ
): outaout.c nasm.h nasmlib.h
58 outbin.
$(OBJ
): outbin.c nasm.h nasmlib.h
59 outcoff.
$(OBJ
): outcoff.c nasm.h nasmlib.h
60 outelf.
$(OBJ
): outelf.c nasm.h nasmlib.h
61 outobj.
$(OBJ
): outobj.c nasm.h nasmlib.h
62 outform.
$(OBJ
): outform.c outform.h nasm.h
63 parser.
$(OBJ
): parser.c nasm.h nasmlib.h parser.h float.h names.c
64 sync.
$(OBJ
): sync.c sync.h
66 # These two source files are automagically generated from a single
67 # instruction-table file by a Perl script. They're distributed,
68 # though, so it isn't necessary to have Perl just to recompile NASM
69 # from the distribution.
71 AUTOSRCS
= insnsa.c insnsd.c
72 $(AUTOSRCS
): insns.dat insns.pl
76 rm -f
$(NASMOBJS
) $(NDISASMOBJS
) nasm
$(EXE
) ndisasm
$(EXE
)
80 # Here the `make dist' section begins. Nothing is guaranteed hereafter
81 # unless you're using the Makefile under Linux, running bash, with
82 # gzip, GNU tar and a sensible version of zip readily available.
84 DOSEXES
= nasm.exe ndisasm.exe
85 MANPAGES
= nasm.man ndisasm.man
92 dist: $(AUTOSRCS
) $(MANPAGES
) $(DOSEXES
) clean