EmbDev.net

Forum: µC & Digital Electronics Atmel Studio: how to change compiler output directory?


von Markus G. (grabner)


Rate this post
useful
not useful
Hi!

I have two projects in one Atmel Studio 6.1 solution which share some 
source files, but are compiled for different controller types. When one 
project is compiled, the resulting object files are unusable for the 
second project since the object files are stored at the same location 
for both projects. This could easily be solved by specifying different 
object file directories for the two projects.

In Visual Studio (which Atmel Studio is based on), one can freely choose 
the output directory, but I couldn't find a similar option in Atmel 
Studio. Does anybody know how this can be done in Atmel Studio (either 
in the IDE or by some compiler options)?

Thanks & kind regards,
Markus

von Jacy Jung (Guest)


Rate this post
useful
not useful
Oh, I faced this problem so often :)

I would recommend you creating one directory, call it eg. "project". In 
this directory you create a subdirectory "universal" with files that are 
independent from the controller type. In that "universal" directory you 
have one entry file, for example "universal.c" which includes all 
necessary headers and files.

Then, create a second subdirectory in the "project" directory, call it 
eg. "ATMega8". In this directory you create a project that uses the 
specific controller (in this case ATMega8). In the "main.c" you #include 
the "universal.c". For this, you have to add the directory path 
"..\..\universal" in the compiler settings.

Like this, you can create multiple other subdirectories in the "project" 
folder for other controller types and you don't have to create redundand 
code.

I hope I explained it understandable :)

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.