您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

592 行
20 KiB

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