Makefile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #
  2. # meg4/platform/libretro/Makefile
  3. #
  4. # Copyright (C) 2023 bzt
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. #
  20. # @brief The RetroArch / libretro Makefile
  21. #
  22. BACKEND=retroarch
  23. EMBED=1
  24. # MacOS
  25. ifneq ("$(wildcard /Library/Frameworks/*)","")
  26. PACKAGE = MacOS
  27. LDFLAGS = -dynamiclib
  28. CFLAGS = -fPIC -I. -D_MACOS_=1 -D__LIBRETRO__ -x objective-c -fobjc-exceptions
  29. LIBS = -lm
  30. TARGET=meg4_libretro.dynlib
  31. else
  32. # Windows MinGW
  33. ifneq ("$(wildcard /bin/*.exe)","")
  34. PACKAGE = Win
  35. LDFLAGS += -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.ld -Wl,--no-undefined
  36. LIBS += -Wl,--nxcompat -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive
  37. CFLAGS += -fPIC -I. -D__LIBRETRO__
  38. LIBS += -luser32 -lshlwapi -lws2_32
  39. TARGET=meg4_libretro.dll
  40. else
  41. # Linux
  42. PACKAGE = Linux
  43. LDFLAGS = -shared -Wl,--version-script=link.ld -Wl,--no-undefined
  44. CFLAGS += -fPIC -I. -D__LIBRETRO__
  45. LIBS += -lm -lpthread
  46. TARGET=meg4_libretro.so
  47. endif
  48. endif
  49. USE_C99=1
  50. include ../common.mk
  51. libretro:
  52. wget https://raw.githubusercontent.com/libretro/libretro-common/master/include/libretro.h -O libretro.h