Page 1 of 1

Crazyradio compile

Posted: Mon Nov 10, 2014 4:14 pm
by e-Rok
Hi,

I'm confused as to what the following commands are doing. I have extracted sdcc 3.2 to a different directory. All of the makefiles compile source in the local directory, but I'm not sure if the terminal commands are important for anything that I might need in the future.

Code: Select all

[crazyradio]$ export SDCC=~/sdcc/bin/sdcc
[crazyradio]$ make
mkdir -p bin
/home/arnaud/sdcc/bin/sdcc -Iinc/ --model-medium -c src/main.c -o bin/main.rel
/home/arnaud/sdcc/bin/sdcc -Iinc/ --model-medium -c src/radio.c -o bin/radio.rel
/home/arnaud/sdcc/bin/sdcc -Iinc/ --model-medium -c src/usb.c -o bin/usb.rel
/home/arnaud/sdcc/bin/sdcc -Iinc/ --model-medium -c src/usbDescriptor.c -o bin/usbDescriptor.rel
/home/arnaud/sdcc/bin/sdcc -Iinc/ --model-medium -c src/led.c -o bin/led.rel
/home/arnaud/sdcc/bin/sdcc --xram-loc 0x8000 --xram-size 2048 --model-medium bin/main.rel bin/radio.rel bin/usb.rel bin/usbDescriptor.rel bin/led.rel -o bin/cradio.ihx
objcopy -I ihex bin/cradio.ihx -O binary bin/cradio.bin
[crazyradio]$ 

Re: Crazyradio compile

Posted: Tue Nov 11, 2014 7:19 am
by whoenig
What do you want to know exactly? The "export" command is only needed in order to enable make to work correctly (otherwise it wouldn't find the compiler). Make itself creates object files for every source file and later links all those object files together to get the resulting hex file.

Re: Crazyradio compile

Posted: Tue Nov 11, 2014 3:53 pm
by e-Rok
When I run the make command, do I need to specify creating the bin directory as well? Also are the lines following mkdir -p bin print statements from the Makefile?

Re: Crazyradio compile

Posted: Tue Nov 11, 2014 5:52 pm
by whoenig
The lines between "[crazyradio]$ make" and "[crazyradio]$ " are essentially a list of what make executes. Hence, it creates the bin output folder for you (if it does not exist already).

Re: Crazyradio compile

Posted: Wed Nov 12, 2014 3:03 pm
by e-Rok
Thanks for clarifying.