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.

564 lines
20 KiB

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