Makefile 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. #**************************************************************************************************
  2. #
  3. # raylib makefile for multiple platforms
  4. #
  5. # This file supports building raylib examples for the following platforms:
  6. #
  7. # > PLATFORM_DESKTOP (GLFW backend):
  8. # - Windows (Win32, Win64)
  9. # - Linux (X11/Wayland desktop mode)
  10. # - macOS/OSX (x64, arm64)
  11. # - FreeBSD, OpenBSD, NetBSD, DragonFly (X11 desktop)
  12. # > PLATFORM_DESKTOP_SDL (SDL backend):
  13. # - Windows (Win32, Win64)
  14. # - Linux (X11/Wayland desktop mode)
  15. # - Others (not tested)
  16. # > PLATFORM_WEB:
  17. # - HTML5 (WebAssembly)
  18. # > PLATFORM_DRM:
  19. # - Raspberry Pi 0-5 (DRM/KMS)
  20. # - Linux DRM subsystem (KMS mode)
  21. # > PLATFORM_ANDROID:
  22. # - Android (ARM, ARM64)
  23. #
  24. # Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
  25. #
  26. # This software is provided "as-is", without any express or implied warranty. In no event
  27. # will the authors be held liable for any damages arising from the use of this software.
  28. #
  29. # Permission is granted to anyone to use this software for any purpose, including commercial
  30. # applications, and to alter it and redistribute it freely, subject to the following restrictions:
  31. #
  32. # 1. The origin of this software must not be misrepresented; you must not claim that you
  33. # wrote the original software. If you use this software in a product, an acknowledgment
  34. # in the product documentation would be appreciated but is not required.
  35. #
  36. # 2. Altered source versions must be plainly marked as such, and must not be misrepresented
  37. # as being the original software.
  38. #
  39. # 3. This notice may not be removed or altered from any source distribution.
  40. #
  41. #**************************************************************************************************
  42. .PHONY: all clean
  43. # Define required environment variables
  44. #------------------------------------------------------------------------------------------------
  45. # Define target platform: PLATFORM_DESKTOP, PLATFORM_DESKTOP_SDL, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
  46. PLATFORM ?= PLATFORM_DESKTOP
  47. # Define required raylib variables
  48. PROJECT_NAME ?= raylib_examples
  49. RAYLIB_VERSION ?= 5.0.0
  50. RAYLIB_PATH ?= ..
  51. # Define raylib source code path
  52. RAYLIB_SRC_PATH ?= ../src
  53. # Locations of raylib.h and libraylib.a/libraylib.so
  54. # NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD
  55. RAYLIB_INCLUDE_PATH ?= /usr/local/include
  56. RAYLIB_LIB_PATH ?= /usr/local/lib
  57. # Library type compilation: STATIC (.a) or SHARED (.so/.dll)
  58. RAYLIB_LIBTYPE ?= STATIC
  59. # Build mode for project: DEBUG or RELEASE
  60. BUILD_MODE ?= RELEASE
  61. # Use external GLFW library instead of rglfw module
  62. USE_EXTERNAL_GLFW ?= FALSE
  63. # PLATFORM_DESKTOP_SDL: It requires SDL library to be provided externally
  64. # WARNING: Library is not included in raylib, it MUST be configured by users
  65. SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2-2.28.4/include
  66. SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2-2.28.4/lib/x64
  67. # Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
  68. # NOTE: This variable is only used for PLATFORM_OS: LINUX
  69. USE_WAYLAND_DISPLAY ?= FALSE
  70. # PLATFORM_WEB: Default properties
  71. BUILD_WEB_ASYNCIFY ?= TRUE
  72. BUILD_WEB_SHELL ?= $(RAYLIB_PATH)/src/minshell.html
  73. BUILD_WEB_HEAP_SIZE ?= 134217728
  74. BUILD_WEB_RESOURCES ?= TRUE
  75. BUILD_WEB_RESOURCES_PATH ?= $(dir $<)resources@resources
  76. # Determine PLATFORM_OS when required
  77. ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_DESKTOP_SDL PLATFORM_WEB))
  78. # No uname.exe on MinGW!, but OS=Windows_NT on Windows!
  79. # ifeq ($(UNAME),Msys) -> Windows
  80. ifeq ($(OS),Windows_NT)
  81. PLATFORM_OS = WINDOWS
  82. else
  83. UNAMEOS = $(shell uname)
  84. ifeq ($(UNAMEOS),Linux)
  85. PLATFORM_OS = LINUX
  86. endif
  87. ifeq ($(UNAMEOS),FreeBSD)
  88. PLATFORM_OS = BSD
  89. endif
  90. ifeq ($(UNAMEOS),OpenBSD)
  91. PLATFORM_OS = BSD
  92. endif
  93. ifeq ($(UNAMEOS),NetBSD)
  94. PLATFORM_OS = BSD
  95. endif
  96. ifeq ($(UNAMEOS),DragonFly)
  97. PLATFORM_OS = BSD
  98. endif
  99. ifeq ($(UNAMEOS),Darwin)
  100. PLATFORM_OS = OSX
  101. endif
  102. endif
  103. endif
  104. ifeq ($(PLATFORM),PLATFORM_DRM)
  105. UNAMEOS = $(shell uname)
  106. ifeq ($(UNAMEOS),Linux)
  107. PLATFORM_OS = LINUX
  108. endif
  109. endif
  110. # RAYLIB_PATH adjustment for LINUX platform
  111. # TODO: Do we really need this?
  112. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  113. ifeq ($(PLATFORM_OS),LINUX)
  114. RAYLIB_PREFIX ?= ..
  115. RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
  116. endif
  117. endif
  118. # Default path for raylib on Raspberry Pi
  119. ifeq ($(PLATFORM),PLATFORM_DRM)
  120. RAYLIB_PATH ?= /home/pi/raylib
  121. endif
  122. # Define raylib release directory for compiled library
  123. RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
  124. ifeq ($(PLATFORM),PLATFORM_WEB)
  125. ifeq ($(PLATFORM_OS),WINDOWS)
  126. # Emscripten required variables
  127. EMSDK_PATH ?= C:/emsdk
  128. EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten
  129. CLANG_PATH = $(EMSDK_PATH)/upstream/bin
  130. PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit
  131. NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin
  132. export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH)
  133. endif
  134. endif
  135. # Define default C compiler: CC
  136. #------------------------------------------------------------------------------------------------
  137. CC = gcc
  138. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  139. ifeq ($(PLATFORM_OS),OSX)
  140. # OSX default compiler
  141. CC = clang
  142. endif
  143. ifeq ($(PLATFORM_OS),BSD)
  144. # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
  145. CC = clang
  146. endif
  147. endif
  148. ifeq ($(PLATFORM),PLATFORM_WEB)
  149. # HTML5 emscripten compiler
  150. # WARNING: To compile to HTML5, code must be redesigned
  151. # to use emscripten.h and emscripten_set_main_loop()
  152. CC = emcc
  153. endif
  154. # Define default make program: MAKE
  155. #------------------------------------------------------------------------------------------------
  156. MAKE ?= make
  157. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  158. ifeq ($(PLATFORM_OS),WINDOWS)
  159. MAKE = mingw32-make
  160. endif
  161. endif
  162. ifeq ($(PLATFORM),PLATFORM_ANDROID)
  163. MAKE = mingw32-make
  164. endif
  165. ifeq ($(PLATFORM),PLATFORM_WEB)
  166. MAKE = emmake make
  167. endif
  168. # Define compiler flags: CFLAGS
  169. #------------------------------------------------------------------------------------------------
  170. # -O1 defines optimization level
  171. # -g include debug information on compilation
  172. # -s strip unnecessary data from build
  173. # -Wall turns on most, but not all, compiler warnings
  174. # -std=c99 defines C language mode (standard C from 1999 revision)
  175. # -std=gnu99 defines C language mode (GNU C from 1999 revision)
  176. # -Wno-missing-braces ignore invalid warning (GCC bug 53119)
  177. # -Wno-unused-value ignore unused return values of some functions (i.e. fread())
  178. # -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
  179. CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result
  180. ifeq ($(BUILD_MODE),DEBUG)
  181. CFLAGS += -g -D_DEBUG
  182. ifeq ($(PLATFORM),PLATFORM_WEB)
  183. CFLAGS += -s ASSERTIONS=1 --profiling
  184. endif
  185. else
  186. ifeq ($(PLATFORM),PLATFORM_WEB)
  187. ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
  188. CFLAGS += -O3
  189. else
  190. CFLAGS += -Os
  191. endif
  192. else
  193. CFLAGS += -O2
  194. endif
  195. endif
  196. # Additional flags for compiler (if desired)
  197. # -Wextra enables some extra warning flags that are not enabled by -Wall
  198. # -Wmissing-prototypes warn if a global function is defined without a previous prototype declaration
  199. # -Wstrict-prototypes warn if a function is declared or defined without specifying the argument types
  200. # -Werror=implicit-function-declaration catch function calls without prior declaration
  201. #CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
  202. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  203. ifeq ($(PLATFORM_OS),LINUX)
  204. ifeq ($(RAYLIB_LIBTYPE),STATIC)
  205. CFLAGS += -D_DEFAULT_SOURCE
  206. endif
  207. ifeq ($(RAYLIB_LIBTYPE),SHARED)
  208. # Explicitly enable runtime link to libraylib.so
  209. CFLAGS += -Wl,-rpath,$(RAYLIB_RELEASE_PATH)
  210. endif
  211. endif
  212. endif
  213. ifeq ($(PLATFORM),PLATFORM_DRM)
  214. CFLAGS += -std=gnu99 -DEGL_NO_X11
  215. endif
  216. # Define include paths for required headers: INCLUDE_PATHS
  217. # NOTE: Some external/extras libraries could be required (stb, easings...)
  218. #------------------------------------------------------------------------------------------------
  219. INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external
  220. # Define additional directories containing required header files
  221. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  222. ifeq ($(PLATFORM_OS),BSD)
  223. INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
  224. endif
  225. ifeq ($(PLATFORM_OS),LINUX)
  226. INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
  227. endif
  228. endif
  229. ifeq ($(PLATFORM),PLATFORM_DESKTOP_SDL)
  230. INCLUDE_PATHS += -I$(SDL_INCLUDE_PATH)
  231. endif
  232. ifeq ($(PLATFORM),PLATFORM_DRM)
  233. INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
  234. INCLUDE_PATHS += -I/usr/include/libdrm
  235. endif
  236. # Include GLFW required for examples/others/rlgl_standalone.c
  237. ifeq ($(USE_EXTERNAL_GLFW),FALSE)
  238. all others: INCLUDE_PATHS += -I$(RAYLIB_PATH)/src/external/glfw/include
  239. endif
  240. # Define library paths containing required libs: LDFLAGS
  241. #------------------------------------------------------------------------------------------------
  242. LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
  243. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  244. ifeq ($(PLATFORM_OS),WINDOWS)
  245. # NOTE: The resource .rc file contains windows executable icon and properties
  246. LDFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
  247. # -Wl,--subsystem,windows hides the console window
  248. ifeq ($(BUILD_MODE), RELEASE)
  249. LDFLAGS += -Wl,--subsystem,windows
  250. endif
  251. endif
  252. ifeq ($(PLATFORM_OS),LINUX)
  253. LDFLAGS += -L$(RAYLIB_LIB_PATH)
  254. endif
  255. ifeq ($(PLATFORM_OS),BSD)
  256. LDFLAGS += -Lsrc -L$(RAYLIB_LIB_PATH)
  257. endif
  258. endif
  259. ifeq ($(PLATFORM),PLATFORM_DESKTOP_SDL)
  260. ifeq ($(PLATFORM_OS),WINDOWS)
  261. # NOTE: The resource .rc file contains windows executable icon and properties
  262. LDFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
  263. # -Wl,--subsystem,windows hides the console window
  264. ifeq ($(BUILD_MODE), RELEASE)
  265. LDFLAGS += -Wl,--subsystem,windows
  266. endif
  267. endif
  268. LDFLAGS += -L$(SDL_LIBRARY_PATH)
  269. endif
  270. ifeq ($(PLATFORM),PLATFORM_WEB)
  271. # -Os # size optimization
  272. # -O2 # optimization level 2, if used, also set --memory-init-file 0
  273. # -s USE_GLFW=3 # Use glfw3 library (context/input management)
  274. # -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
  275. # -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
  276. # -s USE_PTHREADS=1 # multithreading support
  277. # -s WASM=0 # disable Web Assembly, emitted by default
  278. # -s ASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
  279. # -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data
  280. # -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
  281. # --profiling # include information for code profiling
  282. # --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
  283. # --preload-file resources # specify a resources folder for data compilation
  284. # --source-map-base # allow debugging in browser with source map
  285. LDFLAGS += -s USE_GLFW=3 -s TOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -s FORCE_FILESYSTEM=1
  286. # Build using asyncify
  287. ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
  288. LDFLAGS += -s ASYNCIFY
  289. endif
  290. # Add resources building if required
  291. ifeq ($(BUILD_WEB_RESOURCES),TRUE)
  292. LDFLAGS += --preload-file $(BUILD_WEB_RESOURCES_PATH)
  293. endif
  294. # Add debug mode flags if required
  295. ifeq ($(BUILD_MODE),DEBUG)
  296. LDFLAGS += -s ASSERTIONS=1 --profiling
  297. endif
  298. # Define a custom shell .html and output extension
  299. LDFLAGS += --shell-file $(BUILD_WEB_SHELL)
  300. EXT = .html
  301. # NOTE: Simple raylib examples are compiled to be interpreter with asyncify, that way,
  302. # we can compile same code for ALL platforms with no change required, but, working on bigger
  303. # projects, code needs to be refactored to avoid a blocking while() loop, moving Update and Draw
  304. # logic to a self contained function: UpdateDrawFrame(), check core_basic_window_web.c for reference.
  305. endif
  306. # Define libraries required on linking: LDLIBS
  307. # NOTE: To link libraries (lib<name>.so or lib<name>.a), use -l<name>
  308. #------------------------------------------------------------------------------------------------
  309. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  310. ifeq ($(PLATFORM_OS),WINDOWS)
  311. # Libraries for Windows desktop compilation
  312. # NOTE: WinMM library required to set high-res timer resolution
  313. LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
  314. endif
  315. ifeq ($(PLATFORM_OS),LINUX)
  316. # Libraries for Debian GNU/Linux desktop compiling
  317. # NOTE: Required packages: libegl1-mesa-dev
  318. LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt
  319. # On X11 requires also below libraries
  320. LDLIBS += -lX11
  321. # NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
  322. #LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
  323. # On Wayland windowing system, additional libraries requires
  324. ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
  325. LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
  326. endif
  327. # Explicit link to libc
  328. ifeq ($(RAYLIB_LIBTYPE),SHARED)
  329. LDLIBS += -lc
  330. endif
  331. # NOTE: On ARM 32bit arch, miniaudio requires atomics library
  332. LDLIBS += -latomic
  333. endif
  334. ifeq ($(PLATFORM_OS),OSX)
  335. # Libraries for OSX 10.9 desktop compiling
  336. # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
  337. LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo
  338. endif
  339. ifeq ($(PLATFORM_OS),BSD)
  340. # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
  341. # NOTE: Required packages: mesa-libs
  342. LDLIBS = -lraylib -lGL -lpthread -lm
  343. # On XWindow requires also below libraries
  344. LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
  345. endif
  346. ifeq ($(USE_EXTERNAL_GLFW),TRUE)
  347. # NOTE: It could require additional packages installed: libglfw3-dev
  348. LDLIBS += -lglfw
  349. endif
  350. endif
  351. ifeq ($(PLATFORM),PLATFORM_DESKTOP_SDL)
  352. ifeq ($(PLATFORM_OS),WINDOWS)
  353. # Libraries for Windows desktop compilation
  354. LDLIBS = -lraylib -lSDL2 -lSDL2main -lopengl32 -lgdi32
  355. endif
  356. ifeq ($(PLATFORM_OS),LINUX)
  357. # Libraries for Debian GNU/Linux desktop compiling
  358. # NOTE: Required packages: libegl1-mesa-dev
  359. LDLIBS = -lraylib -lSDL2 -lSDL2main -lGL -lm -lpthread -ldl -lrt
  360. # On X11 requires also below libraries
  361. LDLIBS += -lX11
  362. # NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
  363. #LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
  364. # On Wayland windowing system, additional libraries requires
  365. ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
  366. LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
  367. endif
  368. # Explicit link to libc
  369. ifeq ($(RAYLIB_LIBTYPE),SHARED)
  370. LDLIBS += -lc
  371. endif
  372. # NOTE: On ARM 32bit arch, miniaudio requires atomics library
  373. LDLIBS += -latomic
  374. endif
  375. endif
  376. ifeq ($(PLATFORM),PLATFORM_DRM)
  377. # Libraries for DRM compiling
  378. # NOTE: Required packages: libasound2-dev (ALSA)
  379. LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic
  380. endif
  381. ifeq ($(PLATFORM),PLATFORM_WEB)
  382. # Libraries for web (HTML5) compiling
  383. LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a
  384. endif
  385. # Define source code object files required
  386. #------------------------------------------------------------------------------------------------
  387. CORE = \
  388. core/core_2d_camera \
  389. core/core_2d_camera_mouse_zoom \
  390. core/core_2d_camera_platformer \
  391. core/core_2d_camera_split_screen \
  392. core/core_3d_camera_first_person \
  393. core/core_3d_camera_free \
  394. core/core_3d_camera_mode \
  395. core/core_3d_camera_split_screen \
  396. core/core_3d_picking \
  397. core/core_automation_events \
  398. core/core_basic_screen_manager \
  399. core/core_basic_window \
  400. core/core_custom_frame_control \
  401. core/core_custom_logging \
  402. core/core_drop_files \
  403. core/core_input_gamepad \
  404. core/core_input_gamepad_info \
  405. core/core_input_gestures \
  406. core/core_input_gestures_web \
  407. core/core_input_keys \
  408. core/core_input_mouse \
  409. core/core_input_mouse_wheel \
  410. core/core_input_multitouch \
  411. core/core_loading_thread \
  412. core/core_random_values \
  413. core/core_scissor_test \
  414. core/core_smooth_pixelperfect \
  415. core/core_storage_values \
  416. core/core_vr_simulator \
  417. core/core_window_flags \
  418. core/core_window_letterbox \
  419. core/core_window_should_close \
  420. core/core_world_screen
  421. SHAPES = \
  422. shapes/shapes_basic_shapes \
  423. shapes/shapes_bouncing_ball \
  424. shapes/shapes_collision_area \
  425. shapes/shapes_colors_palette \
  426. shapes/shapes_draw_circle_sector \
  427. shapes/shapes_draw_rectangle_rounded \
  428. shapes/shapes_draw_ring \
  429. shapes/shapes_easings_ball_anim \
  430. shapes/shapes_easings_box_anim \
  431. shapes/shapes_easings_rectangle_array \
  432. shapes/shapes_following_eyes \
  433. shapes/shapes_lines_bezier \
  434. shapes/shapes_logo_raylib \
  435. shapes/shapes_logo_raylib_anim \
  436. shapes/shapes_rectangle_scaling \
  437. shapes/shapes_splines_drawing \
  438. shapes/shapes_top_down_lights
  439. TEXTURES = \
  440. textures/textures_background_scrolling \
  441. textures/textures_blend_modes \
  442. textures/textures_bunnymark \
  443. textures/textures_draw_tiled \
  444. textures/textures_fog_of_war \
  445. textures/textures_gif_player \
  446. textures/textures_image_drawing \
  447. textures/textures_image_generation \
  448. textures/textures_image_kernel \
  449. textures/textures_image_loading \
  450. textures/textures_image_processing \
  451. textures/textures_image_rotate \
  452. textures/textures_image_text \
  453. textures/textures_logo_raylib \
  454. textures/textures_mouse_painting \
  455. textures/textures_npatch_drawing \
  456. textures/textures_particles_blending \
  457. textures/textures_polygon \
  458. textures/textures_raw_data \
  459. textures/textures_sprite_anim \
  460. textures/textures_sprite_button \
  461. textures/textures_sprite_explosion \
  462. textures/textures_srcrec_dstrec \
  463. textures/textures_svg_loading \
  464. textures/textures_textured_curve \
  465. textures/textures_to_image
  466. TEXT = \
  467. text/text_codepoints_loading \
  468. text/text_draw_3d \
  469. text/text_font_filters \
  470. text/text_font_loading \
  471. text/text_font_sdf \
  472. text/text_font_spritefont \
  473. text/text_format_text \
  474. text/text_input_box \
  475. text/text_raylib_fonts \
  476. text/text_rectangle_bounds \
  477. text/text_unicode \
  478. text/text_writing_anim
  479. MODELS = \
  480. models/models_animation \
  481. models/models_billboard \
  482. models/models_box_collisions \
  483. models/models_cubicmap \
  484. models/models_draw_cube_texture \
  485. models/models_first_person_maze \
  486. models/models_geometric_shapes \
  487. models/models_heightmap \
  488. models/models_loading \
  489. models/models_loading_gltf \
  490. models/models_loading_m3d \
  491. models/models_loading_vox \
  492. models/models_mesh_generation \
  493. models/models_mesh_picking \
  494. models/models_orthographic_projection \
  495. models/models_rlgl_solar_system \
  496. models/models_skybox \
  497. models/models_waving_cubes \
  498. models/models_yaw_pitch_roll
  499. SHADERS = \
  500. shaders/shaders_basic_lighting \
  501. shaders/shaders_custom_uniform \
  502. shaders/shaders_deferred_render \
  503. shaders/shaders_eratosthenes \
  504. shaders/shaders_fog \
  505. shaders/shaders_hot_reloading \
  506. shaders/shaders_hybrid_render \
  507. shaders/shaders_julia_set \
  508. shaders/shaders_lightmap \
  509. shaders/shaders_mesh_instancing \
  510. shaders/shaders_model_shader \
  511. shaders/shaders_multi_sample2d \
  512. shaders/shaders_palette_switch \
  513. shaders/shaders_postprocessing \
  514. shaders/shaders_raymarching \
  515. shaders/shaders_shadowmap \
  516. shaders/shaders_shapes_textures \
  517. shaders/shaders_simple_mask \
  518. shaders/shaders_spotlight \
  519. shaders/shaders_texture_drawing \
  520. shaders/shaders_texture_outline \
  521. shaders/shaders_texture_tiling \
  522. shaders/shaders_texture_waves \
  523. shaders/shaders_write_depth
  524. AUDIO = \
  525. audio/audio_mixed_processor \
  526. audio/audio_module_playing \
  527. audio/audio_music_stream \
  528. audio/audio_raw_stream \
  529. audio/audio_sound_loading \
  530. audio/audio_sound_multi \
  531. audio/audio_stream_effects
  532. OTHERS = \
  533. others/easings_testbed \
  534. others/embedded_files_loading \
  535. others/raylib_opengl_interop \
  536. others/raymath_vector_angle \
  537. others/rlgl_compute_shader \
  538. others/rlgl_standalone
  539. CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
  540. # Define processes to execute
  541. #------------------------------------------------------------------------------------------------
  542. # Default target entry
  543. all: $(CORE) $(SHAPES) $(TEXT) $(TEXTURES) $(MODELS) $(SHADERS) $(AUDIO) $(OTHERS)
  544. core: $(CORE)
  545. shapes: $(SHAPES)
  546. textures: $(TEXTURES)
  547. text: $(TEXT)
  548. models: $(MODELS)
  549. shaders: $(SHADERS)
  550. audio: $(AUDIO)
  551. others: $(OTHERS)
  552. # Generic compilation pattern
  553. # NOTE: Examples must be ready for Android compilation!
  554. %: %.c
  555. ifeq ($(PLATFORM),PLATFORM_ANDROID)
  556. $(MAKE) -f Makefile.Android PROJECT_NAME=$@ PROJECT_SOURCE_FILES=$<
  557. else ifeq ($(PLATFORM),PLATFORM_WEB)
  558. $(MAKE) -f Makefile.Web $@
  559. else
  560. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  561. endif
  562. # Clean everything
  563. clean:
  564. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  565. ifeq ($(PLATFORM_OS),WINDOWS)
  566. del *.o *.exe /s
  567. endif
  568. ifeq ($(PLATFORM_OS),LINUX)
  569. find . -type f -executable -delete
  570. rm -fv *.o
  571. endif
  572. ifeq ($(PLATFORM_OS),OSX)
  573. find . -type f -perm +ugo+x -delete
  574. rm -f *.o
  575. endif
  576. endif
  577. ifeq ($(PLATFORM),PLATFORM_DRM)
  578. find . -type f -executable -delete
  579. rm -fv *.o
  580. endif
  581. ifeq ($(PLATFORM),PLATFORM_WEB)
  582. ifeq ($(PLATFORM_OS),WINDOWS)
  583. del *.wasm *.html *.js *.data
  584. else
  585. rm -f */*.wasm */*.html */*.js */*.data
  586. endif
  587. endif
  588. @echo Cleaning done