mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
@SET_MAKE@ (AC_PROG_MAKE_SET) is a legacy autoconf substitution needed only for very old Unix make implementations that don't automatically propagate $(MAKE) to recursively invoked sub-makes. Every Makefile.in in the tree carried its own copy, but that's unnecessary: exporting MAKE once, from the top-level Makefile.in, is sufficient for it to reach any sub-make invoked (directly or transitively) from there. Replace the top-level @SET_MAKE@ with the pair "@SET_MAKE@" followed by "export MAKE", and drop the now-redundant @SET_MAKE@ line from doc/Makefile.in, misc/Makefile.in and test/Makefile.in. This incidentally fixes doc/Makefile.in being usable when fed directly to nmake (as Mkfiles/msvc.mak's "docs" rule does, since it predates running ./configure): a bare "@SET_MAKE@" line, left unexpanded, is not a valid nmake assignment or rule and previously caused a hard parse error (U1035, "expected ':' or '=' separator"). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
156 lines
3.8 KiB
Makefile
156 lines
3.8 KiB
Makefile
.SUFFIXES: .bin .bin16 .bin32 .bin64 .o .o64 .aout .aoutb .obj .obj64 \
|
|
.mo32 .mo64 .dbg .i .od .ox .ith .srec .exe .lst \
|
|
.asm .pl
|
|
|
|
# Binary suffixes
|
|
O = @OBJEXT@
|
|
X = @EXEEXT@
|
|
A = @LIBEXT@
|
|
|
|
NASM = ../nasm$(X)
|
|
NDISASM = ../ndisasm$(X)
|
|
OMFDUMP = ../misc/omfdump$(X)
|
|
LISTOPT = -L+
|
|
NASMOPT = -DSRC -Ox -I../misc -I../travis/pushimm -I../travis/macroerr -I../travis/incbin $(LISTOPT) $(OPT)
|
|
PERL = perl
|
|
TESTS = $(wildcard *.asm)
|
|
RM_F = rm -f
|
|
RM_RF = rm -rf
|
|
|
|
.PHONY: tools nasm ndisasm ffmpegtest x264test dav1dtest intel-ipsec-mbtest isa-ltest isa-l_cryptotest cryptography-primitivestest
|
|
tools:
|
|
$(MAKE) -C .. all
|
|
|
|
nasm ndisasm:
|
|
$(MAKE) -C .. $(@F)
|
|
|
|
$(NASM) $(NDISASM):
|
|
$(MAKE) -C .. $(@F)
|
|
|
|
ffmpegtest:
|
|
bash projtest.sh '$(NASM)' $@
|
|
|
|
x264test:
|
|
bash projtest.sh '$(NASM)' $@
|
|
|
|
dav1dtest:
|
|
bash projtest.sh '$(NASM)' $@
|
|
|
|
intel-ipsec-mbtest:
|
|
bash projtest.sh '$(NASM)' $@
|
|
|
|
isa-ltest:
|
|
bash projtest.sh '$(NASM)' $@
|
|
|
|
isa-l_cryptotest:
|
|
bash projtest.sh '$(NASM)' $@
|
|
|
|
cryptography-primitivestest:
|
|
bash projtest.sh '$(NASM)' $@
|
|
|
|
%.bin: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f bin -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.bin16: %.asm $(NASM)
|
|
$(NASM) --bits 16 $(NASMOPT) -f bin -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.bin32: %.asm $(NASM)
|
|
$(NASM) --bits 32 $(NASMOPT) -f bin -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.bin64: %.asm $(NASM)
|
|
$(NASM) --bits 64 $(NASMOPT) -f bin -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.ith: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f ith -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.srec: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f srec -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.o: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f elf32 -gdwarf -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.ox: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f elfx32 -gdwarf -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.o64: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f elf64 -gdwarf -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.aout: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f aout -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.aoutb: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f aoutb -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.obj: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f obj -gborland -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.rdf: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f rdf -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.od: %.obj $(OMFDUMP)
|
|
$(OMFDUMP) $< > $@
|
|
|
|
%.coff: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f coff -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.win32: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f win32 -gcv8 -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.win64: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f win64 -gcv8 -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.mo32: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f macho32 -gdwarf -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.mo64: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f macho64 -gdwarf -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.dbg: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -f dbg -gdebug -o $@ -MD $@.dep -l $@.lst $<
|
|
|
|
%.asm: %.pl
|
|
$(PERL) $< > $@
|
|
|
|
%.i: %.asm $(NASM)
|
|
$(NASM) $(NASMOPT) -E -o $@ -MD $@.dep $<
|
|
|
|
all:
|
|
|
|
clean:
|
|
$(RM_F) *.com *.o *.o64 *.aout *.obj *.win32 *.win64 *.exe *.lst *.bin
|
|
$(RM_F) *.bin *.bin16 *.bin32 *.bin64
|
|
$(RM_F) *.dbg *.coff *.ith *.srec *.mo32 *.mo64 *.i *.dep *.rdf
|
|
$(RM_F) *.aoutb
|
|
$(RM_RF) testresults
|
|
$(RM_F) elftest elftest64
|
|
$(RM_RF) ffmpegtest x264test dav1dtest
|
|
$(RM_RF) intel-ipsec-mbtest isa-ltest isa-l_cryptotest cryptography-primitivestest
|
|
|
|
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 $@ -MD $@.dep -l $@.lst $<
|
|
|
|
elfso.so: elfso.o
|
|
$(LD) -m elf_i386 -shared -o $@ -MD $@.dep $<
|
|
|
|
elftest: elftest.c elfso.so
|
|
$(CC) -g -m32 -o $@ -MD $@.dep $^
|
|
-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 $@ -MD $@.dep -l $@.lst $<
|
|
|
|
elf64so.so: elf64so.o
|
|
$(LD) -shared -o $@ -MD $@.dep $<
|
|
|
|
elftest64: elftest64.c elf64so.so
|
|
$(CC) -g -o $@ -MD $@.dep $^
|
|
-env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./elftest64
|