autoconf: update helpers/config.{sub,guess}
[nasm.git] / test / Makefile
blobe7b4647e1f24516046e10b9c8d9d565b73755e2b
1 .SUFFIXES: .bin .o .o64 .aout .obj .obj64 .exe .asm .lst .pl
3 NASMDEP = ../nasm
4 NASM = ../nasm
5 NASMOPT = -Ox -I../misc $(OPT)
6 PERL = perl
7 TESTS = $(wildcard *.asm)
8 RM_F = rm -f
9 RM_RF = rm -rf
11 $(NASM):
12 $(MAKE) -C ..
14 %.bin: %.asm $(NASMDEP)
15 $(NASM) $(NASMOPT) -f bin -o $@ -MD $@.dep -l $@.lst $<
17 %.ith: %.asm $(NASMDEP)
18 $(NASM) $(NASMOPT) -f ith -o $@ -MD $@.dep -l $@.lst $<
20 %.srec: %.asm $(NASMDEP)
21 $(NASM) $(NASMOPT) -f srec -o $@ -MD $@.dep -l $@.lst $<
23 %.o: %.asm $(NASMDEP)
24 $(NASM) $(NASMOPT) -f elf32 -o $@ -MD $@.dep -l $@.lst $<
26 %.o64: %.asm $(NASMDEP)
27 $(NASM) $(NASMOPT) -f elf64 -o $@ -MD $@.dep -l $@.lst $<
29 %.aout: %.asm $(NASMDEP)
30 $(NASM) $(NASMOPT) -f aout -o $@ -MD $@.dep -l $@.lst $<
32 %.obj: %.asm $(NASMDEP)
33 $(NASM) $(NASMOPT) -f obj -o $@ -MD $@.dep -l $@.lst $<
35 %.rdf: %.asm $(NASMDEP)
36 $(NASM) $(NASMOPT) -f rdf -o $@ -MD $@.dep -l $@.lst $<
38 %.od: %.obj ../misc/omfdump
39 ../misc/omfdump $< > $@
41 %.coff: %.asm $(NASMDEP)
42 $(NASM) $(NASMOPT) -f coff -o $@ -MD $@.dep -l $@.lst $<
44 %.win32: %.asm $(NASMDEP)
45 $(NASM) $(NASMOPT) -f win32 -o $@ -MD $@.dep -l $@.lst $<
47 %.win64: %.asm $(NASMDEP)
48 $(NASM) $(NASMOPT) -f win64 -o $@ -MD $@.dep -l $@.lst $<
50 %.mo32: %.asm $(NASMDEP)
51 $(NASM) $(NASMOPT) -f macho32 -o $@ -MD $@.dep -l $@.lst $<
53 %.mo64: %.asm $(NASMDEP)
54 $(NASM) $(NASMOPT) -f macho64 -o $@ -MD $@.dep -l $@.lst $<
56 %.dbg: %.asm $(NASMDEP)
57 $(NASM) $(NASMOPT) -f dbg -o $@ -MD $@.dep -l $@.lst $<
59 %.asm: %.pl
60 $(PERL) $< > $@
62 %.i: %.asm $(NASMDEP)
63 $(NASM) $(NASMOPT) -E -o $@ -MD $@.dep $<
65 all:
67 golden: performtest.pl $(TESTS)
68 $(PERL) performtest.pl --golden --nasm='$(NASM)' $(TESTS)
70 test: performtest.pl $(NASMDEP) $(TESTS)
71 $(PERL) performtest.pl --nasm='$(NASM)' $(TESTS)
73 diff: performtest.pl $(NASMDEP) $(TESTS)
74 $(PERL) performtest.pl --diff --nasm='$(NASM)' $(TESTS)
76 clean:
77 $(RM_F) *.com *.o *.o64 *.aout *.obj *.win32 *.win64 *.exe *.lst *.bin
78 $(RM_F) *.dbg *.coff *.ith *.srec *.mo32 *.mo64 *.i *.dep *.rdf
79 $(RM_RF) testresults
80 $(RM_F) elftest elftest64
82 spotless: clean
83 $(RM_RF) golden
86 # Test for ELF32 shared libraries; assumes an x86 Linux system
88 elfso.o: elfso.asm $(NASMDEP)
89 $(NASM) $(NASMOPT) -f elf32 -F stabs -o $@ -MD $@.dep -l $@.lst $<
91 elfso.so: elfso.o
92 $(LD) -m elf_i386 -shared -o $@ -MD $@.dep $<
94 elftest: elftest.c elfso.so
95 $(CC) -g -m32 -o $@ -MD $@.dep $^
96 -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest
99 # Test for ELF64 shared libraries; assumes an x86-64 Linux system
101 elf64so.o: elf64so.asm $(NASMDEP)
102 $(NASM) $(NASMOPT) -f elf64 -F dwarf -o $@ -MD $@.dep -l $@.lst $<
104 elf64so.so: elf64so.o
105 $(LD) -shared -o $@ -MD $@.dep $<
107 elftest64: elftest64.c elf64so.so
108 $(CC) -g -o $@ -MD $@.dep $^
109 -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest64