Crazyradio compile

Post here to get support
Post Reply
e-Rok
Beginner
Posts: 25
Joined: Fri Sep 12, 2014 4:30 pm

Crazyradio compile

Post 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]$ 
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: Crazyradio compile

Post 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.
e-Rok
Beginner
Posts: 25
Joined: Fri Sep 12, 2014 4:30 pm

Re: Crazyradio compile

Post 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?
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: Crazyradio compile

Post 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).
e-Rok
Beginner
Posts: 25
Joined: Fri Sep 12, 2014 4:30 pm

Re: Crazyradio compile

Post by e-Rok »

Thanks for clarifying.
Post Reply