1 .SUFFIXES
: .bin .o .o64 .obj .obj64 .exe .asm .lst .pl
5 NASMOPT
= -Ox
-I..
/misc
$(OPT
)
7 TESTS
= $(wildcard *.asm
)
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
$<
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
$<
57 $(NASM
) $(NASMOPT
) -E
-o
$@
-MD
$@.dep
$<
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
)
71 $(RM_F
) *.com
*.o
*.o64
*.obj
*.win32
*.win64
*.exe
*.lst
*.bin
72 $(RM_F
) *.dbg
*.coff
*.ith
*.srec
*.mo32
*.mo64
*.i
*.dep
74 $(RM_F
) elftest elftest64
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
$<
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
$<
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