asm_files := $(wildcard *.asm) obj_files := $(patsubst %.asm,%.o,$(asm_files)) bin_file := asmnc .PHONY: all clean remake all: $(bin_file) clean: rm -f $(obj_files) $(bin_file) remake: clean all %.o: %.asm nasm -f macho64 -w+all -o $@ $< $(bin_file): $(obj_files) gcc $^ -o $@