CCS下makefile的编写
- 格式:doc
- 大小:67.00 KB
- 文档页数:10
makefile中使用cp命令介绍在编写软件项目时,为了方便管理和构建代码,我们通常会使用makefile来自动化构建过程。
makefile是一种用于描述代码构建规则的文件,其中可以包含各种命令和指令。
其中,cp命令是makefile中常用的一个命令,用于复制文件或目录。
cp命令的基本用法cp命令的基本语法如下:cp [选项] 源文件目标文件其中,选项可以用来指定一些复制的行为,例如是否覆盖目标文件、是否保留源文件的属性等。
源文件是要复制的文件或目录,目标文件是复制后的文件或目录的名称。
cp命令的常见选项cp命令有许多选项可以用来控制复制的行为,下面是一些常见的选项: - -r:递归地复制目录及其内容。
- -f:强制复制,即使目标文件已经存在也进行复制。
- -i:交互式复制,如果目标文件已经存在,会询问是否覆盖。
- -p:保留源文件的属性,包括权限、时间戳等。
- -u:只复制更新的文件,即只复制源文件比目标文件新的文件。
- -v:显示详细的复制过程。
使用cp命令复制文件在makefile中使用cp命令复制文件可以方便地将源文件复制到目标文件中。
下面是一个简单的示例:all:cp source_file.txt target_file.txt上述示例中,我们使用了makefile的规则,其中all是规则的目标,cpsource_file.txt target_file.txt是规则的命令。
当我们运行make命令时,makefile会根据规则执行相应的命令,从而完成文件的复制。
使用cp命令复制目录除了复制文件,cp命令还可以复制目录及其内容。
在makefile中,我们可以使用cp命令的-r选项来递归地复制目录。
下面是一个示例:all:cp -r source_directory target_directory上述示例中,我们使用了-r选项来递归地复制source_directory目录及其内容到target_directory目录中。
vscode makefile语法Visual Studio Code (VSCode) 支持多种编程语言的语法高亮和智能代码补全,包括 Makefile。
在 VSCode 中,你可以使用以下步骤来配置 Makefile 的语法高亮和智能代码补全:1. 打开 VSCode。
2. 在左侧的资源管理器中,找到并打开你的 Makefile 文件。
3. 点击顶部菜单栏中的 "查看",然后选择 "命令面板"。
4. 在命令面板中输入 "Color Theme",然后选择一个你喜欢的颜色主题。
5. 确保你的 Makefile 文件已经保存,然后按下 `F5` 键,VSCode 将自动检测 Makefile 的语法并启用语法高亮。
6. 在编写 Makefile 时,VSCode 会自动提供智能代码补全功能。
你可以按下 `Ctrl+Space` 键来触发代码补全提示。
如果你想要更深入地自定义 VSCode 的 Makefile 语法高亮和智能代码补全功能,你可以参考以下步骤:1. 打开 VSCode 的设置。
你可以按下 `Ctrl+,` 键来打开设置,或者在左侧的资源管理器中右键点击一个文件或文件夹,然后选择 "Open Settings"。
2. 在设置中,搜索 "Files: Language Mode"。
3. 在 "Files: Language Mode" 设置中,选择 "Editor Config" 或 "File Association"。
如果你选择了 "Editor Config",VSCode 将使用 Editor Config 文件来决定如何解析和显示 Makefile 文件。
如果你选择了 "File Association",VSCode 将使用文件关联来决定如何解析和显示 Makefile 文件。
makefile--参数传递、条件判断、include(五)在多个Makefile嵌套调⽤时,有时我们需要传递⼀些参数给下⼀层Makefile。
⽐如我们在顶层Makefile⾥⾯定义的打开调试信息变量DEBUG_SYMBOLS,我们希望在进⼊⼦⽬录执⾏⼦Makefile时该变量仍然有效,这是需要将该变量传递给⼦Makefile,那怎么传递呢?这⾥有两种⽅法:1. 在上层Makefile中使⽤”export”关键字对需要传递的变量进⾏声明。
⽐如:1 2DEBUG_SYMBOLS = TRUE export DEBUG_SYMBOLS当不希望将⼀个变量传递给⼦ make 时,可以使⽤指⽰符 “unexport”来声明这个变量。
export⼀般⽤法是在定义变量的同时对它进⾏声明。
如下:1export DEBUG_SYMBOLS = TRUE2. 在命令⾏上指定变量。
⽐如:1$(MAKE) -C xxx DEBUG_SYMBOLS = TRUE这样在进⼊⼦⽬录xxx执⾏make时该变量也有效。
像编程语⾔⼀样,Makefile也有⾃⼰的条件语句。
条件语句可以根据⼀个变量值来控制make的执⾏逻辑。
⽐较常⽤的条件语句是ifeq –else-endif、ifneq-else-endif、ifdef-else-endif。
ifeq关键字⽤来判断参数是否相等。
⽐如判断是否⽣成调试信息可以这么⽤:1 2 3 4 5 6ifeq ($(DEBUG_SYMBOLS), TRUE) >---CFLAGS += -g -Wall -Werror -O0 else>---CFLAGS += -Wall -Werror -O2 endifIfneq和ifeq作⽤相反,此关键字是⽤来判断参数是否不相等。
ifdef关键字⽤来判断⼀个变量是否已经定义。
后两个关键字⽤法和ifeq类似。
现在我们继续改进我们上⼀节的Makefile,上⼀节的Makefile完成Makefile的嵌套调⽤,每⼀个模块都有⾃⼰的Makefile。
makefile case语句
一、makefile文件通用语法
1、变量的定义:
变量在makefile中可以用来定义makefile中引用的字符串,变量名不区分大小写,可以用合法的shell变量名来定义,通常大写字母、数字和下划线组成,在定义时不能用等号,而是一个冒号:
VARIABLE =value
2、目标定义:
在makefile中称为“目标”,可以是程序或是一个操作。
在定义目标时,第一个单词必须是目标的名字,后面是依赖条件(文件名)和后面的命令,也可以是单独的一行:
target:file1 file2
command1
command2
3、条件判断:
makefile文件也可以用条件判断,可以使用ifdef 和ifndef来判断变量是否定义,也可以用eq或ne来比较字符串:
ifdef VAR
command1
endif
二、makefile case语句
case语句,即switch-case,是makefile中比较复杂的语句,
可以判断变量的值并根据不同的值来执行不同的命令,case语句的语法如下:
variable-name:value1)
command1
;;
value2)
command2
;;
*)
command3
;;
esac
其中,variable-name为需要比较的变量,每一条指令的结尾都必须以双分号(;;)结尾,每一个值块的结尾以单分号(;)结尾,最后一个值可以使用“*”表示,表示除了上述值以外的所有的变量值。
CCS入门与使用一、CCS的安装和配置2.配置CCS二、创建新工程1.新建工程打开CCS后,选择"File" -> "New" -> "CCS Project",输入工程名称和保存路径并点击"Finish"创建新工程。
2.选择目标设备在新建工程向导中,选择目标设备,例如德州仪器的MSP430系列微控制器。
3.配置编译器选择合适的编译器,例如TI编译器。
4.配置连接器配置连接器来连接目标设备,例如XDS100仿真器。
5.添加源码文件在新建工程向导中选择"Create 'main.c'",然后点击"Finish"。
三、编写和调试代码1.编写代码在新建工程的源码文件(main.c)中编写嵌入式代码,例如控制IO 口,读取传感器数据等。
2.编译代码在工程资源管理器中选择main.c文件,点击右键选择"Build"编译代码。
3.烧录代码在工程资源管理器中选择main.c文件,点击右键选择"Debug" -> "Debug Active Project",CCS将自动编译代码并将程序烧录到目标设备。
4.调试代码在CCS的调试视图中可以设置断点、观察变量、单步调试等,以便调试嵌入式代码。
四、其他常用功能1.资源管理器CCS的资源管理器可以管理工程文件和项目设置,例如添加、删除和重命名文件。
2.项目设置CCS的项目设置可以配置构建选项、目标设备、编译器和连接器等。
3.编译选项CCS的编译选项功能可以配置编译器的优化级别、调试信息和警告设置。
4.仿真器设置CCS的仿真器设置功能可以配置目标设备的仿真器接口、仿真速度和仿真器选项。
总结:CCS提供了强大的开发和调试功能,适用于开发嵌入式系统。
在使用CCS时,需要进行安装和配置,然后可以创建新工程、编写和调试代码。
makefile中使用cp命令详解在Makefile 中使用`cp` 命令通常是为了复制文件或目录。
`cp` 命令的基本语法是:```makefilecp source destination```其中,`source` 是要复制的文件或目录的路径,`destination` 是目标路径。
下面是一些在Makefile 中使用`cp` 命令的例子:1. 复制文件```makefilecopy_file:cp source.txt destination.txt```上述Makefile 中的规则定义了一个名为`copy_file` 的目标。
当你运行`make copy_file` 时,它将执行`cp source.txt destination.txt` 命令,将`source.txt` 复制到`destination.txt`。
2. 复制目录```makefilecopy_directory:cp -r source_directory destination_directory```上述Makefile 中的规则定义了一个名为`copy_directory` 的目标。
通过添加`-r` 选项,`cp` 命令可以递归地复制整个目录。
3. 使用变量```makefileSOURCE_FILE = source.txtDESTINATION_FILE = destination.txtcopy_using_variables:cp $(SOURCE_FILE) $(DESTINATION_FILE)```在这个例子中,我们使用了Makefile 中的变量`SOURCE_FILE` 和`DESTINATION_FILE` 来存储文件路径。
这样可以使Makefile 更加灵活,方便修改文件路径而不必更改多个地方。
4. 自定义目标```makefilecustom_target: source.txtcp $< $@```在这个例子中,`custom_target` 是一个自定义目标,它依赖于`source.txt`。
ccs编译教程CCS(Code Composer Studio)是德州仪器(Texas Instruments)提供的一个集成开发环境(IDE),用于开发和调试基于TI的DSP(数字信号处理器)和微控制器(MCU)的嵌入式应用程序。
以下是一个简单的CCS 编译教程,涵盖从创建项目到编译的基本步骤:步骤1:安装Code Composer Studio首先,确保你已经成功安装了Code Composer Studio。
你可以从TI 的官方网站下载并按照说明进行安装。
步骤2:创建新项目1. 启动Code Composer Studio。
2. 选择"File" > "New" > "CCS Project"。
3. 在弹出的对话框中,输入项目的名称,选择项目类型(例如,C Project or C++ Project),选择合适的目标(Target)和配置,最后点击"Finish"。
步骤3:配置项目属性1. 在项目资源管理器中,右键点击项目名称,选择"Properties"。
2. 在弹出的对话框中,配置项目属性,包括代码生成器、编译器、链接器等。
这些设置取决于你的项目类型和目标设备。
步骤4:编写代码在"src" 目录中创建你的源代码文件。
例如,创建一个名为`main.c` 的文件,并在其中编写你的应用程序代码。
```c#include <stdio.h>int main() {printf("Hello, CCS!\n");return 0;}```步骤5:构建项目1. 在CCS 中,点击工具栏上的"Build" 图标,或者使用"Project" > "Build Project" 菜单。
Makefile中的模式规则是一种特殊的规则,它允许你使用模式来匹配目标文件,然后根据匹配结果执行相应的命令。
模式规则中的目标文件名包含一个模式字符“%”,该字符可以匹配任何非空字符串。
在模式规则中,目标文件是一个带有模式字符“%”的文件,使用模式来匹配目标文件。
一旦依赖目标中的“%”模式被确定,make 会被要求去匹配当前目录下所有的文件名,一旦找到,make就会执行规则下的命令。
在模式规则中,目标可能会是多个的,如果有模式匹配出多个目标,make就会产生所有的模式目标。
此时,make关心的是依赖的文件名和生成目标的命令这两件事。
以下是一个简单的Makefile模式规则示例:
```makefile
%.o : %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
```
这个规则表示将所有的.c文件编译成.o文件。
其中,“$<”表示了所有依赖目标的挨个值,“$@”表示了所有目标的挨个值。
这些自动化变量将在后面的章节中详细讲述。
总的来说,Makefile的模式规则是一种强大的工具,它可以根据文件名模式自动构建目标文件,并执行相应的命令。
makefile debug编译【最新版】目录1.Makefile 概述2.debug 编译的含义3.Makefile 中的 debug 编译4.如何进行 Makefile debug 编译5.总结正文1.Makefile 概述Makefile 是一种用于自动化构建和编译软件的脚本文件,通常用于Unix 和类 Unix 系统中。
它由一系列的规则和指令组成,用于指定源代码文件、编译器、链接器和其他工具,以便构建可执行文件。
2.debug 编译的含义debug 编译是一种编译方式,用于在编译过程中添加调试信息,以便于开发者在运行程序时能够追踪代码的执行过程,找出程序中的错误和问题。
3.Makefile 中的 debug 编译在 Makefile 中,要进行 debug 编译,需要使用一定的指令和规则。
通常,需要使用“CFLAGS”变量来指定编译器选项,其中包括添加调试信息的选项,例如“-g”。
同时,还需要使用“DEBUG”变量来指定是否进行debug 编译,例如,“DEBUG=on”表示进行 debug 编译,“DEBUG=off”表示不进行 debug 编译。
4.如何进行 Makefile debug 编译具体进行 Makefile debug 编译的步骤如下:(1) 在 Makefile 中设置“DEBUG”变量为“on”,例如,“DEBUG=on”;(2) 在 Makefile 中设置“CFLAGS”变量,添加调试选项“-g”,例如,“CFLAGS=-g”;(3) 保存 Makefile 文件;(4) 在命令行中,进入到 Makefile 所在的目录;(5) 执行“make”命令,进行编译。
这样,编译器就会在编译过程中添加调试信息,生成的可执行文件可以在运行时进行调试。
5.总结Makefile 是一种重要的构建工具,能够帮助开发者自动化构建和编译软件。
debug 编译是开发过程中常用的一种编译方式,可以帮助开发者找出程序中的错误和问题。
Makefile规则:target … : prerequisites…command……target就是一个目标文件,可以是Object File,也可以是可执行文件。
还可以是一个标签(Lable)。
prerequisites 就是要生成target所需要的文件或目标。
command 就是make需要执行的命令。
文件的依赖关系:target这一个或多个的目标文件依赖于prerequisites中的文件,其生成规则定义在command中。
如果prerequisites中的文件有一个以上的文件比target中的文件要新的话,则需要执行command定义的命令。
(Makefile规则)在Makefile中的反斜杠(\)表示换行的意思。
make命令解析Makefile文件。
如果要删除可执行文件和中间目标文件,只需要执行“make clean”。
edit : main.o kbd.o display.occ –o edit main.o kdb.o display.omain.o : main.c defs.hcc –c main.ckdb.o : kdb.c defs.hcc –c kdb.cdisplay.o : display.c defs.h command.hcc –c display.cclean:rm edit main.o kdb.o kdb.o在上个Makefile中,target(目标文件)包含:可执行文件edit和*.o(所有的中间目标文件)。
prerequisites(依赖文件)就是冒号后面的所有文件。
依赖关系:其实就是说明了目标文件是由哪些文件生成的,换言之,就是目标文件是哪些文件更新的。
make命令作用:比较target与prerequisites的日期,如果target日期比prerequisites新,不执行命令;否则(target日期不比prerequisites新或是target不存在),执行command命令,并更新或生成target。
CCS makefile文件编写前期预备知识Alternation and Grouping1 | 用法PUBLIC|PRIVA TE :表示匹配单词为PUBLIC或者PRIV ATE2 空格以用法PUBLIC (void|DWORD) :3 ^ 表示一行的开始处,[ \t] 表跟着多个空格或tabs.例子:^PUBLIC[ \t]+(void|int|long|DWORD) It matches, at the beginning of a line, the word "PUBLIC", followed by one or more spaces or tabs, followed by any one of the following words: "void", "int", "long" or "DWORD".Beginning and Ending of Line^PUBLIC:一行开头是PUBLIC。
\)$:一行结尾是圆括号。
^\)$ 这一行就只有一个圆括号。
Character Classes[AEIOUY aeiouy] :matches any vowel, whether upper or lower case.[0-9]will match any character between 0 and 9.^ 如果不用在开头字母上,放中间表示it just adds the up-caret to that class. Y ou may use it as a shorthand method of saying "match any characters except for the following: rather than specifying a large character class. For example, [^$.|(){}*+?^] matches anything except the eleven characters following the up-caret. Escape Sequences 转义字符Escape Meaning\n Newline (<CR><LF> or <LF>, depending on how it is defined for the document)\t Tab\b [Ctrl]-[H] (backspace)\r Carriage return\f form feed\nnn Octal value between 0 and 0377.\xnn Hexadecimal digit between 0x00 and 0xFF\m The literal character m.Note: When using escape sequences in C language source code, each backslash must also be escaped with another backslash. The resulting pattern specification is often unaesthetic.Iteration Qualifiersthe * matches any number of occurrences, the + matches one or more, and the ? matches zero or one.特例:\t* The example above will match any number of consecutive tabs, including none. By itself, it is not very useful to match none of something. As part of a larger regular expression, it could be quite useful. For our purposes here, the following might be preferable:\t+ This example matches one or more consecutive tabs. The tab is represented as \t, and the plus sign says "one or more of the previous." To match whitespace, we need to match spaces too. We don't know what order the spaces and tabs will come in, and we don't know how many there will be. These are signs that we need a character class.[ \t]+ The example above uses a character class containing a space and a tab. The + sign following it means that this Regular Expression will match any combination of spaces and tabs, so long as there is at least one space or tab.If you wanted to match the whitespace within a function call, where you knew there might be one space or tab, or there might be none, your expression could look like this:\([ \t]? This example searches for a left parenthesis followed by zero or one spaces or tabs. Since the left parenthesis is a meta-character it is necessary to escape or quote it with a preceding backslash. The \t we have used before to represent a tab character. The question mark says "zero or one of the preceding."Matching a CharacterThe basic unit of a regular expression is matching a single character. Y ou can match a single character in one of three ways:Literally,Ambiguously, orWith a Character Class.Y ou may match a character literally by using the character itself or the appropriate escape sequence. If matching a character literally is too limiting, you may match ambiguously, by using the dot ( . ) metacharacter. If a literal character is too narrow a match and the dot is too broad a match, a character class can be used for anything inbetween.Placing the CursorThe escape sequence that specifies cursor position is \c. An example of its use follows:singletons\[\c.*\]This example places the cursor at the beginning of whatever text is contained between the left and right square brackets. The square brackets are metacharacters and are therefore escaped. This cursor positioning facilitates editing the contents of the square brackets.Reference Groups and Replacement StringsRegex ExamplesRegular Expressions TipsRegular Expression SyntaxCharacter Description\ Marks the next character as special. To define a special character in a regular expression, precede the special character with the backslash character.Example: The regular expression /n/ matches the character n. The regular expression /\n/ matches a linefeed or newline character.^ Matches the beginning of input or line. In this implementation, this character cannot be defined in character set.$ Matches the end of input or line. In this implementation this character cannot be defined in a character set.* Matches the preceding character zero or more times. In this implementation cannot be defined if only one character is specified in the regular expression. That means that /zo*/ matches z and zoo, but /z*/ will match nothing because only one character has been specified.+ Matches the preceding character one or more times.? Matches the preceding character zero or one time. In this implementation cannot be defined if only one character is specified in the regular expression.. Matches any single character except '\n'.(pattern) Matches the pattern and remembers the match. The matched substring can be retrieved by using '\0'-'\9' in the regular expression, where '0'-'9' are the numbers of the pattern.Example: Regular expression '(re).*\0s+ion' will match 'regular expression'. First, the pattern ?re)?matches the first two letters of 憆egular expression?and the pattern is remembered with index 0. The pattern '*' matches 'gular exp' in 'regular expression'. The pattern 慭0?retrieves the pattern that has been remembered with index 0, and this 're' matches the second occurrence of 're' in 'regular expression'. Finally, the pattern 's+ion' matches 'ssion'.x|y Matches either the character 'x' or 'y'. Y ou can combine more than two characters. Example: 'x|y|z'.{n} Means the preceding character will match exactly n times (nonnegative).{n,} M eans the preceding character will match at least n times (nonnegative).{n,m} Means the preceding character will match at least n times and at most m times (both nonnegative).[xyz] A character set. Matches any one of the enclosed characters.[^xyz] A non-matching character set. Matches any character that is not in the set.\b Matches a word boundary, that is, the boundary between any character excluding space characters (" \f\n\r\t\v") and non-space characters.\B Matches a non-word boundary. Matches any boundary between space characters or between non-space characters.\d Matches any digit /0-9/\D Matches any non-digit.\e Marks the start position of text to extract; used in conjunction with \E.\E Marks the end position of text to extract; used in conjunction with \e. If the \E is not supplied, the end of line ($) will be used as the end position.\f Matches a formfeed.\n Matches a newline character.\r Matches a carridge return character.\s Matches any white space character.\S Matches any non-white space character.\t Matches a tab character.\v Matches any vertical tab character.\w Matches any word character including underscore. [A-Za-z0-9_]\W Matches any non-word character (any character that does not match \w).\num Where num is a value between 0 and 9. Matches remembered pattern. (See description of pattern.)/n/ Where n is a value between 1 and 255. Matches supplied in n ASCII code. Examples"FIND\e.+" M atches "FIND.+" but only returns the characters after "FIND""Find\e.+\ETheRest" Matches "Find.+TheRest" but only returns the characters between "Find" and "TheRest"."^SOURCE=\e.+$" Extracts all source files after the SOURCE=macro definition. "^.+\.obj\s*:\e.+$" Extracts all the source dependencies in a makefile."^\w+s*=\e.+$" Extracts all macro definitions.Searching for control characters (binary/hex data)Control characters can be used in both search and replacement patterns. Any byte value can be specified as part of a pattern. Perform the following steps to search for or replace binary or hex values.1. Go to Edit 郌ind (or Find/Replace, Find in Files, Replace in Files).2. Turn on Regular Expressions in the appropriate dialog.3. Then use the \x notation to specify hexadecimal values.Examples:To search for the form feed character, use this string:\x0c(That's backslash x zero c.)Make sure there are two digits following the x.To search for two consecutive bytes by hexadecimal value, string them together like this:\x0c\x0dIf you are replacing EOL characters, the following information will help to understand how CodeWright views and deals with End of Line characters.Generally, using '\n' for matching or replacing line ends is the suggested method in CodeWright (the '\' must be doubled when used in code). However, a special case is made for searching for and replacing hexadecimal 0D and 0A characters. Since thesecharacters 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 "\x0d" with "\n" would be good for converting a Macintosh file (opened with autodetect file type off).?Replacing "\n" with "\n" 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 CharactersCharacter 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 MakefilesY ou 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=c6xWhen running CodeSizeTune, the command line would be:gmake -makefile.mak TARG=c6x PBC_CMDFILE=-@C:\TEMP\PBCV ariantOptsUsing Regular ExpressionsA 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 "nat" 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 ExampleAdding Regular Expressions to Makefile ImportIn 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 "^SOURCE\e.+$" (without thequotes) to the Added Expression section by clicking the Add button.In this instance, "^SOURCE\e.+$" indicates that CCS will search the makefile for all lines containing source file information (e.g.SOURCE=<path>). The "^" and "$" characters indicate that theselines must have no additional or extraneous text.2.In the Regular Expression to Add, type "^INCLUDE\e.+$" (without thequotes). Press Add. In this instance, "^INCLUDE\e.+$" indicates that CCS will search the makefile for all lines containing header file information (e.g. INCLUDE=<path The "^" and "$" charactersindicate that these lines must have no additional or extraneoustext.1.Don’t press Finish yet!In the next exercise you will learn howto use the macro tool.Using MacrosMacros 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 \"$(INTDIR)\application.obj" \"$(INTDIR)\function1.obj" \"$(INTDIR)\function2.obj" \If we define WHICH_OBJ_DIR to equal "C:\winnt" (without quotes) within the makefile import tool, the generator will add the following text into the generated project file (.pjt):"C:\winnt\application.obj" \"C:\winnt\function1.obj" \"C:\winnt\function2.obj" \1.In the Macro Definition to Add field, enter: WHICH_OBJ_DIR2.In the Macro value field, enter: C:\winnt3.Click the Add button to add the macro. Your window should look likethe 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.。