You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1038 lines
48 KiB

преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 2 години
преди 3 години
преди 2 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 2 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 2 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 2 години
преди 1 година
преди 3 години
преди 1 година
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 2 години
преди 1 година
преди 3 години
преди 3 години
преди 1 година
преди 3 години
преди 2 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 1 година
преди 3 години
преди 1 година
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 1 година
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 3 години
преди 2 години
преди 2 години
преди 3 години
  1. #**************************************************************************************************
  2. #
  3. # raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
  4. #
  5. # Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
  6. #
  7. # This software is provided "as-is", without any express or implied warranty. In no event
  8. # will the authors be held liable for any damages arising from the use of this software.
  9. #
  10. # Permission is granted to anyone to use this software for any purpose, including commercial
  11. # applications, and to alter it and redistribute it freely, subject to the following restrictions:
  12. #
  13. # 1. The origin of this software must not be misrepresented; you must not claim that you
  14. # wrote the original software. If you use this software in a product, an acknowledgment
  15. # in the product documentation would be appreciated but is not required.
  16. #
  17. # 2. Altered source versions must be plainly marked as such, and must not be misrepresented
  18. # as being the original software.
  19. #
  20. # 3. This notice may not be removed or altered from any source distribution.
  21. #
  22. #**************************************************************************************************
  23. .PHONY: all clean
  24. # Define required environment variables
  25. #------------------------------------------------------------------------------------------------
  26. # Define target platform: PLATFORM_DESKTOP, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
  27. PLATFORM ?= PLATFORM_WEB
  28. # Define required raylib variables
  29. PROJECT_NAME ?= raylib_examples
  30. RAYLIB_VERSION ?= 4.5.0
  31. RAYLIB_PATH ?= ..
  32. # Locations of raylib.h and libraylib.a/libraylib.so
  33. # NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD
  34. RAYLIB_INCLUDE_PATH ?= /usr/local/include
  35. RAYLIB_LIB_PATH ?= /usr/local/lib
  36. # Library type compilation: STATIC (.a) or SHARED (.so/.dll)
  37. RAYLIB_LIBTYPE ?= STATIC
  38. # Build mode for project: DEBUG or RELEASE
  39. BUILD_MODE ?= RELEASE
  40. # Use external GLFW library instead of rglfw module
  41. USE_EXTERNAL_GLFW ?= FALSE
  42. # Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
  43. # NOTE: This variable is only used for PLATFORM_OS: LINUX
  44. USE_WAYLAND_DISPLAY ?= FALSE
  45. # Determine PLATFORM_OS in case PLATFORM_DESKTOP or PLATFORM_WEB selected
  46. ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_WEB))
  47. # No uname.exe on MinGW!, but OS=Windows_NT on Windows!
  48. # ifeq ($(UNAME),Msys) -> Windows
  49. ifeq ($(OS),Windows_NT)
  50. PLATFORM_OS = WINDOWS
  51. else
  52. UNAMEOS = $(shell uname)
  53. ifeq ($(UNAMEOS),Linux)
  54. PLATFORM_OS = LINUX
  55. endif
  56. ifeq ($(UNAMEOS),FreeBSD)
  57. PLATFORM_OS = BSD
  58. endif
  59. ifeq ($(UNAMEOS),OpenBSD)
  60. PLATFORM_OS = BSD
  61. endif
  62. ifeq ($(UNAMEOS),NetBSD)
  63. PLATFORM_OS = BSD
  64. endif
  65. ifeq ($(UNAMEOS),DragonFly)
  66. PLATFORM_OS = BSD
  67. endif
  68. ifeq ($(UNAMEOS),Darwin)
  69. PLATFORM_OS = OSX
  70. endif
  71. endif
  72. endif
  73. ifeq ($(PLATFORM),PLATFORM_DRM)
  74. UNAMEOS = $(shell uname)
  75. ifeq ($(UNAMEOS),Linux)
  76. PLATFORM_OS = LINUX
  77. endif
  78. endif
  79. # RAYLIB_PATH adjustment for LINUX platform
  80. # TODO: Do we really need this?
  81. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  82. ifeq ($(PLATFORM_OS),LINUX)
  83. RAYLIB_PREFIX ?= ..
  84. RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
  85. endif
  86. endif
  87. # Default path for raylib on Raspberry Pi
  88. ifeq ($(PLATFORM),PLATFORM_DRM)
  89. RAYLIB_PATH ?= /home/pi/raylib
  90. endif
  91. # Define raylib release directory for compiled library
  92. RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
  93. ifeq ($(PLATFORM),PLATFORM_WEB)
  94. ifeq ($(PLATFORM_OS),WINDOWS)
  95. # Emscripten required variables
  96. EMSDK_PATH ?= C:/emsdk
  97. EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten
  98. CLANG_PATH = $(EMSDK_PATH)/upstream/bin
  99. PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit
  100. NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin
  101. export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH)
  102. endif
  103. endif
  104. # Define default C compiler: CC
  105. #------------------------------------------------------------------------------------------------
  106. CC = gcc
  107. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  108. ifeq ($(PLATFORM_OS),OSX)
  109. # OSX default compiler
  110. CC = clang
  111. endif
  112. ifeq ($(PLATFORM_OS),BSD)
  113. # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
  114. CC = clang
  115. endif
  116. endif
  117. ifeq ($(PLATFORM),PLATFORM_WEB)
  118. # HTML5 emscripten compiler
  119. # WARNING: To compile to HTML5, code must be redesigned
  120. # to use emscripten.h and emscripten_set_main_loop()
  121. CC = emcc
  122. endif
  123. # Define default make program: MAKE
  124. #------------------------------------------------------------------------------------------------
  125. MAKE ?= make
  126. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  127. ifeq ($(PLATFORM_OS),WINDOWS)
  128. MAKE = mingw32-make
  129. endif
  130. endif
  131. ifeq ($(PLATFORM),PLATFORM_ANDROID)
  132. MAKE = mingw32-make
  133. endif
  134. ifeq ($(PLATFORM),PLATFORM_WEB)
  135. MAKE = mingw32-make
  136. endif
  137. # Define compiler flags: CFLAGS
  138. #------------------------------------------------------------------------------------------------
  139. # -O1 defines optimization level
  140. # -g include debug information on compilation
  141. # -s strip unnecessary data from build
  142. # -Wall turns on most, but not all, compiler warnings
  143. # -std=c99 defines C language mode (standard C from 1999 revision)
  144. # -std=gnu99 defines C language mode (GNU C from 1999 revision)
  145. # -Wno-missing-braces ignore invalid warning (GCC bug 53119)
  146. # -Wno-unused-value ignore unused return values of some functions (i.e. fread())
  147. # -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
  148. CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result
  149. ifeq ($(BUILD_MODE),DEBUG)
  150. CFLAGS += -g -D_DEBUG
  151. ifeq ($(PLATFORM),PLATFORM_WEB)
  152. CFLAGS += -s ASSERTIONS=1 --profiling
  153. endif
  154. else
  155. ifeq ($(PLATFORM),PLATFORM_WEB)
  156. ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
  157. CFLAGS += -O3
  158. else
  159. CFLAGS += -Os
  160. endif
  161. else
  162. CFLAGS += -s -O2
  163. endif
  164. endif
  165. # Additional flags for compiler (if desired)
  166. # -Wextra enables some extra warning flags that are not enabled by -Wall
  167. # -Wmissing-prototypes warn if a global function is defined without a previous prototype declaration
  168. # -Wstrict-prototypes warn if a function is declared or defined without specifying the argument types
  169. # -Werror=implicit-function-declaration catch function calls without prior declaration
  170. #CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
  171. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  172. ifeq ($(PLATFORM_OS),LINUX)
  173. ifeq ($(RAYLIB_LIBTYPE),STATIC)
  174. CFLAGS += -D_DEFAULT_SOURCE
  175. endif
  176. ifeq ($(RAYLIB_LIBTYPE),SHARED)
  177. # Explicitly enable runtime link to libraylib.so
  178. CFLAGS += -Wl,-rpath,$(RAYLIB_RELEASE_PATH)
  179. endif
  180. endif
  181. endif
  182. ifeq ($(PLATFORM),PLATFORM_DRM)
  183. CFLAGS += -std=gnu99 -DEGL_NO_X11
  184. endif
  185. # Define include paths for required headers: INCLUDE_PATHS
  186. # NOTE: Some external/extras libraries could be required (stb, easings...)
  187. #------------------------------------------------------------------------------------------------
  188. INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external
  189. # Define additional directories containing required header files
  190. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  191. ifeq ($(PLATFORM_OS),BSD)
  192. INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
  193. endif
  194. ifeq ($(PLATFORM_OS),LINUX)
  195. INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
  196. endif
  197. endif
  198. ifeq ($(PLATFORM),PLATFORM_DRM)
  199. INCLUDE_PATHS += -I/usr/include/libdrm
  200. endif
  201. # Define library paths containing required libs: LDFLAGS
  202. #------------------------------------------------------------------------------------------------
  203. LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
  204. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  205. ifeq ($(PLATFORM_OS),WINDOWS)
  206. # NOTE: The resource .rc file contains windows executable icon and properties
  207. LDFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
  208. # -Wl,--subsystem,windows hides the console window
  209. ifeq ($(BUILD_MODE), RELEASE)
  210. LDFLAGS += -Wl,--subsystem,windows
  211. endif
  212. endif
  213. ifeq ($(PLATFORM_OS),LINUX)
  214. LDFLAGS += -L$(RAYLIB_LIB_PATH)
  215. endif
  216. ifeq ($(PLATFORM_OS),BSD)
  217. LDFLAGS += -Lsrc -L$(RAYLIB_LIB_PATH)
  218. endif
  219. endif
  220. ifeq ($(PLATFORM),PLATFORM_WEB)
  221. # -Os # size optimization
  222. # -O2 # optimization level 2, if used, also set --memory-init-file 0
  223. # -s USE_GLFW=3 # Use glfw3 library (context/input management)
  224. # -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
  225. # -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
  226. # -s USE_PTHREADS=1 # multithreading support
  227. # -s WASM=0 # disable Web Assembly, emitted by default
  228. # -s ASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
  229. # -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data
  230. # -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
  231. # -s EXPORTED_RUNTIME_METHODS=ccall # require exporting some LEGACY_RUNTIME functions, ccall() is required by miniaudio
  232. # --profiling # include information for code profiling
  233. # --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
  234. # --preload-file resources # specify a resources folder for data compilation
  235. # --source-map-base # allow debugging in browser with source map
  236. LDFLAGS += -s USE_GLFW=3 -s ASYNCIFY -s EXPORTED_RUNTIME_METHODS=ccall
  237. # NOTE: Simple raylib examples are compiled to be interpreter with asyncify, that way,
  238. # we can compile same code for ALL platforms with no change required, but, working on bigger
  239. # projects, code needs to be refactored to avoid a blocking while() loop, moving Update and Draw
  240. # logic to a self contained function: UpdateDrawFrame(), check core_basic_window_web.c for reference.
  241. # NOTE: Additional compilate flags for TOTAL_MEMORY, FORCE_FILESYSTEM and resources loading
  242. # are specified per-example for optimization
  243. # Define a custom shell .html and output extension
  244. LDFLAGS += --shell-file $(RAYLIB_PATH)/src/shell.html
  245. EXT = .html
  246. endif
  247. # Define libraries required on linking: LDLIBS
  248. # NOTE: To link libraries (lib<name>.so or lib<name>.a), use -l<name>
  249. #------------------------------------------------------------------------------------------------
  250. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  251. ifeq ($(PLATFORM_OS),WINDOWS)
  252. # Libraries for Windows desktop compilation
  253. # NOTE: WinMM library required to set high-res timer resolution
  254. LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
  255. endif
  256. ifeq ($(PLATFORM_OS),LINUX)
  257. # Libraries for Debian GNU/Linux desktop compiling
  258. # NOTE: Required packages: libegl1-mesa-dev
  259. LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt
  260. # On X11 requires also below libraries
  261. LDLIBS += -lX11
  262. # NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
  263. #LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
  264. # On Wayland windowing system, additional libraries requires
  265. ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
  266. LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
  267. endif
  268. # Explicit link to libc
  269. ifeq ($(RAYLIB_LIBTYPE),SHARED)
  270. LDLIBS += -lc
  271. endif
  272. # NOTE: On ARM 32bit arch, miniaudio requires atomics library
  273. LDLIBS += -latomic
  274. endif
  275. ifeq ($(PLATFORM_OS),OSX)
  276. # Libraries for OSX 10.9 desktop compiling
  277. # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
  278. LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo
  279. endif
  280. ifeq ($(PLATFORM_OS),BSD)
  281. # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
  282. # NOTE: Required packages: mesa-libs
  283. LDLIBS = -lraylib -lGL -lpthread -lm
  284. # On XWindow requires also below libraries
  285. LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
  286. endif
  287. ifeq ($(USE_EXTERNAL_GLFW),TRUE)
  288. # NOTE: It could require additional packages installed: libglfw3-dev
  289. LDLIBS += -lglfw
  290. endif
  291. endif
  292. ifeq ($(PLATFORM),PLATFORM_DRM)
  293. # Libraries for DRM compiling
  294. # NOTE: Required packages: libasound2-dev (ALSA)
  295. LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic
  296. endif
  297. ifeq ($(PLATFORM),PLATFORM_WEB)
  298. # Libraries for web (HTML5) compiling
  299. LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a
  300. endif
  301. # Define source code object files required
  302. #------------------------------------------------------------------------------------------------
  303. CORE = \
  304. core/core_basic_window \
  305. core/core_basic_screen_manager \
  306. core/core_input_keys \
  307. core/core_input_mouse \
  308. core/core_input_mouse_wheel \
  309. core/core_input_gamepad \
  310. core/core_input_multitouch \
  311. core/core_input_gestures \
  312. core/core_input_gestures_web \
  313. core/core_2d_camera \
  314. core/core_2d_camera_platformer \
  315. core/core_2d_camera_mouse_zoom \
  316. core/core_2d_camera_split_screen \
  317. core/core_3d_camera_mode \
  318. core/core_3d_camera_free \
  319. core/core_3d_camera_first_person \
  320. core/core_3d_camera_split_screen \
  321. core/core_3d_picking \
  322. core/core_world_screen \
  323. core/core_custom_logging \
  324. core/core_drop_files \
  325. core/core_random_values \
  326. core/core_scissor_test \
  327. core/core_storage_values \
  328. core/core_vr_simulator \
  329. core/core_window_flags \
  330. core/core_window_letterbox \
  331. core/core_window_should_close \
  332. core/core_smooth_pixelperfect \
  333. core/core_custom_frame_control \
  334. core/core_loading_thread
  335. SHAPES = \
  336. shapes/shapes_basic_shapes \
  337. shapes/shapes_bouncing_ball \
  338. shapes/shapes_colors_palette \
  339. shapes/shapes_logo_raylib \
  340. shapes/shapes_logo_raylib_anim \
  341. shapes/shapes_rectangle_scaling \
  342. shapes/shapes_lines_bezier \
  343. shapes/shapes_collision_area \
  344. shapes/shapes_following_eyes \
  345. shapes/shapes_easings_ball_anim \
  346. shapes/shapes_easings_box_anim \
  347. shapes/shapes_easings_rectangle_array \
  348. shapes/shapes_draw_ring \
  349. shapes/shapes_draw_circle_sector \
  350. shapes/shapes_draw_rectangle_rounded \
  351. shapes/shapes_top_down_lights
  352. TEXTURES = \
  353. textures/textures_logo_raylib \
  354. textures/textures_mouse_painting \
  355. textures/textures_srcrec_dstrec \
  356. textures/textures_image_drawing \
  357. textures/textures_image_generation \
  358. textures/textures_image_loading \
  359. textures/textures_image_processing \
  360. textures/textures_image_text \
  361. textures/textures_to_image \
  362. textures/textures_raw_data \
  363. textures/textures_particles_blending \
  364. textures/textures_npatch_drawing \
  365. textures/textures_background_scrolling \
  366. textures/textures_sprite_anim \
  367. textures/textures_sprite_button \
  368. textures/textures_sprite_explosion \
  369. textures/textures_textured_curve \
  370. textures/textures_bunnymark \
  371. textures/textures_blend_modes \
  372. textures/textures_draw_tiled \
  373. textures/textures_polygon \
  374. textures/textures_gif_player \
  375. textures/textures_fog_of_war \
  376. textures/textures_svg_loading
  377. TEXT = \
  378. text/text_raylib_fonts \
  379. text/text_font_spritefont \
  380. text/text_font_loading \
  381. text/text_font_filters \
  382. text/text_font_sdf \
  383. text/text_format_text \
  384. text/text_input_box \
  385. text/text_writing_anim \
  386. text/text_rectangle_bounds \
  387. text/text_unicode \
  388. text/text_draw_3d \
  389. text/text_codepoints_loading
  390. MODELS = \
  391. models/models_animation \
  392. models/models_billboard \
  393. models/models_box_collisions \
  394. models/models_cubicmap \
  395. models/models_draw_cube_texture \
  396. models/models_first_person_maze \
  397. models/models_geometric_shapes \
  398. models/models_mesh_generation \
  399. models/models_mesh_picking \
  400. models/models_loading \
  401. models/models_loading_vox \
  402. models/models_loading_gltf \
  403. models/models_loading_m3d \
  404. models/models_orthographic_projection \
  405. models/models_rlgl_solar_system \
  406. models/models_skybox \
  407. models/models_yaw_pitch_roll \
  408. models/models_heightmap \
  409. models/models_waving_cubes
  410. SHADERS = \
  411. shaders/shaders_model_shader \
  412. shaders/shaders_shapes_textures \
  413. shaders/shaders_custom_uniform \
  414. shaders/shaders_postprocessing \
  415. shaders/shaders_palette_switch \
  416. shaders/shaders_raymarching \
  417. shaders/shaders_texture_drawing \
  418. shaders/shaders_texture_waves \
  419. shaders/shaders_texture_outline \
  420. shaders/shaders_julia_set \
  421. shaders/shaders_eratosthenes \
  422. shaders/shaders_basic_lighting \
  423. shaders/shaders_fog \
  424. shaders/shaders_simple_mask \
  425. shaders/shaders_spotlight \
  426. shaders/shaders_hot_reloading \
  427. shaders/shaders_lightmap \
  428. shaders/shaders_mesh_instancing \
  429. shaders/shaders_multi_sample2d \
  430. shaders/shaders_write_depth \
  431. shaders/shaders_hybrid_render
  432. AUDIO = \
  433. audio/audio_module_playing \
  434. audio/audio_music_stream \
  435. audio/audio_raw_stream \
  436. audio/audio_sound_loading \
  437. audio/audio_stream_effects \
  438. audio/audio_mixed_processor
  439. CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
  440. # Define processes to execute
  441. #------------------------------------------------------------------------------------------------
  442. # Default target entry
  443. all: $(CORE) $(SHAPES) $(TEXT) $(TEXTURES) $(MODELS) $(SHADERS) $(AUDIO)
  444. core: $(CORE)
  445. shapes: $(SHAPES)
  446. textures: $(TEXTURES)
  447. text: $(TEXT)
  448. models: $(MODELS)
  449. shaders: $(SHADERS)
  450. audio: $(AUDIO)
  451. # Compile CORE examples
  452. core/core_basic_window: core/core_basic_window.c
  453. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  454. core/core_basic_screen_manager: core/core_basic_screen_manager.c
  455. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  456. core/core_input_keys: core/core_input_keys.c
  457. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  458. core/core_input_mouse: core/core_input_mouse.c
  459. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  460. core/core_input_mouse_wheel: core/core_input_mouse_wheel.c
  461. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  462. core/core_input_gamepad: core/core_input_gamepad.c
  463. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  464. --preload-file core/resources/ps3.png@resources/ps3.png \
  465. --preload-file core/resources/xbox.png@resources/xbox.png
  466. core/core_input_multitouch: core/core_input_multitouch.c
  467. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  468. core/core_input_gestures: core/core_input_gestures.c
  469. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  470. core/core_input_gestures_web: core/core_input_gestures_web.c
  471. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  472. core/core_2d_camera: core/core_2d_camera.c
  473. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  474. core/core_2d_camera_platformer: core/core_2d_camera_platformer.c
  475. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  476. core/core_2d_camera_mouse_zoom: core/core_2d_camera_mouse_zoom.c
  477. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  478. core/core_2d_camera_split_screen: core/core_2d_camera_split_screen.c
  479. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  480. core/core_3d_camera_mode: core/core_3d_camera_mode.c
  481. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  482. core/core_3d_camera_free: core/core_3d_camera_free.c
  483. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  484. core/core_3d_camera_first_person: core/core_3d_camera_first_person.c
  485. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  486. core/core_3d_camera_split_screen: core/core_3d_camera_split_screen.c
  487. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  488. core/core_3d_picking: core/core_3d_picking.c
  489. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  490. core/core_world_screen: core/core_world_screen.c
  491. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  492. core/core_custom_logging: core/core_custom_logging.c
  493. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  494. core/core_window_letterbox: core/core_window_letterbox.c
  495. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  496. core/core_drop_files: core/core_drop_files.c
  497. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 -s FORCE_FILESYSTEM=1
  498. core/core_random_values: core/core_random_values.c
  499. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  500. core/core_scissor_test: core/core_scissor_test.c
  501. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  502. core/core_storage_values: core/core_storage_values.c
  503. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s FORCE_FILESYSTEM=1
  504. core/core_vr_simulator: core/core_vr_simulator.c
  505. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  506. --preload-file core/resources/distortion100.fs@resources/distortion100.fs
  507. core/core_window_flags: core/core_window_flags.c
  508. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  509. core/core_smooth_pixelperfect: core/core_smooth_pixelperfect.c
  510. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  511. core/core_custom_frame_control: core/core_custom_frame_control.c
  512. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  513. core/core_window_should_close: core/core_window_should_close.c
  514. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  515. # NOTE: To use multi-threading raylib must be compiled with multi-theading support (-s USE_PTHREADS=1)
  516. # WARNING: For security reasons multi-threading is not supported on browsers, it requires cross-origin isolation (Oct.2021)
  517. # WARNING: It requires raylib to be compiled using -pthread, so atomic operations and thread-local data (if any)
  518. # in its source were transformed to non-atomic operations and non-thread-local data
  519. core/core_loading_thread: core/core_loading_thread.c
  520. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s USE_PTHREADS=1
  521. # Compile SHAPES examples
  522. shapes/shapes_basic_shapes: shapes/shapes_basic_shapes.c
  523. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  524. shapes/shapes_bouncing_ball: shapes/shapes_bouncing_ball.c
  525. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  526. shapes/shapes_colors_palette: shapes/shapes_colors_palette.c
  527. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  528. shapes/shapes_logo_raylib: shapes/shapes_logo_raylib.c
  529. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  530. shapes/shapes_logo_raylib_anim: shapes/shapes_logo_raylib_anim.c
  531. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  532. shapes/shapes_rectangle_scaling: shapes/shapes_rectangle_scaling.c
  533. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  534. shapes/shapes_lines_bezier: shapes/shapes_lines_bezier.c
  535. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  536. shapes/shapes_collision_area: shapes/shapes_collision_area.c
  537. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  538. shapes/shapes_following_eyes: shapes/shapes_following_eyes.c
  539. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  540. shapes/shapes_easings_ball_anim: shapes/shapes_easings_ball_anim.c
  541. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  542. shapes/shapes_easings_box_anim: shapes/shapes_easings_box_anim.c
  543. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  544. shapes/shapes_easings_rectangle_array: shapes/shapes_easings_rectangle_array.c
  545. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  546. shapes/shapes_draw_ring: shapes/shapes_draw_ring.c
  547. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  548. shapes/shapes_draw_circle_sector: shapes/shapes_draw_circle_sector.c
  549. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  550. shapes/shapes_draw_rectangle_rounded: shapes/shapes_draw_rectangle_rounded.c
  551. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  552. shapes/shapes_top_down_lights: shapes/shapes_top_down_lights.c
  553. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  554. # Compile TEXTURES examples
  555. textures/textures_logo_raylib: textures/textures_logo_raylib.c
  556. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  557. --preload-file textures/resources/raylib_logo.png@resources/raylib_logo.png
  558. textures/textures_mouse_painting: textures/textures_mouse_painting.c
  559. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  560. textures/textures_sprite_anim: textures/textures_sprite_anim.c
  561. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  562. --preload-file textures/resources/scarfy.png@resources/scarfy.png
  563. textures/textures_srcrec_dstrec: textures/textures_srcrec_dstrec.c
  564. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  565. --preload-file textures/resources/scarfy.png@resources/scarfy.png
  566. textures/textures_image_loading: textures/textures_image_loading.c
  567. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  568. --preload-file textures/resources/raylib_logo.png@resources/raylib_logo.png
  569. textures/textures_image_drawing: textures/textures_image_drawing.c
  570. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  571. --preload-file textures/resources/custom_jupiter_crash.png@resources/custom_jupiter_crash.png \
  572. --preload-file textures/resources/parrots.png@resources/parrots.png \
  573. --preload-file textures/resources/cat.png@resources/cat.png
  574. textures/textures_image_generation: textures/textures_image_generation.c
  575. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864
  576. textures/textures_image_processing: textures/textures_image_processing.c
  577. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  578. --preload-file textures/resources/parrots.png@resources/parrots.png
  579. textures/textures_image_text: textures/textures_image_text.c
  580. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  581. --preload-file textures/resources/parrots.png@resources/parrots.png \
  582. --preload-file textures/resources/KAISG.ttf@resources/KAISG.ttf
  583. textures/textures_to_image: textures/textures_to_image.c
  584. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  585. --preload-file textures/resources/raylib_logo.png@resources/raylib_logo.png
  586. textures/textures_raw_data: textures/textures_raw_data.c
  587. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  588. --preload-file textures/resources/fudesumi.raw@resources/fudesumi.raw
  589. textures/textures_particles_blending: textures/textures_particles_blending.c
  590. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  591. --preload-file textures/resources/spark_flame.png@resources/spark_flame.png
  592. textures/textures_npatch_drawing: textures/textures_npatch_drawing.c
  593. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  594. --preload-file textures/resources/ninepatch_button.png@resources/ninepatch_button.png
  595. textures/textures_background_scrolling: textures/textures_background_scrolling.c
  596. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  597. --preload-file textures/resources/cyberpunk_street_background.png@resources/cyberpunk_street_background.png \
  598. --preload-file textures/resources/cyberpunk_street_midground.png@resources/cyberpunk_street_midground.png \
  599. --preload-file textures/resources/cyberpunk_street_foreground.png@resources/cyberpunk_street_foreground.png
  600. textures/textures_sprite_button: textures/textures_sprite_button.c
  601. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  602. --preload-file textures/resources/button.png@resources/button.png \
  603. --preload-file textures/resources/buttonfx.wav@resources/buttonfx.wav
  604. textures/textures_sprite_explosion: textures/textures_sprite_explosion.c
  605. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  606. --preload-file textures/resources/explosion.png@resources/explosion.png \
  607. --preload-file textures/resources/boom.wav@resources/boom.wav
  608. textures/textures_textured_curve: textures/textures_textured_curve.c
  609. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  610. --preload-file textures/resources/road.png@resources/road.png
  611. textures/textures_bunnymark: textures/textures_bunnymark.c
  612. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  613. --preload-file textures/resources/wabbit_alpha.png@resources/wabbit_alpha.png
  614. textures/textures_blend_modes: textures/textures_blend_modes.c
  615. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  616. --preload-file textures/resources/cyberpunk_street_background.png@resources/cyberpunk_street_background.png \
  617. --preload-file textures/resources/cyberpunk_street_foreground.png@resources/cyberpunk_street_foreground.png
  618. textures/textures_draw_tiled: textures/textures_draw_tiled.c
  619. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  620. --preload-file textures/resources/patterns.png@resources/patterns.png
  621. textures/textures_polygon: textures/textures_polygon.c
  622. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  623. --preload-file textures/resources/cat.png@resources/cat.png
  624. textures/textures_gif_player: textures/textures_gif_player.c
  625. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  626. --preload-file textures/resources/scarfy_run.gif@resources/scarfy_run.gif
  627. textures/textures_fog_of_war: textures/textures_fog_of_war.c
  628. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  629. # Compile TEXT examples
  630. text/text_raylib_fonts: text/text_raylib_fonts.c
  631. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  632. --preload-file text/resources/fonts/alagard.png@resources/fonts/alagard.png \
  633. --preload-file text/resources/fonts/pixelplay.png@resources/fonts/pixelplay.png \
  634. --preload-file text/resources/fonts/mecha.png@resources/fonts/mecha.png \
  635. --preload-file text/resources/fonts/setback.png@resources/fonts/setback.png \
  636. --preload-file text/resources/fonts/romulus.png@resources/fonts/romulus.png \
  637. --preload-file text/resources/fonts/pixantiqua.png@resources/fonts/pixantiqua.png \
  638. --preload-file text/resources/fonts/alpha_beta.png@resources/fonts/alpha_beta.png \
  639. --preload-file text/resources/fonts/jupiter_crash.png@resources/fonts/jupiter_crash.png
  640. text/text_font_spritefont: text/text_font_spritefont.c
  641. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  642. --preload-file text/resources/custom_mecha.png@resources/custom_mecha.png \
  643. --preload-file text/resources/custom_alagard.png@resources/custom_alagard.png \
  644. --preload-file text/resources/custom_jupiter_crash.png@resources/custom_jupiter_crash.png
  645. text/text_font_loading: text/text_font_loading.c
  646. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  647. --preload-file text/resources/pixantiqua.fnt@resources/pixantiqua.fnt \
  648. --preload-file text/resources/pixantiqua.png@resources/pixantiqua.png \
  649. --preload-file text/resources/pixantiqua.ttf@resources/pixantiqua.ttf
  650. text/text_font_filters: text/text_font_filters.c
  651. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  652. --preload-file text/resources/KAISG.ttf@resources/KAISG.ttf
  653. text/text_font_sdf: text/text_font_sdf.c
  654. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  655. --preload-file text/resources/anonymous_pro_bold.ttf@resources/anonymous_pro_bold.ttf \
  656. --preload-file text/resources/shaders/glsl100/sdf.fs@resources/shaders/glsl100/sdf.fs
  657. text/text_format_text: text/text_format_text.c
  658. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  659. text/text_input_box: text/text_input_box.c
  660. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  661. text/text_writing_anim: text/text_writing_anim.c
  662. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  663. text/text_rectangle_bounds: text/text_rectangle_bounds.c
  664. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  665. text/text_unicode: text/text_unicode.c
  666. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  667. --preload-file text/resources/dejavu.fnt@resources/dejavu.fnt \
  668. --preload-file text/resources/dejavu.png@resources/dejavu.png \
  669. --preload-file text/resources/noto_cjk.fnt@resources/noto_cjk.fnt \
  670. --preload-file text/resources/noto_cjk.png@resources/noto_cjk.png \
  671. --preload-file text/resources/symbola.fnt@resources/symbola.fnt \
  672. --preload-file text/resources/symbola.png@resources/symbola.png
  673. text/text_draw_3d: text/text_draw_3d.c
  674. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  675. --preload-file text/resources/shaders/glsl100/alpha_discard.fs@resources/shaders/glsl100/alpha_discard.fs
  676. text/text_codepoints_loading: text/text_codepoints_loading.c
  677. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  678. --preload-file text/resources/DotGothic16-Regular.ttf@resources/DotGothic16-Regular.ttf
  679. # Compile MODELS examples
  680. models/models_animation: models/models_animation.c
  681. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  682. --preload-file models/resources/models/iqm/guy.iqm@resources/models/iqm/guy.iqm \
  683. --preload-file models/resources/models/iqm/guytex.png@resources/models/iqm/guytex.png \
  684. --preload-file models/resources/models/iqm/guyanim.iqm@resources/models/iqm/guyanim.iqm
  685. models/models_billboard: models/models_billboard.c
  686. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  687. --preload-file models/resources/billboard.png@resources/billboard.png
  688. models/models_box_collisions: models/models_box_collisions.c
  689. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  690. models/models_cubicmap: models/models_cubicmap.c
  691. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  692. --preload-file models/resources/cubicmap.png@resources/cubicmap.png \
  693. --preload-file models/resources/cubicmap_atlas.png@resources/cubicmap_atlas.png
  694. models/models_draw_cube_texture: models/models_draw_cube_texture.c
  695. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  696. --preload-file models/resources/cubicmap_atlas.png@resources/cubicmap_atlas.png
  697. models/models_first_person_maze: models/models_first_person_maze.c
  698. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  699. --preload-file models/resources/cubicmap.png@resources/cubicmap.png \
  700. --preload-file models/resources/cubicmap_atlas.png@resources/cubicmap_atlas.png
  701. models/models_geometric_shapes: models/models_geometric_shapes.c
  702. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  703. models/models_mesh_generation: models/models_mesh_generation.c
  704. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  705. models/models_mesh_picking: models/models_mesh_picking.c
  706. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  707. --preload-file models/resources/models/obj/turret.obj@resources/models/obj/turret.obj \
  708. --preload-file models/resources/models/obj/turret_diffuse.png@resources/models/obj/turret_diffuse.png
  709. models/models_loading: models/models_loading.c
  710. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  711. --preload-file models/resources/models/obj/castle.obj@resources/models/obj/castle.obj \
  712. --preload-file models/resources/models/obj/castle_diffuse.png@resources/models/obj/castle_diffuse.png
  713. models/models_loading_vox: models/models_loading_vox.c
  714. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  715. --preload-file models/resources/models/vox/chr_knight.vox@resources/models/vox/chr_knight.vox \
  716. --preload-file models/resources/models/vox/chr_sword.vox@resources/models/vox/chr_sword.vox \
  717. --preload-file models/resources/models/vox/monu9.vox@resources/models/vox/monu9.vox
  718. models/models_loading_gltf: models/models_loading_gltf.c
  719. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  720. --preload-file models/resources/models/gltf/robot.glb@resources/models/gltf/robot.glb
  721. models/models_loading_m3d: models/models_loading_m3d.c
  722. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  723. --preload-file models/resources/models/m3d/cesium_man.m3d@resources/models/m3d/cesium_man.m3d
  724. models/models_orthographic_projection: models/models_orthographic_projection.c
  725. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  726. models/models_rlgl_solar_system: models/models_rlgl_solar_system.c
  727. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  728. models/models_skybox: models/models_skybox.c
  729. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 -s FORCE_FILESYSTEM=1 \
  730. --preload-file models/resources/dresden_square_2k.hdr@resources/dresden_square_2k.hdr \
  731. --preload-file models/resources/shaders/glsl100/skybox.vs@resources/shaders/glsl100/skybox.vs \
  732. --preload-file models/resources/shaders/glsl100/skybox.fs@resources/shaders/glsl100/skybox.fs \
  733. --preload-file models/resources/shaders/glsl100/cubemap.vs@resources/shaders/glsl100/cubemap.vs \
  734. --preload-file models/resources/shaders/glsl100/cubemap.fs@resources/shaders/glsl100/cubemap.fs
  735. models/models_yaw_pitch_roll: models/models_yaw_pitch_roll.c
  736. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  737. --preload-file models/resources/models/obj/plane.obj@resources/models/obj/plane.obj \
  738. --preload-file models/resources/models/obj/plane_diffuse.png@resources/models/obj/plane_diffuse.png
  739. models/models_heightmap: models/models_heightmap.c
  740. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  741. --preload-file models/resources/heightmap.png@resources/heightmap.png
  742. models/models_waving_cubes: models/models_waving_cubes.c
  743. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  744. # Compile SHADER examples
  745. shaders/shaders_model_shader: shaders/shaders_model_shader.c
  746. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  747. --preload-file shaders/resources/models/watermill.obj@resources/models/watermill.obj \
  748. --preload-file shaders/resources/models/watermill_diffuse.png@resources/models/watermill_diffuse.png \
  749. --preload-file shaders/resources/shaders/glsl100/grayscale.fs@resources/shaders/glsl100/grayscale.fs
  750. shaders/shaders_shapes_textures: shaders/shaders_shapes_textures.c
  751. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  752. --preload-file shaders/resources/fudesumi.png@resources/fudesumi.png \
  753. --preload-file shaders/resources/shaders/glsl100/base.vs@resources/shaders/glsl100/base.vs \
  754. --preload-file shaders/resources/shaders/glsl100/grayscale.fs@resources/shaders/glsl100/grayscale.fs
  755. shaders/shaders_custom_uniform: shaders/shaders_custom_uniform.c
  756. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  757. --preload-file shaders/resources/models/barracks.obj@resources/models/barracks.obj \
  758. --preload-file shaders/resources/models/barracks_diffuse.png@resources/models/barracks_diffuse.png \
  759. --preload-file shaders/resources/shaders/glsl100/swirl.fs@resources/shaders/glsl100/swirl.fs
  760. shaders/shaders_postprocessing: shaders/shaders_postprocessing.c
  761. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  762. --preload-file shaders/resources/models/church.obj@resources/models/church.obj \
  763. --preload-file shaders/resources/models/church_diffuse.png@resources/models/church_diffuse.png \
  764. --preload-file shaders/resources/shaders/glsl100@resources/shaders/glsl100
  765. shaders/shaders_palette_switch: shaders/shaders_palette_switch.c
  766. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  767. --preload-file shaders/resources/shaders/glsl100/palette_switch.fs@resources/shaders/glsl100/palette_switch.fs
  768. shaders/shaders_raymarching: shaders/shaders_raymarching.c
  769. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  770. --preload-file shaders/resources/shaders/glsl100/raymarching.fs@resources/shaders/glsl100/raymarching.fs
  771. shaders/shaders_texture_drawing: shaders/shaders_texture_drawing.c
  772. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  773. --preload-file shaders/resources/shaders/glsl100/cubes_panning.fs@resources/shaders/glsl100/cubes_panning.fs
  774. shaders/shaders_texture_waves: shaders/shaders_texture_waves.c
  775. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  776. --preload-file shaders/resources/space.png@resources/space.png \
  777. --preload-file shaders/resources/shaders/glsl100/wave.fs@resources/shaders/glsl100/wave.fs
  778. shaders/shaders_julia_set: shaders/shaders_julia_set.c
  779. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  780. --preload-file shaders/resources/shaders/glsl100/julia_set.fs@resources/shaders/glsl100/julia_set.fs
  781. shaders/shaders_eratosthenes: shaders/shaders_eratosthenes.c
  782. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  783. --preload-file shaders/resources/shaders/glsl100/eratosthenes.fs@resources/shaders/glsl100/eratosthenes.fs
  784. shaders/shaders_basic_lighting: shaders/shaders_basic_lighting.c
  785. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  786. --preload-file shaders/resources/texel_checker.png@resources/texel_checker.png \
  787. --preload-file shaders/resources/shaders/glsl100/lighting.fs@resources/shaders/glsl100/lighting.fs \
  788. --preload-file shaders/resources/shaders/glsl100/lighting.vs@resources/shaders/glsl100/lighting.vs
  789. shaders/shaders_fog: shaders/shaders_fog.c
  790. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  791. --preload-file shaders/resources/texel_checker.png@resources/texel_checker.png \
  792. --preload-file shaders/resources/shaders/glsl100/fog.fs@resources/shaders/glsl100/fog.fs \
  793. --preload-file shaders/resources/shaders/glsl100/lighting.vs@resources/shaders/glsl100/lighting.vs
  794. shaders/shaders_simple_mask: shaders/shaders_simple_mask.c
  795. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  796. --preload-file shaders/resources/plasma.png@resources/plasma.png \
  797. --preload-file shaders/resources/mask.png@resources/mask.png \
  798. --preload-file shaders/resources/shaders/glsl100/mask.fs@resources/shaders/glsl100/mask.fs
  799. shaders/shaders_spotlight: shaders/shaders_spotlight.c
  800. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  801. --preload-file shaders/resources/raysan.png@resources/raysan.png \
  802. --preload-file shaders/resources/shaders/glsl100/spotlight.fs@resources/shaders/glsl100/spotlight.fs
  803. shaders/shaders_hot_reloading: shaders/shaders_hot_reloading.c
  804. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s FORCE_FILESYSTEM=1 \
  805. --preload-file shaders/resources/shaders/glsl100/reload.fs@resources/shaders/glsl100/reload.fs
  806. shaders/shaders_mesh_instancing: shaders/shaders_mesh_instancing.c
  807. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  808. --preload-file shaders/resources/shaders/glsl100/lighting_instancing.vs@resources/shaders/glsl100/lighting_instancing.vs \
  809. --preload-file shaders/resources/shaders/glsl100/lighting.fs@resources/shaders/glsl100/lighting.fs
  810. shaders/shaders_multi_sample2d: shaders/shaders_multi_sample2d.c
  811. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  812. --preload-file shaders/resources/shaders/glsl100/color_mix.fs@resources/shaders/glsl100/color_mix.fs
  813. shaders/shaders_texture_outline: shaders/shaders_texture_outline.c
  814. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  815. --preload-file shaders/resources/shaders/glsl100/outline.fs@resources/shaders/glsl100/outline.fs \
  816. --preload-file shaders/resources/fudesumi.png@resources/fudesumi.png
  817. shaders/shaders_write_depth: shaders/shaders_write_depth.c
  818. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  819. --preload-file shaders/resources/shaders/glsl100/write_depth.fs@resources/shaders/glsl100/write_depth.fs
  820. shaders/shaders_hybrid_render: shaders/shaders_hybrid_render.c
  821. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  822. --preload-file shaders/resources/shaders/glsl100/hybrid_raymarch.fs@resources/shaders/glsl100/hybrid_raymarch.fs \
  823. --preload-file shaders/resources/shaders/glsl100/hybrid_raster.fs@resources/shaders/glsl100/hybrid_raster.fs
  824. # Compile AUDIO examples
  825. audio/audio_module_playing: audio/audio_module_playing.c
  826. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  827. --preload-file audio/resources/mini1111.xm@resources/mini1111.xm
  828. audio/audio_music_stream: audio/audio_music_stream.c
  829. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  830. --preload-file audio/resources/country.mp3@resources/country.mp3
  831. audio/audio_raw_stream: audio/audio_raw_stream.c
  832. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864
  833. audio/audio_sound_loading: audio/audio_sound_loading.c
  834. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
  835. --preload-file audio/resources/sound.wav@resources/sound.wav \
  836. --preload-file audio/resources/target.ogg@resources/target.ogg
  837. audio/audio_stream_effects: audio/audio_stream_effects.c
  838. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  839. --preload-file audio/resources/country.mp3@resources/country.mp3
  840. audio/audio_mixed_processor: audio/audio_mixed_processor.c
  841. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
  842. --preload-file audio/resources/country.mp3@resources/country.mp3 \
  843. --preload-file audio/resources/coin.wav@resources/coin.wav
  844. # Clean everything
  845. clean:
  846. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  847. ifeq ($(PLATFORM_OS),WINDOWS)
  848. del *.o *.exe /s
  849. endif
  850. ifeq ($(PLATFORM_OS),LINUX)
  851. find . -type f -executable -delete
  852. rm -fv *.o
  853. endif
  854. ifeq ($(PLATFORM_OS),OSX)
  855. find . -type f -perm +ugo+x -delete
  856. rm -f *.o
  857. endif
  858. endif
  859. ifeq ($(PLATFORM),PLATFORM_DRM)
  860. find . -type f -executable -delete
  861. rm -fv *.o
  862. endif
  863. ifeq ($(PLATFORM),PLATFORM_WEB)
  864. del *.o *.html *.js
  865. endif
  866. @echo Cleaning done