Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

487 linhas
19 KiB

7 anos atrás
7 anos atrás
5 anos atrás
7 anos atrás
6 anos atrás
6 anos atrás
6 anos atrás
7 anos atrás
7 anos atrás
7 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
7 anos atrás
5 anos atrás
7 anos atrás
7 anos atrás
7 anos atrás
5 anos atrás
5 anos atrás
7 anos atrás
5 anos atrás
5 anos atrás
7 anos atrás
7 anos atrás
5 anos atrás
7 anos atrás
7 anos atrás
7 anos atrás
5 anos atrás
7 anos atrás
7 anos atrás
7 anos atrás
7 anos atrás
7 anos atrás
5 anos atrás
7 anos atrás
7 anos atrás
7 anos atrás
7 anos atrás
5 anos atrás
5 anos atrás
  1. #**************************************************************************************************
  2. #
  3. # raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
  4. #
  5. # Copyright (c) 2013-2019 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 raylib variables
  25. PROJECT_NAME ?= raylib_examples
  26. RAYLIB_VERSION ?= 2.5.0
  27. RAYLIB_API_VERSION ?= 2
  28. RAYLIB_PATH ?= ..
  29. # Define default options
  30. # One of PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
  31. PLATFORM ?= PLATFORM_DESKTOP
  32. # Locations of your newly installed library and associated headers. See ../src/Makefile
  33. # On Linux, if you have installed raylib but cannot compile the examples, check that
  34. # the *_INSTALL_PATH values here are the same as those in src/Makefile or point to known locations.
  35. # To enable system-wide compile-time and runtime linking to libraylib.so, run ../src/$ sudo make install RAYLIB_LIBTYPE_SHARED.
  36. # To enable compile-time linking to a special version of libraylib.so, change these variables here.
  37. # To enable runtime linking to a special version of libraylib.so, see EXAMPLE_RUNTIME_PATH below.
  38. # If there is a libraylib in both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, at runtime,
  39. # the library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over the one at RAYLIB_INSTALL_PATH.
  40. # RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths.
  41. DESTDIR ?= /usr/local
  42. RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib
  43. # RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files.
  44. RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include
  45. # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
  46. RAYLIB_LIBTYPE ?= STATIC
  47. # Build mode for project: DEBUG or RELEASE
  48. BUILD_MODE ?= RELEASE
  49. # Use external GLFW library instead of rglfw module
  50. # TODO: Review usage on Linux. Target version of choice. Switch on -lglfw or -lglfw3
  51. USE_EXTERNAL_GLFW ?= FALSE
  52. # Use Wayland display server protocol on Linux desktop
  53. # by default it uses X11 windowing system
  54. USE_WAYLAND_DISPLAY ?= FALSE
  55. # Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
  56. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  57. # No uname.exe on MinGW!, but OS=Windows_NT on Windows!
  58. # ifeq ($(UNAME),Msys) -> Windows
  59. ifeq ($(OS),Windows_NT)
  60. PLATFORM_OS=WINDOWS
  61. else
  62. UNAMEOS=$(shell uname)
  63. ifeq ($(UNAMEOS),Linux)
  64. PLATFORM_OS=LINUX
  65. endif
  66. ifeq ($(UNAMEOS),FreeBSD)
  67. PLATFORM_OS=BSD
  68. endif
  69. ifeq ($(UNAMEOS),OpenBSD)
  70. PLATFORM_OS=BSD
  71. endif
  72. ifeq ($(UNAMEOS),NetBSD)
  73. PLATFORM_OS=BSD
  74. endif
  75. ifeq ($(UNAMEOS),DragonFly)
  76. PLATFORM_OS=BSD
  77. endif
  78. ifeq ($(UNAMEOS),Darwin)
  79. PLATFORM_OS=OSX
  80. endif
  81. endif
  82. endif
  83. ifeq ($(PLATFORM),PLATFORM_RPI)
  84. UNAMEOS=$(shell uname)
  85. ifeq ($(UNAMEOS),Linux)
  86. PLATFORM_OS=LINUX
  87. endif
  88. endif
  89. # RAYLIB_PATH adjustment for different platforms.
  90. # If using GNU make, we can get the full path to the top of the tree. Windows? BSD?
  91. # Required for ldconfig or other tools that do not perform path expansion.
  92. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  93. ifeq ($(PLATFORM_OS),LINUX)
  94. RAYLIB_PREFIX ?= ..
  95. RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
  96. endif
  97. endif
  98. # Default path for raylib on Raspberry Pi, if installed in different path, update it!
  99. # This is not currently used by src/Makefile. Not sure of its origin or usage. Refer to wiki.
  100. # TODO: update install: target in src/Makefile for RPI, consider relation to LINUX.
  101. ifeq ($(PLATFORM),PLATFORM_RPI)
  102. RAYLIB_PATH ?= /home/pi/raylib
  103. endif
  104. ifeq ($(PLATFORM),PLATFORM_WEB)
  105. # Emscripten required variables
  106. EMSDK_PATH ?= C:/emsdk
  107. EMSCRIPTEN_VERSION ?= 1.38.31
  108. CLANG_VERSION = e$(EMSCRIPTEN_VERSION)_64bit
  109. PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64
  110. NODE_VERSION = 8.9.1_64bit
  111. export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH)
  112. EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
  113. endif
  114. # Define raylib release directory for compiled library.
  115. # RAYLIB_RELEASE_PATH points to provided binaries or your freshly built version
  116. RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
  117. # EXAMPLE_RUNTIME_PATH embeds a custom runtime location of libraylib.so or other desired libraries
  118. # into each example binary compiled with RAYLIB_LIBTYPE=SHARED. It defaults to RAYLIB_RELEASE_PATH
  119. # so that these examples link at runtime with your version of libraylib.so in ../release/libs/linux
  120. # without formal installation from ../src/Makefile. It aids portability and is useful if you have
  121. # multiple versions of raylib, have raylib installed to a non-standard location, or want to
  122. # bundle libraylib.so with your game. Change it to your liking.
  123. # NOTE: If, at runtime, there is a libraylib.so at both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH,
  124. # The library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over RAYLIB_INSTALL_PATH,
  125. # Implemented for LINUX below with CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
  126. # To see the result, run readelf -d core/core_basic_window; looking at the RPATH or RUNPATH attribute.
  127. # To see which libraries a built example is linking to, ldd core/core_basic_window;
  128. # Look for libraylib.so.1 => $(RAYLIB_INSTALL_PATH)/libraylib.so.1 or similar listing.
  129. EXAMPLE_RUNTIME_PATH ?= $(RAYLIB_RELEASE_PATH)
  130. # Define default C compiler: gcc
  131. # NOTE: define g++ compiler if using C++
  132. CC = gcc
  133. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  134. ifeq ($(PLATFORM_OS),OSX)
  135. # OSX default compiler
  136. CC = clang
  137. endif
  138. ifeq ($(PLATFORM_OS),BSD)
  139. # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
  140. CC = clang
  141. endif
  142. endif
  143. ifeq ($(PLATFORM),PLATFORM_RPI)
  144. ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
  145. # Define RPI cross-compiler
  146. #CC = armv6j-hardfloat-linux-gnueabi-gcc
  147. CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc
  148. endif
  149. endif
  150. ifeq ($(PLATFORM),PLATFORM_WEB)
  151. # HTML5 emscripten compiler
  152. # WARNING: To compile to HTML5, code must be redesigned
  153. # to use emscripten.h and emscripten_set_main_loop()
  154. CC = emcc
  155. endif
  156. # Define default make program: Mingw32-make
  157. MAKE = mingw32-make
  158. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  159. ifeq ($(PLATFORM_OS),LINUX)
  160. MAKE = make
  161. endif
  162. endif
  163. # Define compiler flags:
  164. # -O1 defines optimization level
  165. # -g include debug information on compilation
  166. # -s strip unnecessary data from build
  167. # -Wall turns on most, but not all, compiler warnings
  168. # -std=c99 defines C language mode (standard C from 1999 revision)
  169. # -std=gnu99 defines C language mode (GNU C from 1999 revision)
  170. # -Wno-missing-braces ignore invalid warning (GCC bug 53119)
  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
  173. ifeq ($(BUILD_MODE),DEBUG)
  174. CFLAGS += -g
  175. endif
  176. ifeq ($(RAYLIB_BUILD_MODE),RELEASE)
  177. CFLAGS += -O1 -s
  178. endif
  179. # Additional flags for compiler (if desired)
  180. #CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
  181. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  182. ifeq ($(PLATFORM_OS),WINDOWS)
  183. # resource file contains windows executable icon and properties
  184. # -Wl,--subsystem,windows hides the console window
  185. CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data -Wl,--subsystem,windows
  186. endif
  187. ifeq ($(PLATFORM_OS),LINUX)
  188. ifeq ($(RAYLIB_LIBTYPE),STATIC)
  189. CFLAGS += -D_DEFAULT_SOURCE
  190. endif
  191. ifeq ($(RAYLIB_LIBTYPE),SHARED)
  192. # Explicitly enable runtime link to libraylib.so
  193. CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
  194. endif
  195. endif
  196. endif
  197. ifeq ($(PLATFORM),PLATFORM_RPI)
  198. CFLAGS += -std=gnu99
  199. endif
  200. ifeq ($(PLATFORM),PLATFORM_WEB)
  201. # -Os # size optimization
  202. # -O2 # optimization level 2, if used, also set --memory-init-file 0
  203. # -s USE_GLFW=3 # Use glfw3 library (context/input management)
  204. # -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
  205. # -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
  206. # -s USE_PTHREADS=1 # multithreading support
  207. # -s WASM=0 # disable Web Assembly, emitted by default
  208. # -s EMTERPRETIFY=1 # enable emscripten code interpreter (very slow)
  209. # -s EMTERPRETIFY_ASYNC=1 # support synchronous loops by emterpreter
  210. # -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data
  211. # -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
  212. # --profiling # include information for code profiling
  213. # --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
  214. # --preload-file resources # specify a resources folder for data compilation
  215. CFLAGS += -Os -s USE_GLFW=3 -s FORCE_FILESYSTEM=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 --preload-file $(dir $<)resources@resources
  216. ifeq ($(BUILD_MODE), DEBUG)
  217. CFLAGS += -s ASSERTIONS=1 --profiling
  218. endif
  219. # NOTE: Simple raylib examples are compiled to be interpreter by emterpreter, that way,
  220. # we can compile same code for ALL platforms with no change required, but, working on bigger
  221. # projects, code needs to be refactored to avoid a blocking while() loop, moving Update and Draw
  222. # logic to a self contained function: UpdateDrawFrame(), check core_basic_window_web.c for reference.
  223. # Define a custom shell .html and output extension
  224. CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html
  225. EXT = .html
  226. endif
  227. # Define include paths for required headers
  228. # NOTE: Several external required libraries (stb and others)
  229. INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external
  230. # Define additional directories containing required header files
  231. ifeq ($(PLATFORM),PLATFORM_RPI)
  232. # RPI required libraries
  233. INCLUDE_PATHS += -I/opt/vc/include
  234. INCLUDE_PATHS += -I/opt/vc/include/interface/vmcs_host/linux
  235. INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads
  236. endif
  237. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  238. ifeq ($(PLATFORM_OS),BSD)
  239. # Consider -L$(RAYLIB_H_INSTALL_PATH)
  240. INCLUDE_PATHS += -I/usr/local/include
  241. endif
  242. ifeq ($(PLATFORM_OS),LINUX)
  243. # Reset everything.
  244. # Precedence: immediately local, installed version, raysan5 provided libs -I$(RAYLIB_H_INSTALL_PATH) -I$(RAYLIB_PATH)/release/include
  245. INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -isystem. -isystem$(RAYLIB_PATH)/src -isystem$(RAYLIB_PATH)/release/include -isystem$(RAYLIB_PATH)/src/external
  246. endif
  247. endif
  248. # Define library paths containing required libs.
  249. LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
  250. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  251. ifeq ($(PLATFORM_OS),BSD)
  252. # Consider -L$(RAYLIB_INSTALL_PATH)
  253. LDFLAGS += -L. -Lsrc -L/usr/local/lib
  254. endif
  255. ifeq ($(PLATFORM_OS),LINUX)
  256. # Reset everything.
  257. # Precedence: immediately local, installed version, raysan5 provided libs
  258. LDFLAGS = -L. -L$(RAYLIB_INSTALL_PATH) -L$(RAYLIB_RELEASE_PATH)
  259. endif
  260. endif
  261. ifeq ($(PLATFORM),PLATFORM_RPI)
  262. LDFLAGS += -L/opt/vc/lib
  263. endif
  264. # Define any libraries required on linking
  265. # if you want to link libraries (libname.so or libname.a), use the -lname
  266. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  267. ifeq ($(PLATFORM_OS),WINDOWS)
  268. # Libraries for Windows desktop compilation
  269. # NOTE: WinMM library required to set high-res timer resolution
  270. LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
  271. # Required for physac examples
  272. LDLIBS += -static -lpthread
  273. endif
  274. ifeq ($(PLATFORM_OS),LINUX)
  275. # Libraries for Debian GNU/Linux desktop compiling
  276. # NOTE: Required packages: libegl1-mesa-dev
  277. LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt
  278. # On X11 requires also below libraries
  279. LDLIBS += -lX11
  280. # NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
  281. #LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
  282. # On Wayland windowing system, additional libraries requires
  283. ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
  284. LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
  285. endif
  286. # Explicit link to libc
  287. ifeq ($(RAYLIB_LIBTYPE),SHARED)
  288. LDLIBS += -lc
  289. endif
  290. endif
  291. ifeq ($(PLATFORM_OS),OSX)
  292. # Libraries for OSX 10.9 desktop compiling
  293. # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
  294. LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
  295. endif
  296. ifeq ($(PLATFORM_OS),BSD)
  297. # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
  298. # NOTE: Required packages: mesa-libs
  299. LDLIBS = -lraylib -lGL -lpthread -lm
  300. # On XWindow requires also below libraries
  301. LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
  302. endif
  303. ifeq ($(USE_EXTERNAL_GLFW),TRUE)
  304. # NOTE: It could require additional packages installed: libglfw3-dev
  305. LDLIBS += -lglfw
  306. endif
  307. endif
  308. ifeq ($(PLATFORM),PLATFORM_RPI)
  309. # Libraries for Raspberry Pi compiling
  310. # NOTE: Required packages: libasound2-dev (ALSA)
  311. LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl
  312. endif
  313. ifeq ($(PLATFORM),PLATFORM_WEB)
  314. # Libraries for web (HTML5) compiling
  315. LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc
  316. endif
  317. # Define all source files required
  318. EXAMPLES = \
  319. core/core_basic_window \
  320. core/core_input_keys \
  321. core/core_input_mouse \
  322. core/core_input_mouse_wheel \
  323. core/core_input_gamepad \
  324. core/core_input_multitouch \
  325. core/core_input_gestures \
  326. core/core_2d_camera \
  327. core/core_3d_camera_mode \
  328. core/core_3d_camera_free \
  329. core/core_3d_camera_first_person \
  330. core/core_3d_picking \
  331. core/core_world_screen \
  332. core/core_custom_logging \
  333. core/core_window_letterbox \
  334. core/core_drop_files \
  335. core/core_random_values \
  336. core/core_storage_values \
  337. core/core_vr_simulator \
  338. core/core_loading_thread \
  339. shapes/shapes_basic_shapes \
  340. shapes/shapes_bouncing_ball \
  341. shapes/shapes_colors_palette \
  342. shapes/shapes_logo_raylib \
  343. shapes/shapes_logo_raylib_anim \
  344. shapes/shapes_rectangle_scaling \
  345. shapes/shapes_lines_bezier \
  346. shapes/shapes_collision_area \
  347. shapes/shapes_following_eyes \
  348. shapes/shapes_easings_ball_anim \
  349. shapes/shapes_easings_box_anim \
  350. shapes/shapes_easings_rectangle_array \
  351. shapes/shapes_draw_ring \
  352. shapes/shapes_draw_circle_sector \
  353. shapes/shapes_draw_rectangle_rounded \
  354. text/text_raylib_fonts \
  355. text/text_sprite_fonts \
  356. text/text_ttf_loading \
  357. text/text_bmfont_ttf \
  358. text/text_font_sdf \
  359. text/text_format_text \
  360. text/text_input_box \
  361. text/text_writing_anim \
  362. text/text_rectangle_bounds \
  363. text/text_unicode \
  364. textures/textures_logo_raylib \
  365. textures/textures_rectangle \
  366. textures/textures_srcrec_dstrec \
  367. textures/textures_image_drawing \
  368. textures/textures_image_generation \
  369. textures/textures_image_loading \
  370. textures/textures_image_processing \
  371. textures/textures_image_text \
  372. textures/textures_to_image \
  373. textures/textures_raw_data \
  374. textures/textures_particles_blending \
  375. textures/textures_npatch_drawing \
  376. textures/textures_background_scrolling \
  377. textures/textures_sprite_button \
  378. textures/textures_sprite_explosion \
  379. textures/textures_bunnymark \
  380. models/models_animation \
  381. models/models_billboard \
  382. models/models_box_collisions \
  383. models/models_cubicmap \
  384. models/models_first_person_maze \
  385. models/models_geometric_shapes \
  386. models/models_material_pbr \
  387. models/models_mesh_generation \
  388. models/models_mesh_picking \
  389. models/models_obj_loading \
  390. models/models_obj_viewer \
  391. models/models_orthographic_projection \
  392. models/models_rlgl_solar_system \
  393. models/models_skybox \
  394. models/models_yaw_pitch_roll \
  395. models/models_heightmap \
  396. shaders/shaders_model_shader \
  397. shaders/shaders_shapes_textures \
  398. shaders/shaders_custom_uniform \
  399. shaders/shaders_postprocessing \
  400. shaders/shaders_palette_switch \
  401. shaders/shaders_raymarching \
  402. shaders/shaders_texture_drawing \
  403. shaders/shaders_texture_waves \
  404. shaders/shaders_julia_set \
  405. shaders/shaders_eratosthenes \
  406. shaders/shaders_basic_lighting \
  407. audio/audio_module_playing \
  408. audio/audio_music_stream \
  409. audio/audio_raw_stream \
  410. audio/audio_sound_loading \
  411. audio/audio_multichannel_sound \
  412. physac/physics_demo \
  413. physac/physics_friction \
  414. physac/physics_movement \
  415. physac/physics_restitution \
  416. physac/physics_shatter
  417. CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
  418. # Default target entry
  419. all: $(EXAMPLES)
  420. # Generic compilation pattern
  421. # NOTE: Examples must be ready for Android compilation!
  422. %: %.c
  423. ifeq ($(PLATFORM),PLATFORM_ANDROID)
  424. $(MAKE) -f Makefile.Android PROJECT_NAME=$@ PROJECT_SOURCE_FILES=$<
  425. else
  426. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
  427. endif
  428. # Clean everything
  429. clean:
  430. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  431. ifeq ($(PLATFORM_OS),WINDOWS)
  432. del *.o *.exe /s
  433. endif
  434. ifeq ($(PLATFORM_OS),LINUX)
  435. find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -fv
  436. endif
  437. ifeq ($(PLATFORM_OS),OSX)
  438. find . -type f -perm +ugo+x -delete
  439. rm -f *.o
  440. endif
  441. endif
  442. ifeq ($(PLATFORM),PLATFORM_RPI)
  443. find . -type f -executable -delete
  444. rm -fv *.o
  445. endif
  446. ifeq ($(PLATFORM),PLATFORM_WEB)
  447. del *.o *.html *.js
  448. endif
  449. @echo Cleaning done