makefile 390 B

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