nasm/test/Makefile

70 lines
1.5 KiB
Makefile
Raw Normal View History

.SUFFIXES: .bin .o .o64 .obj .obj64 .exe .asm .lst .pl
2007-09-20 07:15:22 +08:00
NASM = ../nasm
NASMOPT = -Ox -I../misc
PERL = perl
TESTS = $(wildcard *.asm)
2007-09-20 07:15:22 +08:00
%.bin: %.asm $(NASM)
2007-09-25 04:42:09 +08:00
$(NASM) $(NASMOPT) -f bin -o $@ -l $*.lst $<
2007-09-20 07:15:22 +08:00
%.o: %.asm $(NASM)
2007-09-25 04:42:09 +08:00
$(NASM) $(NASMOPT) -f elf32 -o $@ -l $*.lst $<
2007-09-20 07:15:22 +08:00
%.o64: %.asm $(NASM)
2007-09-25 04:42:09 +08:00
$(NASM) $(NASMOPT) -f elf64 -o $@ -l $*.lst $<
2007-09-20 07:15:22 +08:00
%.obj: %.asm $(NASM)
2007-09-25 04:42:09 +08:00
$(NASM) $(NASMOPT) -f win32 -o $@ -l $*.lst $<
2007-09-20 07:15:22 +08:00
%.obj64: %.asm $(NASM)
2007-09-25 04:42:09 +08:00
$(NASM) $(NASMOPT) -f win64 -o $@ -l $*.lst $<
2007-09-20 07:15:22 +08:00
%.asm: %.pl
$(PERL) $< > $@
2007-09-20 07:15:22 +08:00
all:
golden: performtest.pl $(TESTS)
$(PERL) performtest.pl --golden --nasm='$(NASM)' $(TESTS)
test: performtest.pl $(NASM) $(TESTS)
$(PERL) performtest.pl --nasm='$(NASM)' $(TESTS)
diff: performtest.pl $(NASM) $(TESTS)
$(PERL) performtest.pl --diff --nasm='$(NASM)' $(TESTS)
2002-05-01 04:51:32 +08:00
clean:
rm -f *.com *.o *.o64 *.obj *.obj64 *.exe *.lst *.bin
rm -rf testresults
rm -f elftest elftest64
spotless: clean
rm -rf golden
#
# Test for ELF32 shared libraries; assumes an x86 Linux system
#
elfso.o: elfso.asm $(NASM)
$(NASM) $(NASMOPT) -f elf32 -F stabs -o $@ -l $*.lst $<
elfso.so: elfso.o
$(LD) -m elf_i386 -shared -o $@ $<
elftest: elftest.c elfso.so
$(CC) -g -m32 -o $@ $^
-env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest
#
# Test for ELF64 shared libraries; assumes an x86-64 Linux system
#
elf64so.o: elf64so.asm $(NASM)
$(NASM) $(NASMOPT) -f elf64 -F dwarf -o $@ -l $*.lst $<
elf64so.so: elf64so.o
$(LD) -shared -o $@ $<
elftest64: elftest64.c elf64so.so
$(CC) -g -o $@ $^
-env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest64