You need to create a FabISP as a first exercise for working with electronics. But what if you don't have another FabISP or a commercial ISP to program it? You can use any Arduino UNO for this task.
Under File > Examples > ArduinoISP you can find the code you need to upload to your Arduino in order to transform it into an ISP:
This is the right code:
If you check the code, you will find the configuration for connecting the Arduino to the FabISP. So there they are (plus, of course GCC connected to 5V and GND connected to GND).
// slave reset: 10: 53 // MOSI: 11: 51 // MISO: 12: 50 // SCK: 13: 52
You can then upload the code to your Arduino. Note: This step needs to be done while the Arduino is still not connected to the board you need to program, or you will get an error.
According to the setup of the code, you can then connect Arduino with your FabISP, something like this:
Inside your Makefile for the configuration of your FabISP firmware, you need to use this setting:
AVRDUDE = avrdude -c stk500v1 -b19200 -P /dev/tty.usbmodem1411 -p $(DEVICE)
How do I know which is the port my Arduino is attached to? Open the Arduino IDE, and check under Tools > Port. Then substitute /dev/tty.usbmodem1411 with your specific port.