Makefile.in 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #
  2. # Wii Makefile
  3. #
  4. .PHONY: package
  5. ifeq ($(strip $(DEVKITPRO)),)
  6. $(error "DEVKITPRO must be set in your environment.")
  7. endif
  8. ifeq ($(strip $(DEVKITPPC)),)
  9. $(error "DEVKITPPC must be set in your environment.")
  10. endif
  11. #
  12. # Wii target rules
  13. #
  14. include $(DEVKITPPC)/wii_rules
  15. ELF2DOL := elf2dol
  16. STRIP := /bin/true
  17. #
  18. # Override library paths
  19. #
  20. #
  21. # If building with SDLWii, these need to be set manually--no sdl-config.
  22. # libSDL has to be linked at a very specific place in the library list,
  23. # but SDL_LDFLAGS gets appended to the end, so set it to something useless.
  24. #
  25. SDL_CFLAGS = -isystem $(DEVKITPRO)/libogc/include/SDL
  26. SDL_LDFLAGS = $(SDL_CFLAGS)
  27. #
  28. # As of devkitPPC r34 $(PORTLIBS) has multiple paths for some reason...
  29. #
  30. PORTLIBS_INCLUDES := $(foreach dir, $(PORTLIBS), -isystem $(dir)/include)
  31. PORTLIBS_LIBS := $(foreach dir, $(PORTLIBS), -L$(dir)/lib)
  32. EXTRA_INCLUDES := -isystem $(LIBOGC_INC) ${PORTLIBS_INCLUDES}
  33. EXTRA_LIBS := -L$(LIBOGC_LIB) ${PORTLIBS_LIBS} \
  34. $(if $(BUILD_SDL), -lSDL,) \
  35. -lfat -lasnd -lwiikeyboard -lwiiuse -lbte -logc -lstdc++ -lm
  36. ARCH_CFLAGS += ${EXTRA_INCLUDES} $(MACHDEP)
  37. ARCH_CXXFLAGS += ${ARCH_CFLAGS}
  38. ARCH_LDFLAGS += ${EXTRA_LIBS} $(MACHDEP)
  39. # Boot MegaZeux by default if the editor is enabled; otherwise, boot MZXRun.
  40. package: mzx
  41. ifneq ($(BUILD_EDITOR),)
  42. ${ELF2DOL} ${mzx} boot.dol
  43. ${ELF2DOL} ${mzxrun} mzxrun.dol
  44. else
  45. ${ELF2DOL} ${mzxrun} boot.dol
  46. endif
  47. clean:
  48. @rm -f boot.dol mzxrun.dol arch/wii/*.d arch/wii/*.o
  49. #
  50. # Vile hack, remove me ASAP
  51. #
  52. arch/wii/%.o: arch/wii/%.c
  53. $(if ${V},,@echo " CC " $<)
  54. ${CC} -MD ${core_cflags} ${core_flags} -c $< -o $@
  55. #
  56. # Need to nest Wii binaries in a subdir
  57. #
  58. build := build/${SUBPLATFORM}/apps/megazeux
  59. build: package ${build}
  60. ifeq ($(BUILD_SDL),)
  61. ${CP} arch/wii/pad.config ${build}
  62. else
  63. ${CP} arch/wii/pad.config.sdl ${build}/pad.config
  64. endif
  65. ${CP} arch/wii/icon.png ${build}
  66. ${CP} boot.dol ${build}
  67. ifneq ($(BUILD_EDITOR),)
  68. ${CP} mzxrun.dol ${build}
  69. endif
  70. @sed "s/%VERSION%/${VERSION}/g;s/%DATE%/`date -u +%Y%m%d%H%M`/g" \
  71. arch/wii/meta.xml > ${build}/meta.xml
  72. ${RM} ${build}/${mzxrun} ${build}/${mzxrun}.debug
  73. ${RM} ${build}/${mzx} ${build}/${mzx}.debug
  74. include arch/zip.inc