Initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
CXX=g++
|
||||
HEADERDIR=./header
|
||||
INCLUDE := $(shell find $(HEADERDIR) -type d | sed -e 's/^/-I/' | tr '\n' ' ' | sed 's/.$$//')
|
||||
CXXFLAGS=-g $(INCLUDE)
|
||||
SRCDIR=./src
|
||||
SRC := $(shell find $(SRCDIR) -name '*.cpp' | tr '\n' ' ' | sed 's/.$$//')
|
||||
OBJDIR=./build/debug/obj
|
||||
OBJ := $(SRC:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)
|
||||
LIBS=-lSDL2
|
||||
EXECUTABLE=slime_mold
|
||||
|
||||
all: debug
|
||||
|
||||
$(OBJ): $(OBJDIR)/%.o : $(SRCDIR)/%.cpp
|
||||
@echo "Compiling source $< into object $@"
|
||||
@mkdir -p '$(@D)'
|
||||
@$(CXX) -c $(CXXFLAGS) $< -o $@
|
||||
|
||||
debug: $(OBJ)
|
||||
@echo "Compiling executable"
|
||||
@$(CXX) $(CXXFLAGS) -o $(EXECUTABLE) $^ $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR)/*
|
||||
rm $(EXECUTABLE)
|
||||
Reference in New Issue
Block a user