]> git.saurik.com Git - apple/boot.git/blob - i386/nasm/Makefile
boot-111.1.tar.gz
[apple/boot.git] / i386 / nasm / Makefile
1
2 DIR = nasm
3 include ../MakePaths.dir
4
5 # Don't install in the usual place. Currently it's only
6 # needed for building boot0, boot1, boot1f, and nullboot1.
7 #MANINSTALLDIR = $(DSTROOT)/usr/share/man/man1
8 #INSTALLDIR = $(DSTROOT)/usr/local/bin
9 MANINSTALLDIR = $(SYMROOT)
10 INSTALLDIR = $(SYMROOT)
11
12 OPTIM = -O2
13 CFLAGS = $(OPTIM) -g -Wmost -Werror
14 DEFINES=
15 INC = -I.
16 ifneq "" "$(wildcard /bin/mkdirs)"
17 MKDIRS = /bin/mkdirs
18 else
19 MKDIRS = /bin/mkdir -p
20 endif
21
22 VPATH = $(OBJROOT):$(SYMROOT)
23
24 NASM = nasm.o nasmlib.o float.o insnsa.o assemble.o labels.o \
25 parser.o outform.o outbin.o outaout.o outcoff.o outelf.o \
26 outobj.o outas86.o outrdf.o outdbg.o preproc.o listing.o \
27 eval.o
28
29 NDISASM = ndisasm.o disasm.o sync.o nasmlib.o insnsd.o
30
31 CFILES = nasm.c nasmlib.c float.c insnsa.c assemble.c labels.c \
32 parser.c outform.c outbin.c outaout.c outcoff.c outelf.c \
33 outobj.c outas86.c outrdf.c outdbg.c preproc.c listing.c \
34 eval.c ndisasm.c disasm.c sync.c insnsd.c
35
36 HFILES = nasm.h nasmlib.h preproc.h parser.h assemble.h labels.h \
37 outform.h listing.h eval.h insns.h sync.h disasm.h float.h
38
39 OTHERFILES = Makefile
40
41 ALLSRC = $(CFILES) $(HFILES) $(OTHERFILES)
42
43 DIRS_NEEDED = $(OBJROOT) $(SYMROOT)
44
45 all: $(DIRS_NEEDED) nasm ndisasm installman
46
47 nasm: $(NASM)
48 $(CC) -o $(INSTALLDIR)/nasm $(NASM)
49
50 ndisasm: $(NDISASM)
51 $(CC) -o $(INSTALLDIR)/ndisasm $(NDISASM)
52
53 installman: nasm.1 ndisasm.1
54 cp nasm.1 $(MANINSTALLDIR)
55 cp ndisasm.1 $(MANINSTALLDIR)
56
57 # These two source files are automagically generated from a single
58 # instruction-table file by a Perl script. They're distributed,
59 # though, so it isn't necessary to have Perl just to recompile NASM
60 # from the distribution.
61
62 insnsa.c insnsd.c: insns.dat insns.pl
63 perl insns.pl insns.dat
64
65 # This source file is generated from the standard macros file
66 # `standard.mac' by another Perl script. Again, it's part of the
67 # standard distribution.
68
69 macros.c: standard.mac macros.pl
70 perl macros.pl standard.mac
71
72 clean::
73 rm -rf $(SYMROOT)/nasm $(SYMROOT)/ndisasm
74
75 $(INSTALLDIR) $(MANINSTALLDIR):
76 $(MKDIRS) $@
77
78 installhdrs:: $(INSTALLDIR) $(MANINSTALLDIR)
79
80 include ../MakeInc.dir
81
82 # dependencies
83 -include $(OBJROOT)/Makedep