找回密码
 立即注册
首页 业界区 安全 清理单片机编译过程中产生的编译文件(压缩以减少项目体 ...

清理单片机编译过程中产生的编译文件(压缩以减少项目体积)

袁勤 前天 12:44
1)新建文本文件,将文件名修改为Clear.bat
2)用记事本打开该文件,将下面代码复制文件中即可
  1. @echo off
  2. ::::::::::::::::::::::::::::::
  3. :: 1)清理微芯编译生成的中间文件
  4. :: 2)清理辉芒微编译生成的中间文件
  5. :: 3)清理芯圣编译生成的中间文件
  6. :: *使用方法*
  7. :: 清理微芯、辉芒微拷入文件夹内,双击即可
  8. :: 芯圣项目使用需要将该文件建立一个文件夹再放入工程目录中(芯圣编译会将目录中无关文件全部清除)
  9. ::
  10. ::::::::::::::::::::::::::::::::::::::::::
  11. ::一键清理FMD产生的中间文件
  12. rd /s /q .vscode
  13. rd /s /q output
  14. del /f /s /q funclist
  15. del /f /s /q *.p1
  16. del /f /s /q *.pre
  17. ::touch.lpp文件不删除
  18. for /f "delims=" %%i in ('dir /b /s /a-d "*.lpp"') do (
  19.     if "%%~nxi" neq "touch.lpp" (
  20.         if "%%~nxi" neq "touch_cs_lp_uac.lpp" (
  21.             if "%%~nxi" neq "touch_cs_uac.lpp" (
  22.                 if "%%~nxi" neq "touch_lp.lpp" (
  23.                     if "%%~nxi" neq "touch_soft.lpp" (
  24.                         del /f /q "%%i"
  25.     )))))
  26. )
  27. ::EEPROM.bin不删除
  28. for /f "delims=" %%i in ('dir /b /s /a-d "*.bin"') do (
  29.     if "%%~nxi" neq "EEPROM.bin" (
  30.         del /f /q "%%i"
  31.     )
  32. )
  33. del /f /s /q *.as
  34. del /f /s /q *.lst
  35. del /f /s /q *.rlf
  36. del /f /s /q *.as
  37. del /f /s /q *.asm
  38. del /f /s /q *.cof
  39. del /f /s /q *.hxl
  40. del /f /s /q *.map
  41. del /f /s /q *.sdb
  42. del /f /s /q *.sym
  43. del /f /s /q *.obj
  44. del /f /s /q *.d
  45. del /f /s /q *.cmf
  46. ::::::::::::::::::::::::::::::::::::::::::
  47. ::一键清理PIC中间文件
  48. rd /s /q build
  49. rd /s /q debug
  50. ::只保留xml文件
  51. cd ./nbproject
  52. rd /s /q private
  53. del /f /s /q *.mk
  54. del /f /s /q *.properties
  55. del /f /s /q *.bash
  56. ::只保留hex文件
  57. cd ..
  58. cd ./dist/default/production
  59. del *.d
  60. del *.i
  61. del *.p1
  62. del *.xml
  63. del *.cmf
  64. del *.elf
  65. del *.hxl
  66. del *.lst
  67. del *.map
  68. del *.mum
  69. del *.o
  70. del *.rlf
  71. del *.sdb
  72. del *.sym
  73. ::::::::::::::::::::::::::::::::::::::::::
  74. ::一键清理HC产生的中间文件
  75. ::EEPROM.bin不删除
  76. for /f "delims=" %%i in ('dir /b /s /a-d "*.bin"') do (
  77.     if "%%~nxi" neq "EEPROM.bin" (
  78.         del /f /q "%%i"
  79.     )
  80. )
  81. del /f /s /q *.obj
  82. del /f /s /q *.pre
  83. del /f /s /q *.err
  84. del /f /s /q *.as
  85. del /f /s /q *.aslib
  86. del /f /s /q log.txt
复制代码
来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
您需要登录后才可以回帖 登录 | 立即注册