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.

1237 lines
58 KiB

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