2023-09-19 11:47:05 +02:00
|
|
|
CC = gcc
|
|
|
|
CFLAGS = -std=c11 -pedantic
|
|
|
|
LDFLAGS =
|
|
|
|
RM = rm
|
|
|
|
|
|
|
|
SOURCES = $(wildcard src/*.c)
|
|
|
|
OBJETS = $(patsubst %.c,%.c.o,$(notdir $(SOURCES)))
|
|
|
|
|
|
|
|
EXE = example
|
2023-10-10 13:15:09 +02:00
|
|
|
EXE_EXT = out
|
2023-09-19 11:47:05 +02:00
|
|
|
|
|
|
|
%.c.o: src/%.c
|
2023-11-12 16:23:10 +01:00
|
|
|
$(CC) -c $< -o $@ $(CFLAGS)
|
2023-09-19 11:47:05 +02:00
|
|
|
|
|
|
|
main: CFLAGS += -O3
|
|
|
|
main: compilation
|
|
|
|
|
|
|
|
dev: CFLAGS += -Wall -Wextra -Wshadow -Wcast-align -Wstrict-prototypes
|
|
|
|
dev: CFLAGS += -fanalyzer -fsanitize=undefined -g -Og
|
|
|
|
dev: LDFLAGS += -fsanitize=undefined
|
|
|
|
dev: compilation
|
|
|
|
|
|
|
|
compilation: $(OBJETS)
|
2023-10-10 13:15:09 +02:00
|
|
|
$(CC) -o $(EXE).$(EXE_EXT) $(OBJETS) $(LDFLAGS)
|
2023-09-19 11:47:05 +02:00
|
|
|
|
|
|
|
all:
|
|
|
|
main
|
|
|
|
|
|
|
|
clean:
|
2023-10-10 13:15:09 +02:00
|
|
|
$(RM) $(OBJETS) $(EXE).$(EXE_EXT)
|