test/Makefile: output dependency information files
[nasm/externdefs2.git] / test / Makefile
blob7a6dfe24a96fab1898510b9436f8e28b5d3ab610
1 .SUFFIXES: .bin .o .o64 .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 %.obj: %.asm $(NASMDEP)
30 $(NASM) $(NASMOPT) -f obj -o $@ -MD $@.dep -l $*.lst $<
32 %.od: %.obj ../misc/omfdump
33 ../misc/omfdump $< > $@
35 %.coff: %.asm $(NASMDEP)
36 $(NASM) $(NASMOPT) -f coff -o $@ -MD $@.dep -l $*.lst $<
38 %.win32: %.asm $(NASMDEP)
39 $(NASM) $(NASMOPT) -f win32 -o $@ -MD $@.dep -l $*.lst $<
41 %.win64: %.asm $(NASMDEP)
42 $(NASM) $(NASMOPT) -f win64 -o $@ -MD $@.dep -l $*.lst $<
44 %.mo32: %.asm $(NASMDEP)
45 $(NASM) $(NASMOPT) -f macho32 -o $@ -MD $@.dep -l $*.lst $<
47 %.mo64: %.asm $(NASMDEP)
48 $(NASM) $(NASMOPT) -f macho64 -o $@ -MD $@.dep -l $*.lst $<
50 %.dbg: %.asm $(NASMDEP)
51 $(NASM) $(NASMOPT) -f dbg -o $@ -MD $@.dep -l $*.lst $<
53 %.asm: %.pl
54 $(PERL) $< > $@
56 %.i: %.asm $(NASMDEP)
57 $(NASM) $(NASMOPT) -E -o $@ -MD $@.dep $<
59 all:
61 golden: performtest.pl $(TESTS)
62 $(PERL) performtest.pl --golden --nasm='$(NASM)' $(TESTS)
64 test: performtest.pl $(NASMDEP) $(TESTS)
65 $(PERL) performtest.pl --nasm='$(NASM)' $(TESTS)
67 diff: performtest.pl $(NASMDEP) $(TESTS)
68 $(PERL) performtest.pl --diff --nasm='$(NASM)' $(TESTS)
70 clean:
71 $(RM_F) *.com *.o *.o64 *.obj *.win32 *.win64 *.exe *.lst *.bin
72 $(RM_F) *.dbg *.coff *.ith *.srec *.mo32 *.mo64 *.i *.dep
73 $(RM_RF) testresults
74 $(RM_F) elftest elftest64
76 spotless: clean
77 $(RM_RF) golden
80 # Test for ELF32 shared libraries; assumes an x86 Linux system
82 elfso.o: elfso.asm $(NASMDEP)
83 $(NASM) $(NASMOPT) -f elf32 -F stabs -o $@ -MD $@.dep -l $*.lst $<
85 elfso.so: elfso.o
86 $(LD) -m elf_i386 -shared -o $@ -MD $@.dep $<
88 elftest: elftest.c elfso.so
89 $(CC) -g -m32 -o $@ -MD $@.dep $^
90 -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest
93 # Test for ELF64 shared libraries; assumes an x86-64 Linux system
95 elf64so.o: elf64so.asm $(NASMDEP)
96 $(NASM) $(NASMOPT) -f elf64 -F dwarf -o $@ -MD $@.dep -l $*.lst $<
98 elf64so.so: elf64so.o
99 $(LD) -shared -o $@ -MD $@.dep $<
101 elftest64: elftest64.c elf64so.so
102 $(CC) -g -o $@ -MD $@.dep $^
103 -env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest64