CC = gcc CFLAGS = -std=c99 -O3 -Wall -Wextra -Wpedantic -Wstrict-aliasing CFLAGS += -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wcast-align CFLAGS += -Wstrict-prototypes -Wstrict-overflow=5 -Wwrite-strings CFLAGS += -Wcast-qual -Wswitch-default -Wswitch-enum CFLAGS += -Wconversion -Wunreachable-code CFLAGS += -Iinclude -g LDFLAGS = NAME = zad3 SRC = src BIN = target _PROG = main.c doubly_linked_list.c PROG = $(addprefix $(SRC)/, $(_PROG)) OBJ = $(_PROG:.c=.o) .PHONY: all clean all: dirs $(NAME) dirs: mkdir -p $(BIN) $(NAME): $(OBJ) $(CC) $(addprefix $(BIN)/, $^) $(LDFLAGS) -o $(BIN)/$@ %.o: src/%.c $(CC) -c $< $(CFLAGS) -o $(BIN)/$@ clean: rm -rf $(addprefix $(BIN)/, $(OBJ)) rm -rf $(BIN)/$(NAME)