31 lines
469 B
Makefile
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)
|