aisd_lab/lab1/zad2/Makefile
2024-03-11 22:45:43 +01:00

35 lines
718 B
Makefile

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 = zad2
SRC = src
BIN = target
_PROG = main.c 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)