makefile.in 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #
  2. # project data
  3. #
  4. NAME=rue
  5. VERSION=v0.0.0
  6. #
  7. # directories - separate for native and android
  8. #
  9. DIRECTORY_NATIVE=build/native
  10. DIRECTORY_NATIVE_OBJ=${DIRECTORY_NATIVE}/objects
  11. DIRECTORY_NATIVE_ASSETS=${DIRECTORY_NATIVE}/output/assets
  12. DIRECTORY_NATIVE_OUT=${DIRECTORY_NATIVE}/output
  13. DIRECTORY_NATIVE_ALL=${DIRECTORY_NATIVE} ${DIRECTORY_NATIVE_OBJ} ${DIRECTORY_NATIVE_ASSETS} ${DIRECTORY_NATIVE_OUT}
  14. DIRECTORY_ANDROID=build/android
  15. DIRECTORY_ANDROID_OBJ=${DIRECTORY_ANDROID}/objects
  16. DIRECTORY_ANDROID_ALL=${DIRECTORY_ANDROID} ${DIRECTORY_ANDROID_OBJ}
  17. DIRECTORY_ALL=${DIRECTORY_NATIVE_ALL} ${DIRECTORY_ANDROID_ALL}
  18. #
  19. # source files
  20. #
  21. SRC=$(wildcard src/*.dd)
  22. HEADERS=$(wildcard *.ddh)
  23. PLY=$(wildcard assets/*.ply)
  24. BMP=$(wildcard assets/*.bmp)
  25. WAV=$(wildcard assets/*.wav)
  26. OGG=$(wildcard assets/*.ogg)
  27. #
  28. # native output files
  29. #
  30. NATIVE_OBJ=${SRC:src/%.dd=${DIRECTORY_NATIVE_OBJ}/%.o}
  31. NATIVE_OUT=${DIRECTORY_NATIVE_OUT}/${NAME}-${VERSION}.x86_64
  32. NATIVE_ASSETS_OBJ=${PLY:assets/%.ply=build/native/output/assets/%.asset} ${BMP:assets/%.bmp=build/native/output/assets/%.asset} \
  33. ${WAV:assets/%.wav=build/native/output/assets/%.asset} ${OGG:assets/%.ogg=build/native/output/assets/%.asset}
  34. #
  35. # android output files
  36. #
  37. ANDROID_OBJ=${SRC:src/%.dd=${DIRECTORY_ANDROID_OBJ}/%.c}
  38. #
  39. # default build - native only
  40. #
  41. all: native
  42. #
  43. # how to make builds for native and android
  44. #
  45. native: ${DIRECTORY_NATIVE_ALL} ${NATIVE_OUT} ${NATIVE_ASSETS_OBJ}
  46. android: ${DIRECTORY_ANDROID_ALL} ${ANDROID_OBJ}
  47. cp *.h ${DIRECTORY_ANDROID_OBJ}/
  48. #
  49. # native - compile files - assets - final executable
  50. #
  51. ${DIRECTORY_NATIVE_OBJ}/%.o: src/%.dd ${HEADERS}
  52. avdl -c $< -o $@ -I include
  53. ${DIRECTORY_NATIVE_ASSETS}/%.asset: assets/%.ply
  54. avdl -c $< -o $@
  55. ${DIRECTORY_NATIVE_ASSETS}/%.asset: assets/%.bmp
  56. avdl -c $< -o $@
  57. ${DIRECTORY_NATIVE_ASSETS}/%.asset: assets/%.wav
  58. avdl -c $< -o $@
  59. ${DIRECTORY_NATIVE_ASSETS}/%.asset: assets/%.ogg
  60. avdl -c $< -o $@
  61. ${NATIVE_OUT}: ${NATIVE_OBJ}
  62. avdl $^ -o $@
  63. #
  64. # android - compile files
  65. #
  66. ${DIRECTORY_ANDROID_OBJ}/%.c: src/%.dd ${HEADERS}
  67. avdl --android -t $< -o $@ -I include
  68. #
  69. # make any directory needed
  70. #
  71. ${DIRECTORY_ALL}:
  72. mkdir -p $@
  73. #
  74. # clean project
  75. #
  76. clean:
  77. rm -r build
  78. #
  79. # phony targets
  80. #
  81. .PHONY: clean native android