makefile 1.8 KB

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