2021-12-08 19:14:51 +01:00
|
|
|
CXX ?= g++
|
|
|
|
CXXFLAGS := -g -Wall -pedantic
|
|
|
|
OBJFLAGS := $(CXXFLAGS) -c
|
2021-12-10 11:09:03 +01:00
|
|
|
LDFLAGS := -lreadline
|
2021-12-08 19:14:51 +01:00
|
|
|
|
|
|
|
BIN_PATH := bin
|
|
|
|
SRC_PATH := src
|
|
|
|
|
|
|
|
SRC := $(foreach x, $(SRC_PATH), $(wildcard $(addprefix $(x)/*,cpp)))
|
|
|
|
OBJ := $(addprefix $(SRC_PATH)/, $(addsuffix .o, $(notdir $(basename $(SRC)))))
|
|
|
|
|
|
|
|
default: makedir all
|
|
|
|
|
|
|
|
$(BIN_PATH)/tt: $(OBJ)
|
2021-12-10 11:09:03 +01:00
|
|
|
$(CXX) $(CXXFLAGS) -o $@ $(OBJ) $(LDFLAGS)
|
2021-12-08 19:14:51 +01:00
|
|
|
|
|
|
|
$(SRC_PATH)/%.o: $(SRC_PATH)/%.cpp
|
|
|
|
$(CXX) $(OBJFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
makedir:
|
|
|
|
@mkdir -p $(BIN_PATH)
|
|
|
|
|
|
|
|
all: $(BIN_PATH)/tt
|
|
|
|
|
|
|
|
clean:
|
2021-12-10 09:27:34 +01:00
|
|
|
@rm -rf $(SRC_PATH)/*.o
|
|
|
|
@rm -rf $(BIN_PATH)/tt
|
2021-12-08 19:14:51 +01:00
|
|
|
|
|
|
|
.PHONY: makedir clean
|