Makefile.in 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #
  2. # Nintendo DS Makefile
  3. #
  4. .PHONY: package clean
  5. ifeq ($(strip $(DEVKITPRO)),)
  6. $(error "DEVKITPRO must be set in your environment.")
  7. endif
  8. ifeq ($(strip $(DEVKITARM)),)
  9. $(error "DEVKITARM must be set in your environment.")
  10. endif
  11. include ${DEVKITARM}/ds_rules
  12. #
  13. # NDS target rules
  14. #
  15. STRIP = /bin/true
  16. #
  17. # Override library paths.
  18. #
  19. #
  20. # As of devkitARM r51 $(PORTLIBS) has multiple paths...
  21. #
  22. PORTLIBS_INCLUDES := $(foreach dir, $(PORTLIBS), -isystem $(dir)/include)
  23. PORTLIBS_LIBS := $(foreach dir, $(PORTLIBS), -L$(dir)/lib)
  24. EXTRA_INCLUDES := ${PORTLIBS_INCLUDES} \
  25. -isystem arch/nds/ndsScreens/build \
  26. -isystem $(DEVKITPRO)/libfat-nds/include \
  27. -isystem $(LIBNDS)/include
  28. EXTRA_LIBS := ${PORTLIBS_LIBS} \
  29. -Larch/nds/ndsScreens/lib \
  30. -L$(DEVKITPRO)/libfat-nds/lib \
  31. -L$(LIBNDS)/lib -lfat -lm -lnds9
  32. ARCH_CFLAGS += ${EXTRA_INCLUDES} -DARM9 -D__NDS__ -Iarch/nds
  33. ARCH_CXXFLAGS += ${ARCH_CFLAGS}
  34. ARCH_LDFLAGS += ${EXTRA_LIBS} -specs=ds_arm9.specs
  35. #
  36. # Vile hack, remove me ASAP
  37. #
  38. arch/nds/%.o: arch/nds/%.c
  39. $(if ${V},,@echo " CC " $<)
  40. ${CC} -MD ${core_cflags} ${core_flags} -Wno-unused-macros -c $< -o $@
  41. package: mzx
  42. ${MAKE} -C arch/nds TARGET=${mzxrun}
  43. ndstool -c ${mzxrun}.nds -7 arch/nds/${mzxrun}.arm7.elf -9 ${mzxrun} -b arch/nds/icon.bmp "MegaZeux ${VERSION}"
  44. clean:
  45. @${MAKE} -C arch/nds TARGET=${mzxrun} clean
  46. @rm -f ${mzxrun}.nds arch/nds/*.{d,o}
  47. #
  48. # We're only interested in our packaged binary; remove the ELF intermediaries
  49. #
  50. build := build/${SUBPLATFORM}/games/megazeux
  51. build: package ${build}
  52. ${CP} arch/nds/pad.config ${build}
  53. ${CP} ${mzxrun}.nds ${build}
  54. ${RM} ${build}/${mzxrun} ${build}/${mzxrun}.debug
  55. include arch/zip.inc