jpp/lab2/zad1/Makefile

32 lines
469 B
Makefile
Raw Normal View History

2024-04-11 20:23:13 +02:00
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)