36 lines
709 B
Makefile
36 lines
709 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
|
||
|
LDFLAGS =
|
||
|
|
||
|
NAME = zad1
|
||
|
|
||
|
SRC = src
|
||
|
BIN = target
|
||
|
|
||
|
_PROG = main.c queue.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)
|