diff --git a/.gitignore b/.gitignore index 5d9b464..8da5353 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /decode +/.idea/ diff --git a/Makefile b/Makefile index 283abf6..fe6f616 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,24 @@ 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 +.PHONY: build clean run all asm_files -all: decode +all: decode asm_files decode: decode.c $(CC) $(CFLAGS) $< -o $@ +asm_files: $(bin_files) +%.bin: %.asm + nasm $< -o $@ + run: all ./decode clean: - rm -vf *.so *.o decode + rm -vf *.so *.o decode $(bin_files) +