makefile 375 B

1234567891011121314151617181920212223242526
  1. CXX=g++
  2. CXXFLAGS=
  3. LDFLAGS=-lSDL -lSDL_gfx
  4. INC=
  5. LIB=
  6. EXEC=HyperGunner
  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. exec: $(EXEC)
  20. ./bin/$(EXEC)