From 4851f85f852f04a4b84cae80cd0e007425c6df65 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 23 Jun 2024 14:27:23 +0200 Subject: [PATCH] Target to generate assembly --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ce1d577..fe3f943 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ CFLAGS += -Wno-unused-but-set-variable -Wno-unused-value -Wno-unused-label C_SOURCES = $(wildcard *.c) C_HEADERS = $(wildcard *.h) OBJECTS = $(C_SOURCES:.c=.o) +ASMS = $(C_SOURCES:.c=.s) all: $(OBJECTS) @@ -15,10 +16,16 @@ all: $(OBJECTS) @echo "CC $<" @$(CC) $(CFLAGS) -c $< -o $@ +%.s: %.c $(C_HEADERS) + @echo "CC $<" + @$(CC) $(CFLAGS) -S -masm=intel $< + clean: rm -f $(OBJECTS) +asm: $(ASMS) + format: clang-format -i $(C_SOURCES) $(C_HEADERS) -.PHONY: all clean format \ No newline at end of file +.PHONY: all clean format asm \ No newline at end of file