CC = gcc TARGET = matemateak CFLAGS = -std=c17 -Wall -Wextra -Wpedantic -Wconversion LFLAGS = -lm CFLAGS += $(shell pkg-config --cflags gtk+-3.0) LFLAGS += $(shell pkg-config --libs gtk+-3.0) C_FILES = $(shell find src/ -name *.c) HEADER_FILES = $(shell find src/ -name *.h) OBJECT_FILES = $(patsubst %.c, %.o, $(C_FILES)) all: compile_flags.txt $(TARGET) $(TARGET): $(OBJECT_FILES) $(CC) -o $@ $(LFLAGS) $^ %.o: %.c $(HEADER_FILES) $(CC) -c -o $@ $(CFLAGS) $< compile_flags.txt: echo -xc $(CFLAGS) | sed 's/\s\+/\n/g' > compile_flags.txt clean: $(RM) $(OBJECT_FILES) $(TARGET)