makefile 485 B

12345678910111213141516171819202122232425262728293031
  1. CXX=g++
  2. CXXFLAGS=
  3. LDFLAGS=-lSDL -lSDL_gfx
  4. INC=
  5. LIB=
  6. EXEC=RainbowDodge
  7. SRC=$(shell find . -name '*.cpp')
  8. OBJ=$(SRC:.cpp=.o)
  9. $(EXEC): $(OBJ)
  10. @mkdir -p bin
  11. $(CXX) -o bin/$@ $^ $(LDFLAGS) $(LIB)
  12. #TODO add .h in case of global variables
  13. %.o : %.cpp
  14. $(CXX) -o $@ -c $< $(CXXFLAGS) $(INC)
  15. clean:
  16. rm -rf $(OBJ)
  17. distclean: clean
  18. rm -rf ./bin
  19. rm -rf ./dist
  20. exec: $(EXEC)
  21. ./bin/$(EXEC)
  22. dist: $(EXEC)
  23. @mkdir -p dist
  24. tar --create --file dist/RainbowDodge-linux.tar ./bin/$(EXEC)