makefile 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. #**************************************************************************************************
  2. #
  3. # raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten)
  4. #
  5. # Copyright (c) 2015 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. # define raylib platform to compile for
  24. # possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB
  25. # WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop()
  26. PLATFORM ?= PLATFORM_DESKTOP
  27. # determine PLATFORM_OS in case PLATFORM_DESKTOP selected
  28. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  29. # No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows
  30. ifeq ($(OS),Windows_NT)
  31. PLATFORM_OS=WINDOWS
  32. LIBPATH=win32
  33. else
  34. UNAMEOS:=$(shell uname)
  35. ifeq ($(UNAMEOS),Linux)
  36. PLATFORM_OS=LINUX
  37. LIBPATH=linux
  38. else
  39. ifeq ($(UNAMEOS),Darwin)
  40. PLATFORM_OS=OSX
  41. LIBPATH=osx
  42. endif
  43. endif
  44. endif
  45. endif
  46. # define compiler: gcc for C program, define as g++ for C++
  47. ifeq ($(PLATFORM),PLATFORM_WEB)
  48. # define emscripten compiler
  49. CC = emcc
  50. else
  51. ifeq ($(PLATFORM_OS),OSX)
  52. # define llvm compiler for mac
  53. CC = clang
  54. else
  55. # define default gcc compiler
  56. CC = gcc
  57. endif
  58. endif
  59. # define compiler flags:
  60. # -O2 defines optimization level
  61. # -Wall turns on most, but not all, compiler warnings
  62. # -std=c99 use standard C from 1999 revision
  63. ifeq ($(PLATFORM),PLATFORM_RPI)
  64. CFLAGS = -O2 -Wall -std=gnu99 -fgnu89-inline
  65. else
  66. CFLAGS = -O2 -Wall -std=c99
  67. endif
  68. ifeq ($(PLATFORM),PLATFORM_WEB)
  69. CFLAGS = -O1 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --preload-file resources
  70. #-s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
  71. #-s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
  72. endif
  73. #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes
  74. # define any directories containing required header files
  75. ifeq ($(PLATFORM),PLATFORM_RPI)
  76. INCLUDES = -I. -I../src -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads
  77. else
  78. INCLUDES = -I. -I../src
  79. # external libraries headers
  80. # GLFW3
  81. INCLUDES += -I../external/glfw3/include
  82. # GLEW - Not required any more, replaced by GLAD
  83. #INCLUDES += -I../external/glew/include
  84. # OpenAL Soft
  85. INCLUDES += -I../external/openal_soft/include
  86. endif
  87. # define library paths containing required libs
  88. ifeq ($(PLATFORM),PLATFORM_RPI)
  89. LFLAGS = -L. -L../src -L/opt/vc/lib
  90. else
  91. LFLAGS = -L. -L../src
  92. # external libraries to link with
  93. # GLFW3
  94. LFLAGS += -L../external/glfw3/lib/$(LIBPATH)
  95. ifneq ($(PLATFORM_OS),OSX)
  96. # OpenAL Soft
  97. LFLAGS += -L../external/openal_soft/lib/$(LIBPATH)
  98. # GLEW - Not required any more, replaced by GLAD
  99. #LFLAGS += -L../external/glew/lib/$(LIBPATH)
  100. endif
  101. endif
  102. # define any libraries to link into executable
  103. # if you want to link libraries (libname.so or libname.a), use the -lname
  104. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  105. ifeq ($(PLATFORM_OS),LINUX)
  106. # libraries for Debian GNU/Linux desktop compiling
  107. # requires the following packages:
  108. # libglfw3-dev libopenal-dev libglew-dev libegl1-mesa-dev
  109. LIBS = -lraylib -lglfw3 -lGLEW -lGL -lopenal -lm -pthread
  110. # on XWindow could require also below libraries, just uncomment
  111. #LIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
  112. else
  113. ifeq ($(PLATFORM_OS),OSX)
  114. # libraries for OS X 10.9 desktop compiling
  115. # requires the following packages:
  116. # libglfw3-dev libopenal-dev libglew-dev libegl1-mesa-dev
  117. LIBS = -lraylib -lglfw -framework OpenGL -framework OpenAl -framework Cocoa
  118. else
  119. # libraries for Windows desktop compiling
  120. # NOTE: GLFW3 and OpenAL Soft libraries should be installed
  121. LIBS = -lraylib -lglfw3 -lopengl32 -lopenal32 -lgdi32
  122. endif
  123. endif
  124. endif
  125. ifeq ($(PLATFORM),PLATFORM_RPI)
  126. # libraries for Raspberry Pi compiling
  127. # NOTE: OpenAL Soft library should be installed (libopenal1 package)
  128. LIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lbcm_host -lopenal
  129. endif
  130. ifeq ($(PLATFORM),PLATFORM_WEB)
  131. # just adjust the correct path to libraylib.bc
  132. LIBS = ../src/libraylib.bc
  133. endif
  134. # define additional parameters and flags for windows
  135. ifeq ($(PLATFORM_OS),WINDOWS)
  136. # resources file contains windows exe icon
  137. # -Wl,--subsystem,windows hides the console window
  138. WINFLAGS = ../src/resources -Wl,--subsystem,windows
  139. endif
  140. ifeq ($(PLATFORM),PLATFORM_WEB)
  141. EXT = .html
  142. endif
  143. # define all object files required
  144. EXAMPLES = \
  145. core_basic_window \
  146. core_input_keys \
  147. core_input_mouse \
  148. core_mouse_wheel \
  149. core_input_gamepad \
  150. core_random_values \
  151. core_color_select \
  152. core_drop_files \
  153. core_storage_values \
  154. core_gestures_detection \
  155. core_3d_mode \
  156. core_3d_picking \
  157. core_3d_camera_free \
  158. core_3d_camera_first_person \
  159. shapes_logo_raylib \
  160. shapes_basic_shapes \
  161. shapes_colors_palette \
  162. shapes_logo_raylib_anim \
  163. textures_logo_raylib \
  164. textures_image_loading \
  165. textures_rectangle \
  166. textures_srcrec_dstrec \
  167. textures_to_image \
  168. textures_raw_data \
  169. textures_formats_loading \
  170. textures_particles_trail_blending \
  171. textures_image_processing \
  172. textures_image_drawing \
  173. text_sprite_fonts \
  174. text_bmfont_ttf \
  175. text_rbmf_fonts \
  176. text_format_text \
  177. text_font_select \
  178. text_writing_anim \
  179. models_geometric_shapes \
  180. models_box_collisions \
  181. models_billboard \
  182. models_obj_loading \
  183. models_heightmap \
  184. models_cubicmap \
  185. shaders_model_shader \
  186. shaders_shapes_textures \
  187. shaders_custom_uniform \
  188. shaders_postprocessing \
  189. audio_sound_loading \
  190. audio_music_stream \
  191. fix_dylib \
  192. # typing 'make' will invoke the first target entry in the file,
  193. # in this case, the 'default' target entry is raylib
  194. default: examples
  195. # compile all examples
  196. examples: $(EXAMPLES)
  197. # compile [core] example - basic window
  198. core_basic_window: core_basic_window.c
  199. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  200. # compile [core] example - keyboard input
  201. core_input_keys: core_input_keys.c
  202. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  203. # compile [core] example - mouse input
  204. core_input_mouse: core_input_mouse.c
  205. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  206. # compile [core] example - mouse wheel
  207. core_mouse_wheel: core_mouse_wheel.c
  208. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  209. # compile [core] example - gamepad input
  210. core_input_gamepad: core_input_gamepad.c
  211. ifeq ($(PLATFORM), $(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_RPI))
  212. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  213. else
  214. @echo core_input_gamepad: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB
  215. endif
  216. # compile [core] example - generate random values
  217. core_random_values: core_random_values.c
  218. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  219. # compile [core] example - color selection (collision detection)
  220. core_color_select: core_color_select.c
  221. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  222. # compile [core] example - drop files
  223. core_drop_files: core_drop_files.c
  224. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  225. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  226. else
  227. @echo core_drop_files: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB or PLATFORM_RPI
  228. endif
  229. # compile [core] example - storage values
  230. core_storage_values: core_storage_values.c
  231. ifeq ($(PLATFORM), $(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_RPI))
  232. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  233. else
  234. @echo core_storage_values: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB
  235. endif
  236. # compile [core] example - gestures detection
  237. core_gestures_detection: core_gestures_detection.c
  238. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  239. # compile [core] example - 3d mode
  240. core_3d_mode: core_3d_mode.c
  241. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  242. # compile [core] example - 3d picking
  243. core_3d_picking: core_3d_picking.c
  244. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  245. # compile [core] example - 3d camera free
  246. core_3d_camera_free: core_3d_camera_free.c
  247. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  248. # compile [core] example - 3d camera first person
  249. core_3d_camera_first_person: core_3d_camera_first_person.c
  250. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  251. # compile [shapes] example - raylib logo (with basic shapes)
  252. shapes_logo_raylib: shapes_logo_raylib.c
  253. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  254. # compile [shapes] example - basic shapes usage (rectangle, circle, ...)
  255. shapes_basic_shapes: shapes_basic_shapes.c
  256. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  257. # compile [shapes] example - raylib color palette
  258. shapes_colors_palette: shapes_colors_palette.c
  259. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  260. # compile [shapes] example - raylib logo animation
  261. shapes_logo_raylib_anim: shapes_logo_raylib_anim.c
  262. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  263. # compile [textures] example - raylib logo texture loading
  264. textures_logo_raylib: textures_logo_raylib.c
  265. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  266. # compile [textures] example - image loading and conversion to texture
  267. textures_image_loading: textures_image_loading.c
  268. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  269. # compile [textures] example - texture rectangle drawing
  270. textures_rectangle: textures_rectangle.c
  271. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  272. # compile [textures] example - texture source and destination rectangles
  273. textures_srcrec_dstrec: textures_srcrec_dstrec.c
  274. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  275. # compile [textures] example - texture to image
  276. textures_to_image: textures_to_image.c
  277. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  278. # compile [textures] example - texture raw data
  279. textures_raw_data: textures_raw_data.c
  280. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  281. # compile [textures] example - texture formats loading
  282. textures_formats_loading: textures_formats_loading.c
  283. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  284. # compile [textures] example - texture particles trail blending
  285. textures_particles_trail_blending: textures_particles_trail_blending.c
  286. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  287. # compile [textures] example - texture image processing
  288. textures_image_processing: textures_image_processing.c
  289. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  290. # compile [textures] example - texture image drawing
  291. textures_image_drawing: textures_image_drawing.c
  292. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  293. # compile [text] example - sprite fonts loading
  294. text_sprite_fonts: text_sprite_fonts.c
  295. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  296. # compile [text] example - bmfonts and ttf loading
  297. text_bmfont_ttf: text_bmfont_ttf.c
  298. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  299. # compile [text] example - raylib bitmap fonts (rBMF)
  300. text_rbmf_fonts: text_rbmf_fonts.c
  301. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  302. # compile [text] example - text formatting
  303. text_format_text: text_format_text.c
  304. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  305. # compile [text] example - font selection program
  306. text_font_select: text_font_select.c
  307. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  308. # compile [text] example - text writing animation
  309. text_writing_anim: text_writing_anim.c
  310. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  311. # compile [models] example - basic geometric 3d shapes
  312. models_geometric_shapes: models_geometric_shapes.c
  313. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  314. # compile [models] example - box collisions
  315. models_box_collisions: models_box_collisions.c
  316. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  317. # compile [models] example - basic window
  318. models_planes: models_planes.c
  319. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  320. # compile [models] example - billboard usage
  321. models_billboard: models_billboard.c
  322. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  323. # compile [models] example - OBJ model loading
  324. models_obj_loading: models_obj_loading.c
  325. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  326. # compile [models] example - heightmap loading
  327. models_heightmap: models_heightmap.c
  328. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  329. # compile [models] example - cubesmap loading
  330. models_cubicmap: models_cubicmap.c
  331. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  332. # compile [shaders] example - model shader
  333. shaders_model_shader: shaders_model_shader.c
  334. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  335. # compile [shaders] example - shapes texture shader
  336. shaders_shapes_textures: shaders_shapes_textures.c
  337. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  338. # compile [shaders] example - custom uniform in shader
  339. shaders_custom_uniform: shaders_custom_uniform.c
  340. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  341. # compile [shaders] example - postprocessing shader
  342. shaders_postprocessing: shaders_postprocessing.c
  343. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  344. # compile [audio] example - sound loading and playing (WAV and OGG)
  345. audio_sound_loading: audio_sound_loading.c
  346. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  347. # compile [audio] example - music stream playing (OGG)
  348. audio_music_stream: audio_music_stream.c
  349. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  350. # fix dylib install path name for each executable (MAC)
  351. fix_dylib:
  352. ifeq ($(PLATFORM_OS),OSX)
  353. find . -type f -perm +ugo+x -print0 | xargs -t -0 -R 1 -I file install_name_tool -change libglfw.3.0.dylib ../external/glfw3/lib/osx/libglfw.3.0.dylib file
  354. endif
  355. # clean everything
  356. clean:
  357. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  358. ifeq ($(PLATFORM_OS),OSX)
  359. find . -type f -perm +ugo+x -delete
  360. rm -f *.o
  361. else
  362. ifeq ($(PLATFORM_OS),LINUX)
  363. 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 -f
  364. else
  365. del *.o *.exe
  366. endif
  367. endif
  368. endif
  369. ifeq ($(PLATFORM),PLATFORM_RPI)
  370. find . -type f -executable -delete
  371. rm -f *.o
  372. endif
  373. ifeq ($(PLATFORM),PLATFORM_WEB)
  374. del *.o *.html *.js
  375. endif
  376. @echo Cleaning done
  377. # instead of defining every module one by one, we can define a pattern
  378. # this pattern below will automatically compile every module defined on $(OBJS)
  379. #%.exe : %.c
  380. # $(CC) -o $@ $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM)