Run make alldeps
[nasm.git] / test / Makefile
bloba76044d414925062953b2c47d20259bde0964e1e
1 .SUFFIXES: .bin .o .o64 .obj .obj64 .exe .asm .lst .pl
3 NASM = ../nasm
4 NASMOPT = -Ox -I../misc $(OPT)
5 PERL = perl
6 TESTS = $(wildcard *.asm)
8 $(NASM):
9 $(MAKE) -C ..
11 %.bin: %.asm $(NASM)
12 $(NASM) $(NASMOPT) -f bin -o $@ -l $*.lst $<
14 %.ith: %.asm $(NASM)
15 $(NASM) $(NASMOPT) -f ith -o $@ -l $*.lst $<
17 %.srec: %.asm $(NASM)
18 $(NASM) $(NASMOPT) -f srec -o $@ -l $*.lst $<
20 %.o: %.asm $(NASM)
21 $(NASM) $(NASMOPT) -f elf32 -o $@ -l $*.lst $<
23 %.o64: %.asm $(NASM)
24 $(NASM) $(NASMOPT) -f elf64 -o $@ -l $*.lst $<
26 %.obj: %.asm $(NASM)
27 $(NASM) $(NASMOPT) -f obj -o $@ -l $*.lst $<
29 %.coff: %.asm $(NASM)
30 $(NASM) $(NASMOPT) -f coff -o $@ -l $*.lst $<
32 %.win32: %.asm $(NASM)
33 $(NASM) $(NASMOPT) -f win32 -o $@ -l $*.lst $<
35 %.win64: %.asm $(NASM)
36 $(NASM) $(NASMOPT) -f win64 -o $@ -l $*.lst $<
38 %.mo32: %.asm $(NASM)
39 $(NASM) $(NASMOPT) -f macho32 -o $@ -l $*.lst $<
41 %.mo64: %.asm $(NASM)
42 $(NASM) $(NASMOPT) -f macho64 -o $@ -l $*.lst $<
44 %.dbg: %.asm $(NASM)
45 $(NASM) $(NASMOPT) -f dbg -o $@ -l $*.lst $<
47 %.asm: %.pl
48 $(PERL) $< > $@
50 all:
52 golden: performtest.pl $(TESTS)
53 $(PERL) performtest.pl --golden --nasm='$(NASM)' $(TESTS)
55 test: performtest.pl $(NASM) $(TESTS)
56 $(PERL) performtest.pl --nasm='$(NASM)' $(TESTS)
58 diff: performtest.pl $(NASM) $(TESTS)
59 $(PERL) performtest.pl --diff --nasm='$(NASM)' $(TESTS)
61 clean:
62 rm -f *.com *.o *.o64 *.obj *.win32 *.win64 *.exe *.lst *.bin
63 rm -f *.dbg *.coff *.ith *.srec *.mo32 *.mo64
64 rm -rf testresults
65 rm -f elftest elftest64
67 spotless: clean
68 rm -rf golden
71 # Test for ELF32 shared libraries; assumes an x86 Linux system
73 elfso.o: elfso.asm $(NASM)
74 $(NASM) $(NASMOPT) -f elf32 -F stabs -o $@ -l $*.lst $<
76 elfso.so: elfso.o
77 $(LD) -m elf_i386 -shared -o $@ $<
79 elftest: elftest.c elfso.so
80 $(CC) -g -m32 -o $@ $^
81 -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest
84 # Test for ELF64 shared libraries; assumes an x86-64 Linux system
86 elf64so.o: elf64so.asm $(NASM)
87 $(NASM) $(NASMOPT) -f elf64 -F dwarf -o $@ -l $*.lst $<
89 elf64so.so: elf64so.o
90 $(LD) -shared -o $@ $<
92 elftest64: elftest64.c elf64so.so
93 $(CC) -g -o $@ $^
94 -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest64