CodeWarrior 10.6 creating a Release folder within Debug folder and vice versa

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

CodeWarrior 10.6 creating a Release folder within Debug folder and vice versa

Jump to solution
1,122 Views
frankbaird
Contributor III

Until recently my project used only the Debug target. I decided to get the Release target working as well. Before my project contained a Debug folder and a Release folder, but now my Debug folder also contains a Release folder, and my Release folder contains a Debug folder.

 

125389_125389.pngcw folder confusion.png

 

I am certain the folders Debug/Release and Release/Debug were not there before. I now have 3 new lines Debug/sources.mk (the last 3 lines):

 

# Every subdirectory with source files must be described here

SUBDIRS := \

Sources \

Sources/_Screens \

Sources/_Components \

Release/Sources \

Release/Sources/_Screens \

Release/Sources/_Components \

 

and in Debug/makefile have these 3 new lines:

 

-include Release/Sources/subdir.mk

-include Release/Sources/_Screens/subdir.mk

-include Release/Sources/_Components/subdir.mk

 

Similarly Release/sources.mk contains

 

# Every subdirectory with source files must be described here

SUBDIRS := \

Sources \

Sources/_Screens \

Sources/_Components \

Debug/Sources \

Debug/Sources/_Screens \

Debug/Sources/_Components \

 

and Release/makefile contains

 

-include Debug/Sources/subdir.mk

-include Debug/Sources/_Screens/subdir.mk

-include Debug/Sources/_Components/subdir.mk

 

It turns out that these "extra" directories contain nothing. They do have folders in them, but every folder contains only a subdir.mk file in them. If they were eliminated entirely, it would not cause any compilation problems.

 

125399_125399.pngcw folder confusion2.png

Please tell me how to get rid of them.

Labels (1)
0 Kudos
1 Solution
856 Views
frankbaird
Contributor III

Erich,

Well I finally figured out how to stop this behavior. You may have been saying the same thing as what I found, but I just didn't understand you clearly.

The key to getting rid of the extra directories is to get rid of the extra makefiles. To do this, I need to tell CW to ignore certain files for each build target.

Choose the Release target (go to Project -> Build Configurations -> Set Active -> Release).

In the CodeWarrior Projects tab, choose the Debug folder (the Debug folder one level below the project, not the Debug folder within the Release folder). Then for the Sources directory, and the files makefile, makefile.local, objects.mk, and sources.mk, right-click the folder or file, choose Properties. Then under C/C++ Build -> Settings, uncheck the checkbox “Exclude resource from build.”

pastedImage_1.png

Then do the same for the Release folder under the Debug target.

Perform a clean build of both targets, and the extra folders should be gone.

Thanks to all who gave me hints at what to do.

View solution in original post

0 Kudos
7 Replies
857 Views
frankbaird
Contributor III

Erich,

Well I finally figured out how to stop this behavior. You may have been saying the same thing as what I found, but I just didn't understand you clearly.

The key to getting rid of the extra directories is to get rid of the extra makefiles. To do this, I need to tell CW to ignore certain files for each build target.

Choose the Release target (go to Project -> Build Configurations -> Set Active -> Release).

In the CodeWarrior Projects tab, choose the Debug folder (the Debug folder one level below the project, not the Debug folder within the Release folder). Then for the Sources directory, and the files makefile, makefile.local, objects.mk, and sources.mk, right-click the folder or file, choose Properties. Then under C/C++ Build -> Settings, uncheck the checkbox “Exclude resource from build.”

pastedImage_1.png

Then do the same for the Release folder under the Debug target.

Perform a clean build of both targets, and the extra folders should be gone.

Thanks to all who gave me hints at what to do.

0 Kudos
856 Views
BlackNight
NXP Employee
NXP Employee

Hi Frank,

the path/folder for this is defined as 'Build Location' here:

pastedImage_0.png

Can you check your settings?

Erich

0 Kudos
856 Views
frankbaird
Contributor III

Erich,

I have checked those. You can see the Debug target uses the Debug directory and the Release target uses the Release directory.

pastedImage_0.png

pastedImage_1.png

I've noticed that these "extra" directories have nothing in them except subdir.mk files. They are apparently being created by the Makefiles. So there is something causing the automatic makefile generation to think these folders need to be created. Any idea where this is controlled?

0 Kudos
856 Views
BlackNight
NXP Employee
NXP Employee

Could it be that you you somehow compile files from Debug or Release folder?

Other than that, it would be helpful if you could share your project (you might remove source files).

Erich

0 Kudos
856 Views
frankbaird
Contributor III

If that was the case, I would expect these extra folders to have some .o files in them. But all that is there is the .mk files. If you look at the end of my original post, you can see that there are some lines in the makefile that shouldn't be there. If I could get rid of those lines, these extra directories should stop being created.

0 Kudos
856 Views
trytohelp
NXP Employee
NXP Employee

Hi Frank,

Hum.

I've created a short example with the wizard but was not able to reproduce the problem on my side.

I recommend you to Clean (all) and re-build the project.

Is it linked to your project ? ... I don't know.

Have a great day,
Pascal
NXP Technical Support

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

0 Kudos
856 Views
frankbaird
Contributor III

Pascal, I have done that, several times.

If you look at the end of my original post, you can see that there are some lines in the makefile that shouldn't be there. If I could get rid of those lines, these extra directories should stop being created.

0 Kudos