I am trying to use Xcode as an editor for microcontroller code. I want to use the Build, Run buttons. How can i use those to trigger a script that compiles the program ? I already have a script that works on the command line. I need to pass some parameters, like filename and maybe a couple of options. I am using SDCC which is an 8501 compiler. Is it possible to create a custom target or something in Xcode so it calls the script and passes the filename or parameters? Any examples on how to do this? Of course i can't use GCC for this.
Well, you need to create "External Build System" project:
If you want to set a separate script as a run command than:
I usually use just one script for all (set as run script). In this case just leave arguments on target's "Info" tab empty.
Edit: for make as a build tool no need to pass any arguments, just set Directory appropriately and make will find Makefile there.