nasm.nsi: use LZMA compression
[nasm.git] / test / Makefile
blob0b81fc790caff12da6f82c364cd31a2618da00b1
1 .SUFFIXES: .bin .o .o64 .obj .obj64 .exe .asm .lst .pl
3 NASM = ../nasm
4 NASMOPT = -Ox -I../misc
5 PERL = perl
6 TESTS = $(wildcard *.asm)
8 %.bin: %.asm $(NASM)
9 $(NASM) $(NASMOPT) -f bin -o $@ -l $*.lst $<
11 %.ith: %.asm $(NASM)
12 $(NASM) $(NASMOPT) -f ith -o $@ -l $*.lst $<
14 %.srec: %.asm $(NASM)
15 $(NASM) $(NASMOPT) -f srec -o $@ -l $*.lst $<
17 %.o: %.asm $(NASM)
18 $(NASM) $(NASMOPT) -f elf32 -o $@ -l $*.lst $<
20 %.o64: %.asm $(NASM)
21 $(NASM) $(NASMOPT) -f elf64 -o $@ -l $*.lst $<
23 %.obj: %.asm $(NASM)
24 $(NASM) $(NASMOPT) -f win32 -o $@ -l $*.lst $<
26 %.obj64: %.asm $(NASM)
27 $(NASM) $(NASMOPT) -f win64 -o $@ -l $*.lst $<
29 %.dbg: %.asm $(NASM)
30 $(NASM) $(NASMOPT) -f dbg -o $@ -l $*.lst $<
32 %.asm: %.pl
33 $(PERL) $< > $@
35 all:
37 golden: performtest.pl $(TESTS)
38 $(PERL) performtest.pl --golden --nasm='$(NASM)' $(TESTS)
40 test: performtest.pl $(NASM) $(TESTS)
41 $(PERL) performtest.pl --nasm='$(NASM)' $(TESTS)
43 diff: performtest.pl $(NASM) $(TESTS)
44 $(PERL) performtest.pl --diff --nasm='$(NASM)' $(TESTS)
46 clean:
47 rm -f *.com *.o *.o64 *.obj *.obj64 *.exe *.lst *.bin
48 rm -rf testresults
49 rm -f elftest elftest64
51 spotless: clean
52 rm -rf golden
55 # Test for ELF32 shared libraries; assumes an x86 Linux system
57 elfso.o: elfso.asm $(NASM)
58 $(NASM) $(NASMOPT) -f elf32 -F stabs -o $@ -l $*.lst $<
60 elfso.so: elfso.o
61 $(LD) -m elf_i386 -shared -o $@ $<
63 elftest: elftest.c elfso.so
64 $(CC) -g -m32 -o $@ $^
65 -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest
68 # Test for ELF64 shared libraries; assumes an x86-64 Linux system
70 elf64so.o: elf64so.asm $(NASM)
71 $(NASM) $(NASMOPT) -f elf64 -F dwarf -o $@ -l $*.lst $<
73 elf64so.so: elf64so.o
74 $(LD) -shared -o $@ $<
76 elftest64: elftest64.c elf64so.so
77 $(CC) -g -o $@ $^
78 -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest64