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

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