CPlay/Makefile

36 lines
558 B
Makefile

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