Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #
  2. # meg4/platform/sokol/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 sokol Makefile
  21. #
  22. BACKEND=sokol
  23. # MacOS
  24. ifneq ("$(wildcard /Library/Frameworks/*)","")
  25. PACKAGE = MacOS
  26. CFLAGS = -I. -D_MACOS_=1 -x objective-c -fobjc-exceptions
  27. LIBS = -F/Library/Frameworks -framework QuartzCore -framework Cocoa -framework MetalKit -framework Metal -framework AppKit -framework AudioToolbox -framework AVFoundation
  28. else
  29. # Windows MinGW
  30. ifneq ("$(wildcard /bin/*.exe)","")
  31. PACKAGE = Win
  32. LDFLAGS += -mwindows -static-libgcc
  33. LIBS += -Wl,--nxcompat -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive
  34. CFLAGS += -I.
  35. LIBS += -lGL -luser32 -lcomdlg32 -lshlwapi -lws2_32 -lole32
  36. else
  37. # Linux
  38. PACKAGE = Linux
  39. CFLAGS += -I.
  40. LIBS += -lasound -lX11 -lXi -lXcursor -lGL -lm -ldl -lpthread
  41. endif
  42. endif
  43. USE_C99=1
  44. include ../common.mk
  45. sokol:
  46. wget https://raw.githubusercontent.com/floooh/sokol/master/sokol_app.h -O sokol_app.h
  47. wget https://raw.githubusercontent.com/floooh/sokol/master/sokol_audio.h -O sokol_audio.h
  48. wget https://raw.githubusercontent.com/floooh/sokol/master/sokol_gfx.h -O sokol_gfx.h
  49. wget https://raw.githubusercontent.com/floooh/sokol/master/sokol_glue.h -O sokol_glue.h
  50. wget https://raw.githubusercontent.com/floooh/sokol/master/util/sokol_gl.h -O sokol_gl.h