matemateak/Makefile
2023-03-20 23:01:15 +01:00

24 lines
447 B
Makefile

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