Просмотр исходного кода

Make project compilable with GNU/make

DricomDragon 4 лет назад
Родитель
Сommit
5caae2846f
6 измененных файлов с 70 добавлено и 4 удалено
  1. 40 0
      .gitignore
  2. 26 0
      makefile
  3. 1 1
      src/Control/Input.h
  4. 1 1
      src/Structures/Affichable.h
  5. 1 1
      src/Structures/SDL_rotozoom.h
  6. 1 1
      src/Structures/SpriteLoader.h

+ 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=HyperGunner
+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)

+ 1 - 1
src/Control/Input.h

@@ -6,7 +6,7 @@
 
 // Include
 #include <iostream>
-#include <SDL.h>
+#include <SDL/SDL.h>
 
 
 // Classe

+ 1 - 1
src/Structures/Affichable.h

@@ -2,7 +2,7 @@
 #define AFFICHABLE_H
 
 #include <iostream>
-#include <SDL.h>
+#include <SDL/SDL.h>
 #include "../Structures/Vecteur.h"
 
 class Affichable

+ 1 - 1
src/Structures/SDL_rotozoom.h

@@ -41,7 +41,7 @@ extern "C" {
 #define M_PI	3.141592654
 #endif
 
-#include "SDL.h"
+#include <SDL/SDL.h>
 
 	/* ---- Defines */
 

+ 1 - 1
src/Structures/SpriteLoader.h

@@ -4,7 +4,7 @@
 #include <iostream>
 #include <string>
 #include <map>
-#include <SDL.h>
+#include <SDL/SDL.h>
 
 class SpriteLoader
 {