Because the company needs to program in Linux, I have been spoiled by windows for a long time, so I think that it is difficult for programmers to become small files.
There are many makefile tutorials on the Internet, so I will not detail them here. Go to Dongdong to ask Baidu and Google.
The following shows a simple sample. mk file.
Get started with makefile.
Test. mk
# Ifndef ver
Ver: = all
# Endif
Clear:
@ If [$ (VER) = "debug"]; then/
Rm-RF Debug. Out ;/
Fi
@ If [$ (VER) = "release"]; then/
Rm-RF release. Out ;/
Fi
@ If [$ (VER) = "all"]; then/
Rm-RF Debug. Out ;/
Rm-RF release. Out ;/
Fi
@ Echo --- finish clear ---;
Run the following command line:
Make-F test. mk
In this case, the variable ver is set to all.
The following two commands are executed.
Rm-RF Debug. Out ;/
Rm-RF release. Out ;/
Of course, you can also enter the ver to the value in the command line:
Make-F test. mk ver = release
In this way, you can input different Ververs to the command line to perform different operations.
Note that the line where the command description is located must start with a Tab character.
Otherwise, the make command cannot recognize the command.