CFLAGS=-g -std=c2x -fsanitize=address -fno-omit-frame-pointer -Wall -Wextra -pedantic -O0 CC=gcc #This will get the names of the .asm files asm_files = $(wildcard asm_files/*.asm) #This will convert them to .bin names bin_files = $(patsubst %.asm,%.bin,$(asm_files)) .PHONY: build clean run all asm_files all: decode asm_files decode: decode.c lib.h $(CC) $(CFLAGS) $< -o $@ asm_files: $(bin_files) %.bin: %.asm nasm $< -o $@ run: all ./decode clean: rm -vf *.so *.o decode $(bin_files)