TARGET = ratazana CC = clang CFLAGS = -Wall -Wextra -pedantic -std=c23 -O2 DEBUGFLAGS = -g -O0 -DDEBUG -fsanitize=address -fsanitize=undefined LDFLAGS = LIBS = SOURCES = hidpp20.c hidraw.c utils.c main.c HEADERS = ratazana.h hidpp20.h hexdump.h OBJECTS = $(SOURCES:.c=.o) all: $(TARGET) debug: CFLAGS += $(DEBUGFLAGS) debug: clean $(TARGET) $(TARGET): $(OBJECTS) @$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) %.o: %.c ratazana.h @$(CC) $(CFLAGS) -c $< -o $@ clean: rm -f $(OBJECTS) $(TARGET) fmt: clang-format -i $(SOURCES) $(HEADERS) lint: clang-tidy $(SOURCES) -- $(CFLAGS) .PHONY: all debug clean fmt lint