Makefile resolution (the simplest LED), makefile resolution led
① 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 to 0x0.
③ Arm-linux-objcopy-O binary led_sp.elf led_sp.bin
Copy the content in led_sp.elf to led_sp.bin.
④ Arm-linux-objdump-D led_sp.elf> led_sp_elf.dis
Write the disassembly program of this program into the led. dis file, which is not displayed on the terminal.
When you open the led. dis file, you will see the output disassembly program of the above command.
⑤ Gcc mkv210_image.c-o mkmini210
Gcc indicates compilation. Compile mkv210_image.c to generate mkmini210.
⑥./Mkmini210 led_sp.bin 210.bin
Run mkmini210 led_sp.bin 210.bin.
(Download these programs and run mkmini210 led_sp.bin 210.bin)
7%. o: %. S
Compile all. S files into. o files
Running arm-linux-gcc-o $ <-c
Only activate preprocessing, compilation, and assembly, that is, he only makes the program into an obj file.
%. O: %. c
Compile all. c files into. o files.
Arm-linux-gcc-o $ <-c
⑨ Clean:
Rm *. o *. elf *. bin *. dis mkmini210-f
Rm :( remove, remove)
Delete all 1.o, 2.elf, 3.bin, 4.dis, 5mkmini210, 6-f
*: Wildcard (all. o ,,,,)
-------------------------------------------------------------------
I
Arm-linux-ld-Ttext 0x00000000 crt0.o led_on_c.o-o led_on_c_tmp.o
Let's see what it means:
-O option: Set the name of the output file to led_on_c_tmp.o;
"-- Ttext 0x00000000" sets the starting address of the code segment to 0x00000000;
The role of this command isConnect crt0.o and led_on_c.o to the led_on_c_mp.o executable file.,
The starting address of the executable code segment is 0x00000000.
II
Arm-linux-objcopy
Used to copy the content of a target file to another file. It can be used for format conversion between different source files.
3.
$ ^ A set of all dependent targets. Separated by spaces. If there are multiple duplicates in the dependency target, that variable
Duplicate dependency targets are removed and only one copy is retained.
$ @ Indicates the target file set in the rule. In a pattern rule, if there are multiple targets, "$ @" matches
Set of Schema definitions in the target.
**************************************** ********
For Linux beginners, I sincerely hope to leave a message to my friends so that I know where the problem is. Thank you !!