Makefile 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #
  2. # meg4/platform/allegro/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 allegro Makefile
  21. #
  22. BACKEND=allegro
  23. # MacOS
  24. ifneq ("$(wildcard /Library/Frameworks/allegro*)","")
  25. PACKAGE = MacOS
  26. CFLAGS = -I/Library/Frameworks/allegro.framework/Headers -I/Library/Frameworks/allegro.framework/Versions/A/Headers -D_MACOS_=1 -x objective-c -fobjc-exceptions
  27. LIBS = -F/Library/Frameworks -framework allegro -framework allegro_audio -framework allegro_main -framework GL -framework OpenAL -framework AppKit
  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. ifneq ("$(wildcard allegro5/*)","")
  35. CFLAGS += -I./allegro5/include -I./allegro5/build/include -I./allegro5/addons/audio
  36. EXTRA += ./allegro5/build/lib/liballegro-static.a ./allegro5/build/lib/liballegro_audio-static.a ./allegro5/build/lib/liballegro_main-static.a
  37. LIBS += -lGL -lole32 -lopenal
  38. else
  39. LIBS += -lallegro -lallegro_audio
  40. endif
  41. LIBS += -luser32 -lcomdlg32 -lshlwapi -lws2_32
  42. else
  43. # Linux
  44. PACKAGE = Linux
  45. ifneq ("$(wildcard allegro5/*)","")
  46. CFLAGS += -I./allegro5/include -I./allegro5/build/include -I./allegro5/addons/audio
  47. EXTRA += ./allegro5/build/lib/liballegro-static.a ./allegro5/build/lib/liballegro_audio-static.a ./allegro5/build/lib/liballegro_main-static.a
  48. LIBS += -lX11 -lXinerama -lXcursor -lXrandr -lXss -lXi -lGL -lasound -lopenal
  49. else
  50. LIBS += -lallegro -lallegro_audio
  51. endif
  52. LIBS += -lm -lpthread
  53. endif
  54. endif
  55. CFLAGS+=-Wno-long-long
  56. include ../common.mk
  57. ifneq ("$(wildcard allegro5/*)","")
  58. ./allegro5/build/lib/liballegro-static.a:
  59. ifeq ("$(wildcard allegro5/build/Makefile)","")
  60. cd allegro5 && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DSHARED=OFF -DPREFER_STATIC_DEPS=ON \
  61. -DWANT_FONT=OFF -DWANT_AUDIO=ON -DWANT_FLAC=OFF -DWANT_VORBIS=OFF -DWANT_TREMOR=OFF -DWANT_OPUS=OFF -DWANT_MODAUDIO=OFF \
  62. -DWANT_ACODEC_DYNAMIC_LOAD=OFF -DWANT_MP3=OFF -DWANT_PULSEAUDIO=OFF -DWANT_IMAGE=OFF -DWANT_IMAGE_JPG=OFF -DWANT_IMAGE_PNG=OFF \
  63. -DWANT_IMAGE_FREEIMAGE=OFF -DWANT_IMAGE_WEBP=OFF -DWANT_TTF=OFF -DWANT_COLOR=OFF -DWANT_MEMFILE=OFF -DWANT_PHYSFS=OFF \
  64. -DWANT_PRIMITIVES=OFF -DWANT_NATIVE_DIALOG=OFF -DWANT_VIDEO=OFF -DWANT_PYTHON_WRAPPER=OFF -DWANT_LUAJIT=OFF -DWANT_DOCS=OFF \
  65. -DWANT_DOCS_HTML=OFF -DWANT_DOCS_MAN=OFF -DWANT_DOCS_INFO=OFF -DWANT_DOCS_PDF=OFF -DWANT_DOCS_PDF_PAPER=OFF -DWANT_RELEASE_LOGGING=OFF \
  66. -DWANT_DLL_TLS=OFF -DWANT_DEMO=OFF -DWANT_EXAMPLES=OFF -DWANT_POPUP_EXAMPLES=OFF -DWANT_TESTS=OFF -DWANT_WAIT_EVENT_SLEEP=OFF
  67. endif
  68. @make --no-print-directory -s -C allegro5/build all
  69. endif
  70. static-allegro5:
  71. git clone https://github.com/liballeg/allegro5