Browse Source

Import build stuff

DricomDragon 4 years ago
parent
commit
0704e973fb
2 changed files with 66 additions and 0 deletions
  1. 40 0
      .gitignore
  2. 26 0
      makefile

+ 40 - 0
.gitignore

@@ -0,0 +1,40 @@
+# Created by https://www.toptal.com/developers/gitignore/api/c++
+# Edit at https://www.toptal.com/developers/gitignore?templates=c++
+
+### C++ ###
+# Prerequisites
+*.d
+
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+*.smod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+# End of https://www.toptal.com/developers/gitignore/api/c++
+
+bin/

+ 26 - 0
makefile

@@ -0,0 +1,26 @@
+CXX=g++
+CXXFLAGS=
+LDFLAGS=-lSDL -lSDL_gfx
+INC=
+LIB=
+
+EXEC=RainbowDodge
+SRC=$(shell find . -name '*.cpp') 
+OBJ=$(SRC:.cpp=.o)
+
+$(EXEC): $(OBJ)
+	@mkdir -p bin
+	$(CXX) -o bin/$@ $^ $(LDFLAGS) $(LIB)
+
+#TODO add .h in case of global variables
+%.o : %.cpp 
+	$(CXX) -o $@ -c $< $(CXXFLAGS) $(INC)
+	
+clean:
+	rm -rf $(OBJ)
+
+distclean: clean
+	rm -rf $(EXEC)
+
+exec: $(EXEC)
+	./bin/$(EXEC)