mirror of https://github.com/PatrickLipka/tt.git
Makefile added
This commit is contained in:
parent
193cd79a11
commit
206161a306
|
@ -0,0 +1,28 @@
|
|||
CXX ?= g++
|
||||
CXXFLAGS := -g -Wall -pedantic
|
||||
OBJFLAGS := $(CXXFLAGS) -c
|
||||
|
||||
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)
|
||||
$(CXX) $(CXXFLAGS) -o $@ $(OBJ)
|
||||
|
||||
$(SRC_PATH)/%.o: $(SRC_PATH)/%.cpp
|
||||
$(CXX) $(OBJFLAGS) -o $@ $<
|
||||
|
||||
makedir:
|
||||
@mkdir -p $(BIN_PATH)
|
||||
|
||||
all: $(BIN_PATH)/tt
|
||||
|
||||
clean:
|
||||
@rm -rf $(SRC)/*.o
|
||||
@rm -rf $(BIN)/tt
|
||||
|
||||
.PHONY: makedir clean
|
Loading…
Reference in New Issue