Un runner fait en CSFML reprenant certaines mécaniques de jeu d'Orton and the princess.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/usr/bin/make -f
  2. # ---
  3. # Project: my_runner
  4. # Author: yann.magnin@epitech.eu
  5. # ---
  6. include global.mk
  7. # function
  8. # $1 module name
  9. # $2 file
  10. define rule-module
  11. build/$1_$(patsubst %.c,%,$2).o: src/$1/$2
  12. $(cc) $(cflags) -c $$< -o $$@ $(header)
  13. endef
  14. config = gcc.cfg
  15. name = my_runner
  16. header = -Iinclude/
  17. module = core draw game memory menu text kinematic
  18. build-dir = build
  19. $(foreach mod,$(module), $(eval \
  20. mod-$(mod)-src = $(notdir $(wildcard src/$(mod)/*.c)) $n\
  21. mod-$(mod)-obj = $$(patsubst %.c,build/$(mod)_%.o,$$(mod-$(mod)-src)) \
  22. ))
  23. target-obj = $(foreach mod, $(module), $(mod-$(mod)-obj))
  24. # Chek configuration file
  25. ifeq ($(wildcard $(config)),)
  26. $(warning "Configuration file missing. skipping some compilation flags.")
  27. cflags += -g0
  28. else
  29. cflags += @$(config)
  30. endif
  31. all: check_lib $(name)
  32. $(target-obj): | $(build-dir)
  33. $(name): $(target-obj)
  34. @ printf 'link binary $@\n'
  35. $(cc) $(cflags) -o $@ $(target-obj) $(header) $(lib-link) -lgcc
  36. $(build-dir):
  37. @ printf 'create build folder:\033[1;35m $@\033[0m\n'
  38. mkdir -p $@
  39. check_lib:
  40. make -C lib/
  41. $(foreach mod, $(module), \
  42. $(foreach source,$(mod-$(mod)-src), $(eval \
  43. $(call rule-module,$(mod),$(source)))) \
  44. )
  45. ##
  46. ## Clean rule
  47. ##
  48. clean:
  49. rm -rf $(name)
  50. make clean -C lib/
  51. fclean: clean
  52. rm -rf build
  53. make fclean -C lib/
  54. re: fclean all
  55. .PHONY: clean re fclean