NASM 0.95
[nasm/avx512.git] / Makefile
blob7a9c54cc6f8f9b9899989eb6acab12d585c7959f
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
16 # _my_ computer. :-)
18 CC = gcc
19 CCFLAGS = -c -g -O -Wall -ansi -pedantic
20 LINK = gcc
21 LINKFLAGS = -o nasm
22 DLINKFLAGS = -o ndisasm
23 LIBRARIES =
24 STRIP = strip
25 EXE =#
26 OBJ = o#
28 .c.$(OBJ):
29 $(CC) $(CCFLAGS) $*.c
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) \
35 preproc.$(OBJ) listing.$(OBJ)
37 NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
38 insnsd.$(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 nasmlib.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 listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h
55 macros.$(OBJ): macros.c
56 names.$(OBJ): names.c
57 nasm.$(OBJ): nasm.c nasm.h nasmlib.h preproc.h parser.h assemble.h labels.h \
58 outform.h listing.h
59 nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h
60 ndisasm.$(OBJ): ndisasm.c nasm.h nasmlib.h sync.h disasm.h
61 outaout.$(OBJ): outaout.c nasm.h nasmlib.h outform.h
62 outas86.$(OBJ): outas86.c nasm.h nasmlib.h outform.h
63 outbin.$(OBJ): outbin.c nasm.h nasmlib.h outform.h
64 outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h outform.h
65 outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h outform.h
66 outelf.$(OBJ): outelf.c nasm.h nasmlib.h outform.h
67 outform.$(OBJ): outform.c outform.h nasm.h
68 outobj.$(OBJ): outobj.c nasm.h nasmlib.h outform.h
69 outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h outform.h
70 parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c
71 preproc.$(OBJ): preproc.c nasm.h nasmlib.h macros.c
72 sync.$(OBJ): sync.c sync.h
74 # These two source files are automagically generated from a single
75 # instruction-table file by a Perl script. They're distributed,
76 # though, so it isn't necessary to have Perl just to recompile NASM
77 # from the distribution.
79 AUTOSRCS = insnsa.c insnsd.c
80 $(AUTOSRCS): insns.dat insns.pl
81 perl insns.pl
83 # This source file is generated from the standard macros file
84 # `standard.mac' by another Perl script. Again, it's part of the
85 # standard distribution.
87 macros.c: standard.mac
88 perl macros.pl
90 # Clean the whole thing up after compilation.
92 clean :
93 rm -f $(NASMOBJS) $(NDISASMOBJS) nasm$(EXE) ndisasm$(EXE)
94 make -C rdoff clean
95 make -C test clean
97 # Here the `make dist' section begins. Nothing is guaranteed hereafter
98 # unless you're using the Makefile under Linux, running bash, with
99 # gzip, GNU tar and a sensible version of zip readily available.
101 MANPAGES = nasm.man ndisasm.man
103 .SUFFIXES: .man .1
105 .1.man:
106 -man ./$< | ul > $@
108 dist: $(AUTOSRCS) $(MANPAGES) clean
109 makedist.sh