Target to generate assembly
This commit is contained in:
parent
d640180231
commit
4851f85f85
1 changed files with 8 additions and 1 deletions
9
Makefile
9
Makefile
|
@ -8,6 +8,7 @@ CFLAGS += -Wno-unused-but-set-variable -Wno-unused-value -Wno-unused-label
|
||||||
C_SOURCES = $(wildcard *.c)
|
C_SOURCES = $(wildcard *.c)
|
||||||
C_HEADERS = $(wildcard *.h)
|
C_HEADERS = $(wildcard *.h)
|
||||||
OBJECTS = $(C_SOURCES:.c=.o)
|
OBJECTS = $(C_SOURCES:.c=.o)
|
||||||
|
ASMS = $(C_SOURCES:.c=.s)
|
||||||
|
|
||||||
all: $(OBJECTS)
|
all: $(OBJECTS)
|
||||||
|
|
||||||
|
@ -15,10 +16,16 @@ all: $(OBJECTS)
|
||||||
@echo "CC $<"
|
@echo "CC $<"
|
||||||
@$(CC) $(CFLAGS) -c $< -o $@
|
@$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
%.s: %.c $(C_HEADERS)
|
||||||
|
@echo "CC $<"
|
||||||
|
@$(CC) $(CFLAGS) -S -masm=intel $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJECTS)
|
rm -f $(OBJECTS)
|
||||||
|
|
||||||
|
asm: $(ASMS)
|
||||||
|
|
||||||
format:
|
format:
|
||||||
clang-format -i $(C_SOURCES) $(C_HEADERS)
|
clang-format -i $(C_SOURCES) $(C_HEADERS)
|
||||||
|
|
||||||
.PHONY: all clean format
|
.PHONY: all clean format asm
|
Loading…
Reference in a new issue