Makefile: silence some errors, clean up log

This commit is contained in:
Imbus 2025-09-07 21:40:51 +02:00
parent a5c2c35bf6
commit 50d6bbed7b

View file

@ -1,15 +1,22 @@
CC := gcc CC := gcc
CFLAGS := -Wall -Wextra -O2 CFLAGS := -Wall -Wextra -O2
# Silence some errors/warnings for now
CFLAGS += -Wno-implicit-fallthrough
CFLAGS += -Wno-strict-aliasing
CFLAGS += -Wno-uninitialized
SRC := $(wildcard *.c) SRC := $(wildcard *.c)
OBJ := $(SRC:.c=.o) OBJ := $(SRC:.c=.o)
ELF := $(SRC:.c=.elf) ELF := $(SRC:.c=.elf)
%.o: %.c %.o: %.c
$(CC) $(CFLAGS) -c -o $@ $< @echo CC $@
@$(CC) $(CFLAGS) -c -o $@ $<
%.elf: %.o %.elf: %.o
$(CC) $(LIBS) -o $@ $< @echo LD $@
@$(CC) $(LIBS) -o $@ $<
all: $(ELF) all: $(ELF)
@ -23,6 +30,7 @@ format:
clang-format -i $(shell git ls-files '*.c' '*.h') clang-format -i $(shell git ls-files '*.c' '*.h')
clean: clean:
rm -rf $(OBJ) $(ELF) *.json .cache @echo "Cleaning up..."
@rm -rf $(OBJ) $(ELF) *.json .cache
.PHONY: format .PHONY: format