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.

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