Makefile.in 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #
  2. # Nintendo Switch Makefile
  3. #
  4. .PHONY: package clean
  5. ifeq ($(strip $(DEVKITPRO)),)
  6. $(error "DEVKITPRO must be set in your environment.")
  7. endif
  8. # NOTE: there is no $DEVKITA64. Don't use it.
  9. #
  10. # Switch target rules
  11. #
  12. include $(DEVKITPRO)/libnx/switch_rules
  13. BINEXT := .elf
  14. APP_TITLE := MegaZeux
  15. APP_AUTHOR := \"MegaZeux Developers\"
  16. APP_ICON := arch/switch/icon.jpg
  17. STRIP := /bin/true
  18. #
  19. # Override library paths.
  20. #
  21. MACHDEP := -D__SWITCH__ -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
  22. ifeq (${DEBUG},1)
  23. #DRM_NOUVEAU := drm_nouveaud
  24. NX := nxd
  25. else
  26. OPTIMIZE_CFLAGS := -O3 -ffunction-sections
  27. #DRM_NOUVEAU := drm_nouveau
  28. NX := nx
  29. endif
  30. MESA_LIBS :=
  31. ifneq ($(or ${BUILD_RENDER_SOFTSCALE}, ${BUILD_RENDER_GL_PROGRAM}),)
  32. MESA_LIBS += -lGLESv2
  33. endif
  34. ifneq (${BUILD_RENDER_GL_FIXED},)
  35. MESA_LIBS += -lGLESv1_CM
  36. endif
  37. ifneq (${MESA_LIBS},)
  38. MESA_LIBS += -lEGL -lglapi -ldrm_nouveau
  39. endif
  40. SDL_PREFIX := ${PORTLIBS}
  41. EXTRA_INCLUDES := -isystem ${LIBNX}/include -isystem ${PORTLIBS}/include
  42. EXTRA_LIBS := -L${LIBNX}/lib -L${PORTLIBS}/lib -L$(DEVKITPRO)/devkitA64/aarch64-none-elf/lib/pic \
  43. -lSDL2 ${MESA_LIBS} -l${NX} -lpng16 -lz
  44. ARCH_CFLAGS += ${EXTRA_INCLUDES} ${MACHDEP}
  45. ARCH_CXXFLAGS += ${ARCH_CFLAGS} -fno-rtti -fno-exceptions
  46. ARCH_LDFLAGS += ${EXTRA_LIBS} ${MACHDEP} -specs=$(DEVKITPRO)/libnx/switch.specs
  47. package: mzx mzxrun.nro megazeux.nro mzxrun.nso megazeux.nso mzxrun.nacp megazeux.nacp
  48. clean:
  49. @rm -f mzxrun.{nacp,nro,nso,pfs0,elf} megazeux.{nacp,nro,nso,pfs0,elf}
  50. build := build/${SUBPLATFORM}/switch/megazeux
  51. build: package ${build}
  52. ${CP} arch/switch/pad.config ${build}
  53. ${CP} megazeux.nro ${build}
  54. ${RM} ${build}/${mzxrun} ${build}/${mzx} ${build}/*.debug
  55. include arch/zip.inc