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.

1045 lines
48 KiB

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