[Original] improvements and optimization of MAKETEST. BAT files in the μC/OS Ⅱ Project

Source: Internet
Author: User

 

When we use BC31 to compile μ C/OS Ⅱ, the introduction of MAKETEST. BAT batch processing files helps us reduce a lot of repetitive work, which can help us save some time;

However, the default MAKETEST. BAT file in the system is too simple, and is not conducive to program error check and troubleshooting. For example, there are errors that do not know where the errors are and many other unhumanized places.

In view of this situation, I modified and optimized the MAKETEST. BAT file and implemented two major functions:

1. if the program has an error, the BC31 error message is called and displayed in the current DOS window. After you press any key, the current DOS window exits, this setting allows you to troubleshoot program errors. 2. If the compilation process is complete and the compilation process is complete, the generated test.exe executable file (the project product) will be directly called in the current DOS window ).

The MAKETEST. BAT file contains the following content:

 1 ECHO OFF 2 ECHO ******************************************************************************* 3 ECHO *                                  uC/OS-II 4 ECHO *                             The Real-Time Kernel 5 ECHO * 6 ECHO *                       Modified by GYL 2012/6/17/01:16 7 ECHO *               For more information,Email guoyong.lei@163.com 8 ECHO * 9 ECHO *                 Filename    : MAKETEST.BAT10 ECHO *               Description : call TEST.MAK to compile automatically 11 ECHO *******************************************************************************12 ECHO *13 ECHO ON14 MD ..\WORK15 MD ..\OBJ16 MD ..\LST17 CD ..\WORK18 19 COPY ..\TEST\TEST.MAK TEST.MAK20 E:\BC31\BIN\MAKE -f TEST.MAK21 @cd ..\TEST22 @RD /S /Q ..\WORK23 @RD /S /Q ..\OBJ24 @RD /S /Q ..\LST25 @if exist ".\TEST.exe" (goto Go) else (goto Debug)26 27 :Go28 cls29 @.\TEST.exe30 goto end31 32 :Debug33 @pause34 goto end35 36 :end

This document is as follows: MAKETEST. bat

In addition, another batch is provided to delete the final executable files, which is equivalent to the make clean function in MakeFile.

The Code is as follows:

 1 ECHO OFF 2 ECHO ******************************************************************************* 3 ECHO *                                  uC/OS-II 4 ECHO *                           The Real-Time Kernel 5 ECHO * 6 ECHO *                    Modified by GYL 2012/6/17/01:16 7 ECHO *           For more information,Email guoyong.lei@163.com 8 ECHO *         9 ECHO * Filename    : MAKEclean.BAT10 ECHO * Description : Batch file to clean the application.11 ECHO *******************************************************************************12 ECHO *13 ECHO ON14 RD /S /Q ..\WORK15 RD /S /Q ..\OBJ16 RD /S /Q ..\LST17 del /F /Q *.MAP18 del /F /Q *.exe

Place the batch processing file in the directory of the same level as MAKETEST. bat. Double-click to run the file to make clean.

: MAKEclean. bat

 

Note:

1. The above address is in the rar compressed file format. After decompression, the reader needs to obtain the. bat file and place it in the corresponding directory.

2. This batch of processed files is suitable for users in the following project directories. If they are different, modify the downloaded bat file.

1 project directory name \ BC452 | ----- \ TEST3 | -------- MAKETEST. bat4 | -------- MAKEclean. bat5 | -------- TEST. MAK6 | ----- \ SOURCES7 | ------- source code 8 in this directory | ------- different 9 | ------- do not list them one by one

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.