jpp/lab3/zad1/Makefile
2024-05-10 14:12:10 +02:00

31 lines
469 B
Makefile

CXX = g++
CXXFLAGS = -std=c++20 -O3 -Wall -Wextra -Wpedantic
CXXFLAGS += -Iinclude
LDFLAGS =
NAME = zad1
SRC = src
BIN = target
_PROG = main.cpp
PROG = $(addprefix $(SRC)/, $(_PROG))
OBJ = $(_PROG:.cpp=.o)
.PHONY: all clean
all: dirs $(NAME)
dirs:
mkdir -p $(BIN)
$(NAME): $(OBJ)
$(CXX) $(addprefix $(BIN)/, $^) $(LDFLAGS) -o $(BIN)/$@
%.o: src/%.cpp
$(CXX) -c $< $(CXXFLAGS) -o $(BIN)/$@
clean:
rm -rf $(addprefix $(BIN)/, $(OBJ))
rm -rf $(BIN)/$(NAME)