preproc: Drop useless assignments
[nasm/sigaren-mirror.git] / test / Makefile
blob8b5135906120375159dd0c64bd8b919849de3361
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 %.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 obj -o $@ -l $*.lst $<
26 %.coff: %.asm $(NASM)
27 $(NASM) $(NASMOPT) -f coff -o $@ -l $*.lst $<
29 %.win32: %.asm $(NASM)
30 $(NASM) $(NASMOPT) -f win32 -o $@ -l $*.lst $<
32 %.win64: %.asm $(NASM)
33 $(NASM) $(NASMOPT) -f win64 -o $@ -l $*.lst $<
35 %.mo32: %.asm $(NASM)
36 $(NASM) $(NASMOPT) -f macho32 -o $@ -l $*.lst $<
38 %.mo64: %.asm $(NASM)
39 $(NASM) $(NASMOPT) -f macho64 -o $@ -l $*.lst $<
41 %.dbg: %.asm $(NASM)
42 $(NASM) $(NASMOPT) -f dbg -o $@ -l $*.lst $<
44 %.asm: %.pl
45 $(PERL) $< > $@
47 all:
49 golden: performtest.pl $(TESTS)
50 $(PERL) performtest.pl --golden --nasm='$(NASM)' $(TESTS)
52 test: performtest.pl $(NASM) $(TESTS)
53 $(PERL) performtest.pl --nasm='$(NASM)' $(TESTS)
55 diff: performtest.pl $(NASM) $(TESTS)
56 $(PERL) performtest.pl --diff --nasm='$(NASM)' $(TESTS)
58 clean:
59 rm -f *.com *.o *.o64 *.obj *.win32 *.win64 *.exe *.lst *.bin
60 rm -f *.dbg *.coff *.ith *.srec *.mo32 *.mo64
61 rm -rf testresults
62 rm -f elftest elftest64
64 spotless: clean
65 rm -rf golden
68 # Test for ELF32 shared libraries; assumes an x86 Linux system
70 elfso.o: elfso.asm $(NASM)
71 $(NASM) $(NASMOPT) -f elf32 -F stabs -o $@ -l $*.lst $<
73 elfso.so: elfso.o
74 $(LD) -m elf_i386 -shared -o $@ $<
76 elftest: elftest.c elfso.so
77 $(CC) -g -m32 -o $@ $^
78 -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest
81 # Test for ELF64 shared libraries; assumes an x86-64 Linux system
83 elf64so.o: elf64so.asm $(NASM)
84 $(NASM) $(NASMOPT) -f elf64 -F dwarf -o $@ -l $*.lst $<
86 elf64so.so: elf64so.o
87 $(LD) -shared -o $@ $<
89 elftest64: elftest64.c elf64so.so
90 $(CC) -g -o $@ $^
91 -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest64