I just created a general purpose makefile to compile and link assembler files:
AS=nasm
ASFLAGS=-g -f elf64
LDFLAGS=-m elf_x86_64 -static
BINARIES=print_args64
all: $(BINARIES)
%: %.o
$(LD) $(LDFLAGS) -o $@ $<
%.o: %.asm
$(AS) $(ASFLAGS) -o $@ $<
clean:
$(RM) $(BINARIES) $(wildcard *.o)
Running make all I would expect following:
nasm -g -f elf64 -o print_args64.o print_args64.asm
ld -m elf_x86_64 -static -o print_args64 print_args64.o
But it actually adds a rm command for the object in the following:
rm print_args64.o
Where does this come from and how can I avoid it?
I can't find any documentation for this.
Greetings, bvolkmer