Makefile compiles all asm files

This commit is contained in:
Joseph Ferano 2024-01-13 13:24:13 +07:00
parent 285b54e95f
commit 6ad9f66bc7
2 changed files with 13 additions and 3 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/decode
/.idea/

View File

@ -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)