2007-10-05 06:18:23 +08:00
|
|
|
.SUFFIXES: .bin .o .o64 .obj .obj64 .exe .asm .lst .pl
|
2007-09-20 07:15:22 +08:00
|
|
|
|
2008-10-05 12:59:38 +08:00
|
|
|
NASM = ../nasm
|
2007-10-20 04:16:51 +08:00
|
|
|
NASMOPT = -Ox -I../misc
|
2008-10-05 12:59:38 +08:00
|
|
|
PERL = perl
|
|
|
|
TESTS = $(wildcard *.asm)
|
2007-09-20 07:15:22 +08:00
|
|
|
|
2007-09-23 12:47:13 +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
|
|
|
|
2009-07-06 07:14:33 +08:00
|
|
|
%.ith: %.asm $(NASM)
|
|
|
|
$(NASM) $(NASMOPT) -f ith -o $@ -l $*.lst $<
|
|
|
|
|
|
|
|
%.srec: %.asm $(NASM)
|
|
|
|
$(NASM) $(NASMOPT) -f srec -o $@ -l $*.lst $<
|
|
|
|
|
2007-09-23 12:47:13 +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
|
|
|
|
2007-09-23 12:47:13 +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
|
|
|
|
2007-09-23 12:47:13 +08:00
|
|
|
%.obj: %.asm $(NASM)
|
2009-07-17 10:44:43 +08:00
|
|
|
$(NASM) $(NASMOPT) -f obj -o $@ -l $*.lst $<
|
|
|
|
|
|
|
|
%.coff: %.asm $(NASM)
|
|
|
|
$(NASM) $(NASMOPT) -f coff -o $@ -l $*.lst $<
|
|
|
|
|
|
|
|
%.win32: %.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
|
|
|
|
2009-07-17 10:44:43 +08:00
|
|
|
%.win64: %.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
|
|
|
|
2009-07-17 10:44:43 +08:00
|
|
|
%.mo32: %.asm $(NASM)
|
|
|
|
$(NASM) $(NASMOPT) -f macho32 -o $@ -l $*.lst $<
|
|
|
|
|
|
|
|
%.mo64: %.asm $(NASM)
|
|
|
|
$(NASM) $(NASMOPT) -f macho64 -o $@ -l $*.lst $<
|
|
|
|
|
2009-06-28 12:28:09 +08:00
|
|
|
%.dbg: %.asm $(NASM)
|
|
|
|
$(NASM) $(NASMOPT) -f dbg -o $@ -l $*.lst $<
|
|
|
|
|
2007-10-05 06:18:23 +08:00
|
|
|
%.asm: %.pl
|
|
|
|
$(PERL) $< > $@
|
|
|
|
|
2007-09-20 07:15:22 +08:00
|
|
|
all:
|
|
|
|
|
2008-10-05 12:59:38 +08:00
|
|
|
golden: performtest.pl $(TESTS)
|
|
|
|
$(PERL) performtest.pl --golden --nasm='$(NASM)' $(TESTS)
|
|
|
|
|
|
|
|
test: performtest.pl $(NASM) $(TESTS)
|
|
|
|
$(PERL) performtest.pl --nasm='$(NASM)' $(TESTS)
|
|
|
|
|
2008-10-05 13:02:44 +08:00
|
|
|
diff: performtest.pl $(NASM) $(TESTS)
|
|
|
|
$(PERL) performtest.pl --diff --nasm='$(NASM)' $(TESTS)
|
|
|
|
|
2002-05-01 04:51:32 +08:00
|
|
|
clean:
|
2009-07-17 10:44:43 +08:00
|
|
|
rm -f *.com *.o *.o64 *.obj *.win32 *.win64 *.exe *.lst *.bin
|
|
|
|
rm -f *.dbg *.coff *.ith *.srec *.mo32 *.mo64
|
2008-10-05 12:59:38 +08:00
|
|
|
rm -rf testresults
|
2008-10-18 08:13:26 +08:00
|
|
|
rm -f elftest elftest64
|
2008-10-05 12:59:38 +08:00
|
|
|
|
|
|
|
spotless: clean
|
|
|
|
rm -rf golden
|
2008-10-18 08:13:26 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# Test for ELF32 shared libraries; assumes an x86 Linux system
|
|
|
|
#
|
2008-10-18 10:29:15 +08:00
|
|
|
elfso.o: elfso.asm $(NASM)
|
2008-10-18 14:03:04 +08:00
|
|
|
$(NASM) $(NASMOPT) -f elf32 -F stabs -o $@ -l $*.lst $<
|
2008-10-18 08:13:26 +08:00
|
|
|
|
|
|
|
elfso.so: elfso.o
|
|
|
|
$(LD) -m elf_i386 -shared -o $@ $<
|
|
|
|
|
|
|
|
elftest: elftest.c elfso.so
|
2008-10-18 14:03:04 +08:00
|
|
|
$(CC) -g -m32 -o $@ $^
|
|
|
|
-env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest
|
2008-10-18 08:13:26 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# Test for ELF64 shared libraries; assumes an x86-64 Linux system
|
|
|
|
#
|
2008-10-18 10:29:15 +08:00
|
|
|
elf64so.o: elf64so.asm $(NASM)
|
2008-10-18 14:03:04 +08:00
|
|
|
$(NASM) $(NASMOPT) -f elf64 -F dwarf -o $@ -l $*.lst $<
|
2008-10-18 08:13:26 +08:00
|
|
|
|
|
|
|
elf64so.so: elf64so.o
|
|
|
|
$(LD) -shared -o $@ $<
|
|
|
|
|
|
|
|
elftest64: elftest64.c elf64so.so
|
2008-10-18 14:03:04 +08:00
|
|
|
$(CC) -g -o $@ $^
|
|
|
|
-env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest64
|