①LED_SP.BIN:START.O LED.O
#led_sp. Bin is generated by START.O and LED.O
②arm-linux-ld-ttext 0x0-o led_sp.elf $^
Set the start address of Led_sp.elf 0x0
③arm-linux-objcopy-o binary led_sp.elf led_sp.bin
Copy the contents of the led_sp.elf into the Led_sp.bin
④arm-linux-objdump-d led_sp.elf > Led_sp_elf.dis
The disassembler of this program is written to the Led.dis file, which is not displayed in the terminal.
When you open Led.dis this file, you'll see the disassembler for the output of the above command.
⑤gcc mkv210_image.c-o mkmini210
GCC is compiled meaning, compile mkv210_image.c generate mkmini210
⑥./mkmini210 led_sp.bin 210.bin
Perform mkmini210 Led_sp.bin 210.bin
(These programs are downloaded in, perform mkmini210 led_sp.bin 210.bin)
⑦%.o:%. S
Put all the. s files are compiled into an. o file
⑧arm-linux-gcc-o [email protected] $<-C
Only activates preprocessing, compilation, and assembly, that is, he only makes the program obj file
%.O:%.c
Compile all. c files into an. o file
Arm-linux-gcc-o [email protected] $<-C
⑨Clean:
RM *.o *.elf *.bin *.dis mkmini210-f
RM: (remove, removal)
Remove all 1.o,2.elf,3.bin,4.dis, 5mkmini210, 6-f
*: Wildcard characters (all. O,,,,)
-------------------------------------------------------------------
One
Arm-linux-ld-ttext 0x00000000 CRT0.O Led_on_c.o-o LED_ON_C_TMP.O
Let's see what it means:
The-o option sets the output file name to LED_ON_C_TMP.O;
"--ttext 0x00000000" setting the starting address of the code snippet is 0x00000000;
The purpose of this instruction is to connect CRT0.O and LED_ON_C.O to the LED_ON_C_MP.O executable file ,
The code snippet for this executable file begins with the address 0x00000000.
Two
Arm-linux-objcopy
is used to copy the contents of one destination file into another file, which can be used for format conversion between different source files
Three
$^ the collection of all dependent targets. separated by a space. If there are multiple duplicates in the dependent target, the variable
Will remove duplicate dependent targets and keep only one copy.
[email protected] represents the set of target files in the rule. In a pattern rule, if there are multiple targets, then "[email protected]" is matched to
The collection of schema definitions in the target.
************************************************
Linux beginners, sincerely hope to come to the friends of the message, so I also know where there are problems ^_^ Thank you!!
Makefile resolution (the simplest LED)