Building with makefile

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

Building with makefile

9,342 Views
BAN
Contributor II
Hi!
 
I'm trying to build my application with a makefile according to TN 251 without using the IDE.
 
This application has previously been sucessfully built in the IDE so when setting the flags for the compiler, assembler and linker I'm just copying the Command line argument from the Target settings in the IDE assuming that it's on the same format as used in the makefile. This will however not work! The compiler will not find the .c files in the first place. Here is the argument string : -CpPPAGE=RUNTIME -D_HCS12 -D__NO_FLOAT__ -D_8_FUNC_SYS -La=%f.inc -Lasm=%n.lst -Mb -TuC -WmsgSd2705 -WmsgSd6000. Seems like something is omitted. For example I can not see the -I flag. Would be nice to somewhere find the syntax to be used when running the compiler from DOS (makefile).
 
My question: Is this Command Line Arguments from the IDE the same as used in the makefile or does it have to be converted in some way???
 
I'm running CodeWarrior Development Studio for Freescale HCS12(X) Microcontrollers v4.6, build 6345
 
 
 
 
Labels (1)
Tags (1)
23 Replies

4,975 Views
RCD_Dime
Contributor II

I need to get my existing project building with makefiles also.

 

Where can I find TN 251?  

 

I can't seem to get it to come up when searching through the Support Documents.

 

Thanks

0 Kudos
Reply

4,975 Views
CrasyCat
Specialist III

Hello

 

Find attached a .zip file containing the TN251 as well as a sample make file.

 

CrasyCat

0 Kudos
Reply

4,975 Views
ssinfod
Contributor IV

Can you upload the file TN251 again. It is not in the page anymore.

Thanks

ssinfod

0 Kudos
Reply

4,975 Views
trytohelp
NXP Employee
NXP Employee

Hi,

I don't find the doc but I've found it on the web at the link:

      http://wenku.baidu.com/view/5b837506cc1755270722087a

Have a great day,
Pascal Irrle

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

4,975 Views
ssinfod
Contributor IV

Ok, thanks.

I made a PDF from that link. It is attached as PDF.

Thanks

ssinfod

0 Kudos
Reply

4,975 Views
RCD_Dime
Contributor II

Thanks for the quick reply.

 

 

I haven't got a chance to look at it yet but is TN 251 applicable for the HCS08 processors as well as the HC12?

0 Kudos
Reply

4,975 Views
CrasyCat
Specialist III

Both are pretty similar, but attached is the HC08 version.

 

CrasyCat

0 Kudos
Reply

4,975 Views
ssinfod
Contributor IV

Can you also upload the file for the HCS08. It is not in the page anymore.

Thanks

ssinfod

0 Kudos
Reply

4,975 Views
RCD_Dime
Contributor II
Thanks!
0 Kudos
Reply

4,975 Views
BAN
Contributor II

Hello!

Wy wont this work then?

%INSTALLPATH%\prog\hiwave.exe ..\bin_8f\E1178_8f.abs.s19 -W -Prod=..\Simulator.ini -instance=sim

hiwave reports "Failed to load "..\bin_8f\E1178_8f.abs.s19"

 

//B

0 Kudos
Reply

4,975 Views
CompilerGuru
NXP Employee
NXP Employee
In my understanding, all relative paths (except the one to the project file, of course) are relative to the directory of the project file. So first the tools are using the OS current directory to locate the project file as given by the -prod option, and then all other files are located with paths relative to the project file (and with the search paths contained in the project file).

So I guess (you did not mention where the files are located on your disk, or what the current directory is
in your setup) try bin_8f\E1178_8f.abs.s19.

Daniel

BTW. Why using the srecord (*.s19) and not the elf file (*.abs)?
0 Kudos
Reply

4,975 Views
BAN
Contributor II

Hello!

 

I have now reshaped my directory structure so I’m no longer forced to use ../ . When only using ./, relative paths are not a problem.

 

Some other problems. When starting to convert the make file from TN 251 for my purposes the make file still had the ability to only recompile changed .c files but somewhere I seem to have lost this feature. This means that all files are recompiled and linked even if nothing has changed.

 

I wonder if the dependency file and the –Lm and –LmCfg options have any connection to this feature??

My compiler settings:

CCFLAGS_COMMON=       -CpPPAGE=RUNTIME -Lm=$(DEP_LIST_FILE) -LmCfg=ilmu $(ENVOPTIONS) -D_HCS12 -D__NO_FLOAT__ -D_8_FUNC_SYS -La=%f.inc -Lasm=%n.lst
-Mb -TuC -WmsgSd2705 -WmsgSd6000 $(ENVOPTIONS)

 

At some point I had to move the position of the dependency file, otherwise the compiler could not find it.  Are there any rules for where the dependency file should be stored?

 

//BAN

0 Kudos
Reply

4,975 Views
CrasyCat
Specialist III
Hello
 
The file should be available in one of the directories enumerated in the GENPATH environment variables.
I would also make sure this path is specified in the -ENV"GENPATH= ..." option you are using to start the make utility.
 
CrasyCat
0 Kudos
Reply

4,975 Views
BAN
Contributor II
Hello!
 
I can now control where the dependency file is stored and found but may basic problem still exists: Everything is rebuild everytime even if nothing has changed!! Which part of the makefile 'senses' that a file has to be rebuild?? I have attached my makefile, renamed from .mak to .txt so it can be sent...
 
BAN
 
 
0 Kudos
Reply

4,975 Views
CrasyCat
Specialist III
Hello
 
What is the command line you are using to start the maker?
 
CrasyCat
0 Kudos
Reply

4,975 Views
BAN
Contributor II
Hello!
 
This is the commandline from my start .bat file.
 
For some reason I have to specify GENPATH with at least .\Sources at the commandline. In the TN 251 all '-ENV' stuff are done inside the makefile but this will not work for me. Why??
 
INSTALLPATH%\prog\piper.exe %INSTALLPATH%\prog\maker.exe -ENV"GENPATH=.\Sources" DINSTALLPATH=%INSTALLPATH%display_8f.mak

/BAN

0 Kudos
Reply

4,975 Views
CrasyCat
Specialist III
Hello
 
Try to add -env"OBJPATH=.\MD2_display_Data\Display_8lever\ObjectCode\" to your command line when you start the make utility.
 
CrasyCat
0 Kudos
Reply

4,975 Views
BAN
Contributor II
Hi!
 
YES, it works!!! THANK YOU!
 
I have never tried to test the original makefile in TN 251 but the command line in this document does not have this '-env"OBJPATH' and I assume it only compiles changed files anyway. Do you have any idea why??
 
//ban
0 Kudos
Reply

4,975 Views
CrasyCat
Specialist III
Hello
 
In fact when the make utility needs to know where the object files are located in order to be able to determine whether a .o file needs to be rebuild.
 
This is done independently of the compiler. So maker needs to know where to look for object files.
 
CrasyCat
0 Kudos
Reply

4,975 Views
BAN
Contributor II
Hi!
 
Works fine, thank you!!
 
Another problem: After building with the makefile I'm starting the debugger (hiwave.exe) and this one seems to require params with absolute paths. This will not work for me since I'm working in a version-controlled environment and the files could be checked out to any directory. This is the start commando:
 
%INSTALLPATH%\prog\hiwave.exe P:\Projekt\Mandon_8f\Display\versionhanterat\Makefile_test\bin_8f\E1178_8f.abs.s19 -W -Prod=P:\Projekt\Mandon_8f\Display\versionhanterat\Makefile_test\Simulator.ini -instance=sim
 
Is there a way to give relative paths to the .19 and .ini files??
 
 
0 Kudos
Reply