Browse Source

add makefile

xayon40-12 4 years ago
parent
commit
1a5a168321
1 changed files with 27 additions and 0 deletions
  1. 27 0
      makefile

+ 27 - 0
makefile

@@ -0,0 +1,27 @@
+SHELL := /bin/bash
+
+CXX=g++
+CXXFLAGS=-std=c++11
+LDFLAGS=-lm -lOpenCL -lboost_system -lSDL
+INC=
+LIB=
+
+EXEC=pongcircle
+SRC=$(shell find . -name '*.cpp') 
+OBJ=$(SRC:.cpp=.o)
+
+$(EXEC): $(OBJ)
+	@mkdir -p bin
+	@$(CXX) -o bin/$@ $^ $(LDFLAGS) $(LIB)
+
+#TODO add .h in case off global variables
+%.o : %.cpp 
+	@$(CXX) -o $@ -c $< $(CXXFLAGS) $(INC)
+clean:
+	@rm -rf $(OBJ)
+
+distclean: clean
+	@rm -rf $(EXEC)
+
+exec: $(EXEC)
+	@./bin/$(EXEC)