Browse Source

Import make build system

DricomDragon 4 years ago
parent
commit
30d0da24a5
2 changed files with 26 additions and 0 deletions
  1. 1 0
      carTest/.gitignore
  2. 25 0
      carTest/makefile

+ 1 - 0
carTest/.gitignore

@@ -0,0 +1 @@
+bin/

+ 25 - 0
carTest/makefile

@@ -0,0 +1,25 @@
+CXX=g++
+CXXFLAGS=-std=c++11
+LDFLAGS=-lSDL -lSDL_gfx -lbox2d
+INC=
+LIB=
+
+EXEC=SdlApp
+SRC=$(shell find . -name '*.cpp')
+OBJ=$(SRC:.cpp=.o)
+
+$(EXEC): $(OBJ)
+	@mkdir -p bin
+	$(CXX) -o bin/$@ $^ $(LDFLAGS) $(LIB)
+
+%.o : %.cpp
+	$(CXX) -o $@ -c $< $(CXXFLAGS) $(INC)
+
+clean:
+	rm -rf $(OBJ)
+
+distclean: clean
+	rm -rf ./bin
+
+exec: $(EXEC)
+	./bin/$(EXEC)