1. Compile a single C source file and produce a target file
Cc-c one.c
This command produces a target file named ONE.O.
2. Compile multiple C source files and generate a target file for each file
Cc-c one.c two.c three.c
This command produces 3 target files: one.o, TWO.O, THREE.O
3. Link a single target file
CC ONE.O
This command produces an executable file named A.out.
4. Link multiple target files
CC ONE.O TWO.O THREE.O
This command produces an executable file named A.out.
5. Compile and link a C source file
CC ONE.C
This command produces an executable file named A.out. A target file named ONE.O is generated in the middle, but it is deleted when the link process is complete.
6. Compile and link multiple C source files
CC ONE.C TWO.C three.c
This command produces an executable file named A.out. When more than one source file is compiled, the destination file is not deleted. This allows you to make changes to the program and recompile only the source files that have been changed.
7. Compile a C source file and link it to the existing target file
CC ONE.O TWO.O three.c
This command produces an executable file named A.out.
8. The above can produce executable file instructions can be added to the "-O name" option, the resulting executable is called name
Like Cc-o ABC one.c.
This command produces an executable named ABC.
9. Execute executable file
./a.out
This instruction can execute a executable file named A.out.
Clang instruction for the
C language Learning Note (ii)