Add copyright verbiage to Perl scripts; update LICENSE
[nasm/sigaren-mirror.git] / test / Makefile
blob408f787e4a074434df6bdbe9b8a2f311dc61e726
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 %.o: %.asm $(NASM)
12 $(NASM) $(NASMOPT) -f elf32 -o $@ -l $*.lst $<
14 %.o64: %.asm $(NASM)
15 $(NASM) $(NASMOPT) -f elf64 -o $@ -l $*.lst $<
17 %.obj: %.asm $(NASM)
18 $(NASM) $(NASMOPT) -f win32 -o $@ -l $*.lst $<
20 %.obj64: %.asm $(NASM)
21 $(NASM) $(NASMOPT) -f win64 -o $@ -l $*.lst $<
23 %.dbg: %.asm $(NASM)
24 $(NASM) $(NASMOPT) -f dbg -o $@ -l $*.lst $<
26 %.asm: %.pl
27 $(PERL) $< > $@
29 all:
31 golden: performtest.pl $(TESTS)
32 $(PERL) performtest.pl --golden --nasm='$(NASM)' $(TESTS)
34 test: performtest.pl $(NASM) $(TESTS)
35 $(PERL) performtest.pl --nasm='$(NASM)' $(TESTS)
37 diff: performtest.pl $(NASM) $(TESTS)
38 $(PERL) performtest.pl --diff --nasm='$(NASM)' $(TESTS)
40 clean:
41 rm -f *.com *.o *.o64 *.obj *.obj64 *.exe *.lst *.bin
42 rm -rf testresults
43 rm -f elftest elftest64
45 spotless: clean
46 rm -rf golden
49 # Test for ELF32 shared libraries; assumes an x86 Linux system
51 elfso.o: elfso.asm $(NASM)
52 $(NASM) $(NASMOPT) -f elf32 -F stabs -o $@ -l $*.lst $<
54 elfso.so: elfso.o
55 $(LD) -m elf_i386 -shared -o $@ $<
57 elftest: elftest.c elfso.so
58 $(CC) -g -m32 -o $@ $^
59 -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest
62 # Test for ELF64 shared libraries; assumes an x86-64 Linux system
64 elf64so.o: elf64so.asm $(NASM)
65 $(NASM) $(NASMOPT) -f elf64 -F dwarf -o $@ -l $*.lst $<
67 elf64so.so: elf64so.o
68 $(LD) -shared -o $@ $<
70 elftest64: elftest64.c elf64so.so
71 $(CC) -g -o $@ $^
72 -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest64