makefile 348 B

12345678910111213141516171819202122232425
  1. CXX=g++
  2. CXXFLAGS=-std=c++11
  3. LDFLAGS=-lSDL2 -lSDL2_image -lbox2d
  4. INC=
  5. LIB=
  6. EXEC=SdlApp
  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. %.o : %.cpp
  13. $(CXX) -o $@ -c $< $(CXXFLAGS) $(INC)
  14. clean:
  15. rm -rf $(OBJ)
  16. distclean: clean
  17. rm -rf ./bin
  18. exec: $(EXEC)
  19. ./bin/$(EXEC)