I'm trying to make command-line build working properly with AS7 (running Win7, 64-bit). I've tried two solutions, but none of them work quite right.
I did as instructed on this page: https://avrstudio5.wordpress.com/2012/05/08/build-atmelstudio-projects-from-command-line/
c:\EXAMPLE1> atmelstudio.exe EXAMPLE1.cproj /build debug /out foo.txt
I could even replace EXAMPLE1.cproj with *.cproj, and it would automatically build whatever it found in the working directory. Brilliant!
However, the output can apparently only be sent to a text file, which means that my text editor can't capture it. I have found no way to direct the output to console. If this can be done, I guess that the problem is solved.
I found this advice from Cliff, which apparently works in AS6: https://www.avrfreaks.net/forum/build-atmel-studio-project-command-line
In short, I must make paths to make.exe and avr-gcc.exe, and then run make -f in the working directory. Well, it doesn't work directly in AS7 (at least not in my installation), but I can make it work if I replace -f with the target name.
[Source path]\Debug make.exe [Target name]
This works, and my text editor can capture the output. But I obviously can't create a generic, permanent user tool that just runs make.exe on any project that I have decided to open. I need to change the target name when I switch between projects. OK, I can probably live with that, but it would be nice to have it working properly.
If I don't specify a target name, the compiler just tries to compile the first .c file it stumbles upon in the makefile, and leaves it at that. So I guess that AS7 has left something out in the makefile (the target name?), but I can't figure out how to put it there. Anyone?
I can't believe that I'm the only one trying to do this, but I haven't been able to find anything about it. Probably using the wrong search parameters...
3. Just to mention it (before anyone else does): The third solution is to keep Atmel Studio 7 open in parallel with the text editor, and then just use AS7 for building. But then solution 2 is better by far.
Does anyone have THE optimal solution, to end all other solutions?