Browse Source

Import build system

DricomDragon 4 years ago
parent
commit
d6b59044e6
2 changed files with 26 additions and 0 deletions
  1. 1 0
      sdl1/electricField/.gitignore
  2. 25 0
      sdl1/electricField/makefile

+ 1 - 0
sdl1/electricField/.gitignore

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

+ 25 - 0
sdl1/electricField/makefile

@@ -0,0 +1,25 @@
+CXX=g++
+CXXFLAGS=
+LDFLAGS=-lSDL -lSDL_gfx
+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)