CCS下makefile的编写(2)

2019-01-26 17:11

characters make up ends of lines, some rules had to be established to avoid disrupting partial line-end sequences when searching for and replacing them. When searching for 0D and 0A hex characters, keep the following in mind:

?穃x0a will match a solo (without a preceding 0x0D) 0x0A but not the pair.

?穃x0d will match a solo (without a following 0x0A) 0x0D but not the pair.

?\\n will match a solo 0x0A or a 0x0D,0x0A pair.

?Replacing \with \would be good for converting a Macintosh file (opened with autodetect file type off).

?Replacing \with \is a good way to convert Unix files to MS-DOS files or vice-versa, if the buffer flag for Unix EOLs is set appropriately in Options 郋ditor|郘anguage郞ptions.

See Hex Mode for more information on hex editing.

Special Characters

Character Meaning . Matches any single character, except a newline * Matches any number of occurrences (even zero) of the expression that precedes it. + Matches one or more occurrences of the preceding expression. ? Matches zero or one occurrence of the preceding expression. [ and ] Defines the beginning and end of a character class. ( and ) Defines the beginning and end of a group of expressions. Groups expressions into larger units and dictates precedence. Each group is also a Reference Group that may be pasted into a replacement string. | Alternation. Allows matching the expression on the left or on the right of the operator. $ Matches the end of a line. ^ Two meanings: Matches the beginning of a line. Complement operator when the first character in a character class. \\ Used for escaping metacharacters and non-printing characters. \\c The position in the pattern at which the cursor is placed at the end of a successful search.

CodeSizeTune - Using External Makefiles

You can use an external makefile with CodeSizeTune. However, to be successfully used, you must make modifications to the makefile so that the PBC_CMDFILE macro is added to the build options.

For example, if the gmake command to build the program is: gmake -makefile.mak TARG=c6x

When running CodeSizeTune, the command line would be:

gmake -makefile.mak TARG=c6x PBC_CMDFILE=-@C:\\TEMP\\PBCVariantOpts

Using Regular Expressions

A regular expression defines a specific text pattern that can be used to be locate and retrieve specific sections of text. For example, nat.* is a regular expression which searches for all occurrences of \followed by one or more characters (e.g. nathan, nate, natalie, etc.). There are many more regular expression characters, however, these are the most commonly used ones.

Regular Expressions By Example

Expression dsp ^dsp Meaning All occurrences of \All occurrences of \beginning of a line. All occurrences of \beginning of a line and end at the end of the line (e.g. the only thing on the line) Matches any single character, 1 or more times Matches any character, 0 or more times Matches any character, 1 or more times ^dsp$ . .* .+

Adding Regular Expressions to Makefile Import

In this exercise, you will learn how to specify the source files you wish to import within the makefile importing utility. The makefile utility will scan the makefile you are importing, looking for the source files you specify. In this exercise, you will configure the makefile utility to scan for source files and include files. Specification is done using regular expressions as in the previous exercise.

1. Add the default regular expression \

quotes) to the Added Expression section by clicking the Add button. In this instance, \indicates that CCS will search the makefile for all lines containing source file information (e.g.

SOURCE=). The \lines must have no additional or extraneous text. 2. In the Regular Expression to Add, type \(without the

quotes). Press Add. In this instance, \that CCS will search the makefile for all lines containing header file information (e.g. INCLUDE=

to use the macro tool.

Using Macros

Macros allow you to apply advanced search-and-replace techniques to a file. For example, below is a macro definition located in a makefile:

WHICH_OBJ_DIR \\

\\\

If we define WHICH_OBJ_DIR to equal \the makefile import tool, the generator will add the following text into the generated project file (.pjt):

\\\

1. In the Macro Definition to Add field, enter: WHICH_OBJ_DIR 2. In the Macro value field, enter: C:\\winnt

3. Click the Add button to add the macro. Your window should look like

the one below. 2.

Note: You must examine your own makefile to identify any macros defined within it. Each software development tool defines its own set of macros.

4. Click Finish to save.


CCS下makefile的编写(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:外墙保温分项工程质量验收记录表

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: