makefile 2.1 KB

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