Makefile

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
doch_3739346
Level 4
Level 4

Inside project top level, Debug and Release folder, there are three makefile.

1. What's relationship between these three makefile.

2. Why Project - Build All will regenerate Debug/Release makefile.

3. How to modify makefile to add more files to target clean.

pastedImage_2.png

0 Likes
1 Solution
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

Can you use the following way:

In the 'Make Target' folder of eclipse as shown below:

pastedImage_0.png

You can see your project. Right click on the 'Debug' folder of your project and a window as below appears:

pastedImage_0.png

Then, the following can be changed in the window which appears:

pastedImage_2.png

Then under the debug folder, your new make target appears as below:

pastedImage_3.png

So, after you perform usual 'clean project', you can run this make target to delete *img file.

In this way, you can modify your custom_clean as required.

Regards,

Hemanth

Hemanth

View solution in original post

0 Likes
6 Replies
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

1. The three make files objects.mk, subdir.mk and sources.mk are included in 'makefile'.

    You can see the following statements in the 'make' file:

-include sources.mk

-include subdir.mk

-include objects.mk

     During build process, objects.mk determines what libraries are to be included and subdir.mk; sources.mk determines the input and output files.

2.

a. The libraries to be used in a build can be changed in the project settings in the following location (using eclipse IDE):

Project Properties -> C/C++ General -> Paths and Symbols -> Libraries

b. New .c/.h files can directly be pasted into the project source files folder or by doing File->New

When either of these/both are performed the content of the objects.mk and sourecs.mk automatically gets updated when you build the project.

That is the reason these files are regenerated for each build.

Regards,

Hemanth

Hemanth

Thanks for the details, I still have 3 questions:

1. Could you tell me more about relationship between makefiles. I can see three makefiles in a project, as below screenshot, one in Debug folder, one in top level, the other one not shown is in Release folder. What's the relationship between these three makefiles.

pastedImage_0.png

2. Tried updating makefiles in Debug and Release folders with more objects to delete for job clean. But if I run 'Clean Project' and 'Build Project', makefile inside Release folder will be reset to original content. Is there a way to prevent this.

3. For top level makefile FX3FWROOT is pointing to SDK install path?

pastedImage_5.png

pastedImage_6.png

0 Likes

Found the reason, by default, Debug/makefile is auto generated.

If un-check "Generate Makefiles automatically", manually edit makefile, then it can remove all unwanted files.

pastedImage_0.png

pastedImage_2.png

pastedImage_1.png

0 Likes
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

Yes you are right. When 'Generate Make files automatically' is unchecked, the make files in debug/release folder will not update automatically.

But, when you add more source files to your project which is in your Workspace, then those files will not be included while build process.

You would have to manually modify the make file accordingly.

Regards,

Hemanth.

Hemanth
0 Likes
doch_3739346
Level 4
Level 4

Hi Hemanth,

Thanks for confirming the behaviour.

I definitely want the auto update project feature and also want to delete*.img. I guess maybe there is a makefile "template" saved somewhere. How can we modify the default makefile behaviour?

0 Likes
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

Can you use the following way:

In the 'Make Target' folder of eclipse as shown below:

pastedImage_0.png

You can see your project. Right click on the 'Debug' folder of your project and a window as below appears:

pastedImage_0.png

Then, the following can be changed in the window which appears:

pastedImage_2.png

Then under the debug folder, your new make target appears as below:

pastedImage_3.png

So, after you perform usual 'clean project', you can run this make target to delete *img file.

In this way, you can modify your custom_clean as required.

Regards,

Hemanth

Hemanth
0 Likes