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.

455 lines
17 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  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. endif
  78. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  79. # add standard directories for GNU/Linux
  80. ifeq ($(PLATFORM_OS),LINUX)
  81. INCLUDES = -I. -I../src -I/usr/local/include/raylib/
  82. else ifeq ($(PLATFORM_OS),OSX)
  83. INCLUDES = -I. -I../src
  84. else
  85. INCLUDES = -I. -I../../src -IC:/raylib/raylib/src
  86. # external libraries headers
  87. # GLFW3
  88. INCLUDES += -I../../external/glfw3/include
  89. # OpenAL Soft
  90. INCLUDES += -I../../external/openal_soft/include
  91. endif
  92. endif
  93. # define library paths containing required libs
  94. ifeq ($(PLATFORM),PLATFORM_RPI)
  95. LFLAGS = -L. -L../../src -L/opt/vc/lib
  96. endif
  97. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  98. # add standard directories for GNU/Linux
  99. ifeq ($(PLATFORM_OS),LINUX)
  100. LFLAGS = -L. -L../../src
  101. else ifeq ($(PLATFORM_OS),OSX)
  102. LFLAGS = -L. -L../src
  103. else
  104. LFLAGS = -L. -L../../src -LC:/raylib/raylib/src
  105. # external libraries to link with
  106. # GLFW3
  107. LFLAGS += -L../../external/glfw3/lib/$(LIBPATH)
  108. ifneq ($(PLATFORM_OS),OSX)
  109. # OpenAL Soft
  110. LFLAGS += -L../../external/openal_soft/lib/$(LIBPATH)
  111. endif
  112. endif
  113. endif
  114. # define any libraries to link into executable
  115. # if you want to link libraries (libname.so or libname.a), use the -lname
  116. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  117. ifeq ($(PLATFORM_OS),LINUX)
  118. # libraries for Debian GNU/Linux desktop compiling
  119. # requires the following packages:
  120. # libglfw3-dev libopenal-dev libegl1-mesa-dev
  121. LIBS = -lraylib -lglfw3 -lGL -lopenal -lm -pthread -ldl -lX11 \
  122. -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
  123. else
  124. ifeq ($(PLATFORM_OS),OSX)
  125. # libraries for OS X 10.9 desktop compiling
  126. # requires the following packages:
  127. # libglfw3-dev libopenal-dev libegl1-mesa-dev
  128. LIBS = -lraylib -lglfw3 -framework OpenGL -framework OpenAl -framework Cocoa
  129. else
  130. # libraries for Windows desktop compiling
  131. # NOTE: GLFW3 and OpenAL Soft libraries should be installed
  132. LIBS = -lraylib -lglfw3 -lopengl32 -lopenal32 -lgdi32
  133. endif
  134. endif
  135. endif
  136. ifeq ($(PLATFORM),PLATFORM_RPI)
  137. # libraries for Raspberry Pi compiling
  138. # NOTE: OpenAL Soft library should be installed (libopenal1 package)
  139. LIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lbcm_host -lopenal
  140. endif
  141. ifeq ($(PLATFORM),PLATFORM_WEB)
  142. # just adjust the correct path to libraylib.bc
  143. LIBS = ../src/libraylib.bc
  144. endif
  145. # define additional parameters and flags for windows
  146. ifeq ($(PLATFORM_OS),WINDOWS)
  147. # resources file contains windows exe icon
  148. # -Wl,--subsystem,windows hides the console window
  149. WINFLAGS = ../src/resources -Wl,--subsystem,windows
  150. endif
  151. ifeq ($(PLATFORM),PLATFORM_WEB)
  152. EXT = .html
  153. endif
  154. # define all object files required
  155. EXAMPLES = \
  156. core_basic_window \
  157. core_input_keys \
  158. core_input_mouse \
  159. core_mouse_wheel \
  160. core_input_gamepad \
  161. core_random_values \
  162. core_color_select \
  163. core_drop_files \
  164. core_storage_values \
  165. core_gestures_detection \
  166. core_3d_mode \
  167. core_3d_picking \
  168. core_3d_camera_free \
  169. core_3d_camera_first_person \
  170. shapes_logo_raylib \
  171. shapes_basic_shapes \
  172. shapes_colors_palette \
  173. shapes_logo_raylib_anim \
  174. textures_logo_raylib \
  175. textures_image_loading \
  176. textures_rectangle \
  177. textures_srcrec_dstrec \
  178. textures_to_image \
  179. textures_raw_data \
  180. textures_formats_loading \
  181. textures_particles_trail_blending \
  182. textures_image_processing \
  183. textures_image_drawing \
  184. text_sprite_fonts \
  185. text_bmfont_ttf \
  186. text_rbmf_fonts \
  187. text_format_text \
  188. text_font_select \
  189. text_writing_anim \
  190. models_geometric_shapes \
  191. models_box_collisions \
  192. models_billboard \
  193. models_obj_loading \
  194. models_heightmap \
  195. models_cubicmap \
  196. shaders_model_shader \
  197. shaders_shapes_textures \
  198. shaders_custom_uniform \
  199. shaders_postprocessing \
  200. audio_sound_loading \
  201. audio_music_stream \
  202. fix_dylib \
  203. # typing 'make' will invoke the default target entry called 'all',
  204. # in this case, the 'default' target entry is raylib
  205. all: examples
  206. # compile all examples
  207. examples: $(EXAMPLES)
  208. # compile [core] example - basic window
  209. core_basic_window: core_basic_window.c
  210. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  211. # compile [core] example - keyboard input
  212. core_input_keys: core_input_keys.c
  213. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  214. # compile [core] example - mouse input
  215. core_input_mouse: core_input_mouse.c
  216. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  217. # compile [core] example - mouse wheel
  218. core_mouse_wheel: core_mouse_wheel.c
  219. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  220. # compile [core] example - gamepad input
  221. core_input_gamepad: core_input_gamepad.c
  222. ifeq ($(PLATFORM), $(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_RPI))
  223. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  224. else
  225. @echo core_input_gamepad: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB
  226. endif
  227. # compile [core] example - generate random values
  228. core_random_values: core_random_values.c
  229. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  230. # compile [core] example - color selection (collision detection)
  231. core_color_select: core_color_select.c
  232. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  233. # compile [core] example - drop files
  234. core_drop_files: core_drop_files.c
  235. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  236. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  237. else
  238. @echo core_drop_files: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB or PLATFORM_RPI
  239. endif
  240. # compile [core] example - storage values
  241. core_storage_values: core_storage_values.c
  242. ifeq ($(PLATFORM), $(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_RPI))
  243. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  244. else
  245. @echo core_storage_values: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB
  246. endif
  247. # compile [core] example - gestures detection
  248. core_gestures_detection: core_gestures_detection.c
  249. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  250. # compile [core] example - 3d mode
  251. core_3d_mode: core_3d_mode.c
  252. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  253. # compile [core] example - 3d picking
  254. core_3d_picking: core_3d_picking.c
  255. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  256. # compile [core] example - 3d camera free
  257. core_3d_camera_free: core_3d_camera_free.c
  258. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  259. # compile [core] example - 3d camera first person
  260. core_3d_camera_first_person: core_3d_camera_first_person.c
  261. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  262. # compile [shapes] example - raylib logo (with basic shapes)
  263. shapes_logo_raylib: shapes_logo_raylib.c
  264. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  265. # compile [shapes] example - basic shapes usage (rectangle, circle, ...)
  266. shapes_basic_shapes: shapes_basic_shapes.c
  267. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  268. # compile [shapes] example - raylib color palette
  269. shapes_colors_palette: shapes_colors_palette.c
  270. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  271. # compile [shapes] example - raylib logo animation
  272. shapes_logo_raylib_anim: shapes_logo_raylib_anim.c
  273. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  274. # compile [textures] example - raylib logo texture loading
  275. textures_logo_raylib: textures_logo_raylib.c
  276. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  277. # compile [textures] example - image loading and conversion to texture
  278. textures_image_loading: textures_image_loading.c
  279. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  280. # compile [textures] example - texture rectangle drawing
  281. textures_rectangle: textures_rectangle.c
  282. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  283. # compile [textures] example - texture source and destination rectangles
  284. textures_srcrec_dstrec: textures_srcrec_dstrec.c
  285. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  286. # compile [textures] example - texture to image
  287. textures_to_image: textures_to_image.c
  288. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  289. # compile [textures] example - texture raw data
  290. textures_raw_data: textures_raw_data.c
  291. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  292. # compile [textures] example - texture formats loading
  293. textures_formats_loading: textures_formats_loading.c
  294. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  295. # compile [textures] example - texture particles trail blending
  296. textures_particles_trail_blending: textures_particles_trail_blending.c
  297. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  298. # compile [textures] example - texture image processing
  299. textures_image_processing: textures_image_processing.c
  300. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  301. # compile [textures] example - texture image drawing
  302. textures_image_drawing: textures_image_drawing.c
  303. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  304. # compile [text] example - sprite fonts loading
  305. text_sprite_fonts: text_sprite_fonts.c
  306. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  307. # compile [text] example - bmfonts and ttf loading
  308. text_bmfont_ttf: text_bmfont_ttf.c
  309. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  310. # compile [text] example - raylib bitmap fonts (rBMF)
  311. text_rbmf_fonts: text_rbmf_fonts.c
  312. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  313. # compile [text] example - text formatting
  314. text_format_text: text_format_text.c
  315. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  316. # compile [text] example - font selection program
  317. text_font_select: text_font_select.c
  318. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  319. # compile [text] example - text writing animation
  320. text_writing_anim: text_writing_anim.c
  321. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  322. # compile [models] example - basic geometric 3d shapes
  323. models_geometric_shapes: models_geometric_shapes.c
  324. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  325. # compile [models] example - box collisions
  326. models_box_collisions: models_box_collisions.c
  327. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  328. # compile [models] example - basic window
  329. models_planes: models_planes.c
  330. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  331. # compile [models] example - billboard usage
  332. models_billboard: models_billboard.c
  333. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  334. # compile [models] example - OBJ model loading
  335. models_obj_loading: models_obj_loading.c
  336. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  337. # compile [models] example - heightmap loading
  338. models_heightmap: models_heightmap.c
  339. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  340. # compile [models] example - cubesmap loading
  341. models_cubicmap: models_cubicmap.c
  342. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  343. # compile [shaders] example - model shader
  344. shaders_model_shader: shaders_model_shader.c
  345. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  346. # compile [shaders] example - shapes texture shader
  347. shaders_shapes_textures: shaders_shapes_textures.c
  348. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  349. # compile [shaders] example - custom uniform in shader
  350. shaders_custom_uniform: shaders_custom_uniform.c
  351. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  352. # compile [shaders] example - postprocessing shader
  353. shaders_postprocessing: shaders_postprocessing.c
  354. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  355. # compile [audio] example - sound loading and playing (WAV and OGG)
  356. audio_sound_loading: audio_sound_loading.c
  357. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  358. # compile [audio] example - music stream playing (OGG)
  359. audio_music_stream: audio_music_stream.c
  360. $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
  361. # fix dylib install path name for each executable (MAC)
  362. fix_dylib:
  363. ifeq ($(PLATFORM_OS),OSX)
  364. 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
  365. endif
  366. # clean everything
  367. clean:
  368. ifeq ($(PLATFORM),PLATFORM_DESKTOP)
  369. ifeq ($(PLATFORM_OS),OSX)
  370. find . -type f -perm +ugo+x -delete
  371. rm -f *.o
  372. else
  373. ifeq ($(PLATFORM_OS),LINUX)
  374. 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
  375. else
  376. del *.o *.exe
  377. endif
  378. endif
  379. endif
  380. ifeq ($(PLATFORM),PLATFORM_RPI)
  381. find . -type f -executable -delete
  382. rm -f *.o
  383. endif
  384. ifeq ($(PLATFORM),PLATFORM_WEB)
  385. del *.o *.html *.js
  386. endif
  387. @echo Cleaning done
  388. # instead of defining every module one by one, we can define a pattern
  389. # this pattern below will automatically compile every module defined on $(OBJS)
  390. #%.exe : %.c
  391. # $(CC) -o $@ $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM)