Make file to build an application

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Make file to build an application

Jump to solution
2,324 Views
saravanakumar_m
Contributor I

Hi,

 

I am building my application for S12XEP100 with the help of a MAKE file.The application uses XGATE. Hence i extended the sample make file found in code warrior examples to compile .cxgate files too.

 

I added the bold highlighted line in the "build object file list ..."  section:

 

# build object file list with search and replace operation
CPP_OBJ_FILES = $(SOURCE_FILES:.cpp=.o)
CXX_OBJ_FILES = $(CPP_OBJ_FILES:.cxx=.o)
C_OBJ_FILES = $(CXX_OBJ_FILES:.c=.o)
XC_OBJ_FILES = $(C_OBJ_FILES:.cxgate=.o)
S_OBJ_FILES = $(XC_OBJ_FILES:.s=.o)
ALL_OBJ_FILES = $(S_OBJ_FILES:.asm=.o)

 

but i get the following make error:

 

C:\Projekt\Internal\MAKE\reference\xgate\XGATE_MakeFile\default.mak: ERROR M5022
: Don't know how to make "xgate.oxgate"
C:\Projekt\Internal\MAKE\reference\xgate\XGATE_MakeFile\default.mak: ERROR M5022
: Don't know how to make "MakeProject.abs"
C:\Projekt\Internal\MAKE\reference\xgate\XGATE_MakeFile\default.mak: ERROR M5022
: Don't know how to make "all"
C:\Projekt\Internal\MAKE\reference\xgate\XGATE_MakeFile\default.mak: ERROR M5022
: Don't know how to make "all"
Maker: *** 4 error(s), 1 warning(s), 4 information message(s) ***

 

the highlighted thing shows something is wrong with the line i inserted.

 

can anyone help on this ?

 

thanks,

Saravana

Labels (1)
Tags (1)
0 Kudos
1 Solution
849 Views
CompilerGuru
NXP Employee
NXP Employee
Replace first .cxgate with .o
and then .c with .o,
the .c extension matches  .cxgate too.

Daniel

View solution in original post

0 Kudos
4 Replies
850 Views
CompilerGuru
NXP Employee
NXP Employee
Replace first .cxgate with .o
and then .c with .o,
the .c extension matches  .cxgate too.

Daniel
0 Kudos
849 Views
saravanakumar_m
Contributor I

Hi Daniel, Thanks for the solution..

 

i have two more questions regarding using the maker..

 

My make was successful. But when i observed the map file and compared it with the one generated by the IDE, i see in the FILE section in the map file that the order of compilation of files by the ide and the make are different. And this results in completely different s19 files.

 

Even when i tried to enter the file order in the make file like it is by the IDE map file, i run into a problem that the object files from the ANSI library are placed as the last in the FILE section in the make map file whereas they come somewhere in the middle in the IDE map file.

 

Is there a way to get exactly the same s19 files IDE and make ?

 

Also i see that in the S19 file generated by the ide, the first line which is a S0 record contains a ASCII string which when i decoded was a string that stored the complete path of my .ABS file like C:\Project\Test\Test.ABS whereas in the make generated S19 file it was just the name of the .ABS file.

 

How to prevent the ide from including the complete path of the .ABS file in the S19 file ?

 

Thanks,

Saravana

0 Kudos
849 Views
CompilerGuru
NXP Employee
NXP Employee

There is a echo command line checkbox in preferences of all the build tools in the ide.

Enable the checkbox for the linker to see exaclty how the options are passed to the tools.

When you call the tools with the same options, you should get the same binary. As you noted some

pieces like the order of object files passed to the linker does matter, but with the make you have control over every detail (maybe only when not using some of the automatisms in the sample makefile though).

 

The instruction to include the path is controlled via command line option, just check the command lines.

Depending on which s19 you look at, it might be in the linker options or in the burner options (might also be that you are comparing a linker generated s19 with a burner generated one). In the end, the s0 record does not really matter.

 

Daniel

0 Kudos
849 Views
CompilerGuru
NXP Employee
NXP Employee

There is a echo command line checkbox in preferences of all the build tools in the ide.

Enable the checkbox for the linker to see exaclty how the options are passed to the tools.

When you call the tools with the same options, you should get the same binary. As you noted some

pieces like the order of object files passed to the linker does matter, but with the make you have control over every detail (maybe only when not using some of the automatisms in the sample makefile though).

 

The instruction to include the path is controlled via command line option, just check the command lines.

Depending on which s19 you look at, it might be in the linker options or in the burner options (might also be that you are comparing a linker generated s19 with a burner generated one). In t

 

Daniel

0 Kudos