makefile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #MACROS
  2. CXX_FLAGS := -O3 -Wall -Wextra -Wpedantic -Werror
  3. LIBS := -lncurses -pthread -ltinfo
  4. CXX := g++ -std=c++11
  5. .PHONY: open, opencpp, openhpp, clean, cleanall, remake
  6. #TARGETS
  7. all: invaders bossrush
  8. invaders: game_object.o bullet.o enemy.o player.o functions.o pic.o body.o boss.o wall.o powerup.o rocket.o invaders.o
  9. $(CXX) $(CXX_FLAGS) $^ -o $@ $(LIBS)
  10. bossrush: game_object.o bullet.o enemy.o player.o functions.o pic.o body.o boss.o wall.o powerup.o rocket.o bossrush.o
  11. $(CXX) $(CXX_FLAGS) $^ -o $@ $(LIBS)
  12. invaders.o: invaders.cpp bullet.hpp enemy.hpp player.hpp rocket.hpp definitions.hpp functions.hpp
  13. $(CXX) $(CXX_FLAGS) -c $<
  14. bossrush.o: bossrush.cpp bullet.hpp enemy.hpp player.hpp rocket.hpp definitions.hpp functions.hpp
  15. $(CXX) $(CXX_FLAGS) -c $<
  16. game_object.o: game_object.cpp game_object.hpp
  17. $(CXX) $(CXX_FLAGS) -c $<
  18. bullet.o: bullet.cpp bullet.hpp game_object.hpp
  19. $(CXX) $(CXX_FLAGS) -c $<
  20. enemy.o: enemy.cpp enemy.hpp game_object.hpp bullet.hpp definitions.hpp
  21. $(CXX) $(CXX_FLAGS) -c $<
  22. player.o: player.cpp player.hpp game_object.hpp bullet.hpp rocket.hpp definitions.hpp
  23. $(CXX) $(CXX_FLAGS) -c $<
  24. functions.o: functions.cpp functions.hpp definitions.hpp powerup.hpp player.hpp bullet.hpp enemy.hpp wall.hpp boss.hpp
  25. $(CXX) $(CXX_FLAGS) -c $<
  26. body.o: body.cpp body.hpp
  27. $(CXX) $(CXX_FLAGS) -c $<
  28. pic.o: pic.cpp body.hpp pic.hpp definitions.hpp
  29. $(CXX) $(CXX_FLAGS) -c $<
  30. boss.o: boss.cpp boss.hpp pic.hpp
  31. $(CXX) $(CXX_FLAGS) -c $<
  32. wall.o: wall.cpp wall.hpp game_object.hpp
  33. $(CXX) $(CXX_FLAGS) -c $<
  34. powerup.o: powerup.cpp powerup.hpp bullet.hpp
  35. $(CXX) $(CXX_FLAGS) -c $<
  36. rocket.o: rocket.cpp rocket.hpp bullet.hpp definitions.hpp
  37. $(CXX) $(CXX_FLAGS) -c $<
  38. clean:
  39. rm -f *~ *.o
  40. cleanall: clean
  41. rm -f invaders
  42. rm -f bossrush
  43. remake: clean invaders bossrush