/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/Makefile.fpc

https://github.com/slibre/freepascal · Unknown · 87 lines · 74 code · 13 blank · 0 comment · 0 complexity · fa36b2f0f93909ad26931d588d2bd70b MD5 · raw file

  1. #
  2. # Makefile.fpc for Free Pascal libogcfpc 2.x.y Examples
  3. #
  4. [target]
  5. loaders=
  6. programs=lesson6
  7. [require]
  8. packages=libogcfpc
  9. tools=bin2s rmdir gxtexconv
  10. nortl=y
  11. [install]
  12. fpcpackage=y
  13. [default]
  14. cpu=powerpc
  15. target=wii
  16. fpcdir=../../../../../../..
  17. [compiler]
  18. options=-g -Xm
  19. [clean]
  20. files=*.elf *.o *.s *.h *.bin *.map \
  21. $(BUILD)/* \
  22. $(INC)/*
  23. units=*
  24. [prerules]
  25. BUILD = build
  26. INC = inc
  27. DATA = data
  28. TEXTURES = textures
  29. SCF_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf)))
  30. TPL_FILES = $(basename $(SCF_FILES)).tpl
  31. [rules]
  32. .NOTPARALLEL:
  33. .PHONY: clean all
  34. clean: dir_delete fpc_clean fpc_cleanall
  35. all: dir_make $(TPL_FILES) fpc_all
  36. #
  37. # Delete temp directories
  38. #
  39. dir_delete:
  40. @$(DELTREE) $(CURDIR)/$(BUILD)
  41. @$(DELTREE) $(CURDIR)/$(DATA)
  42. @$(DELTREE) $(CURDIR)/$(INC)
  43. #
  44. # Create temp directories
  45. #
  46. dir_make:
  47. ifneq ($(BUILD), $(CURDIR))
  48. @$(MKDIR) $(BUILD)
  49. endif
  50. ifneq ($(INC), $(CURDIR))
  51. @$(MKDIR) $(INC)
  52. endif
  53. ifneq ($(DATA), $(CURDIR))
  54. @$(MKDIR) $(DATA)
  55. endif
  56. #
  57. # Textures processing rule
  58. #
  59. $(TPL_FILES):
  60. @echo 'Creating tpl file...'
  61. $(GXTEXCONV) -s textures/$(SCF_FILES) -o $(DATA)/$(TPL_FILES)
  62. @echo $(DATA)/$(TPL_FILES)
  63. @$(bin2o)
  64. #
  65. # Binary files processing rule
  66. #
  67. define bin2o
  68. @$(BIN2S) -a 32 $(DATA)/$(@) > $(BUILD)/$(@).s
  69. @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s
  70. @echo "var" > `(echo $(INC)"/"$(@F) | tr . .)`.inc
  71. @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end: array [0..0] of cuint8; cvar; external;" >> `(echo $(INC)"/"$(@F) | tr . .)`.inc
  72. @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`": array [0..0] of cuint8; cvar; external;" >> `(echo $(INC)"/"$(@F) | tr . .)`.inc
  73. @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size": cuint32; cvar; external;" >> `(echo $(INC)"/"$(@F) | tr . .)`.inc
  74. endef