Introduce a file in a makefile file by using include
Include $ (shell./getname)
and the contents of the GetName are as follows:
pwd=$ (PWD);
if ["${pwd#*/zloader.}" = "$pwd"];then
Echo Makefile.cpci
Else
echo Makefile.${pwd#*/zloader.}
fi
I've never read ${pwd#*/zloader.} What does this mean, and then it turns out that what you get is the suffix name of the make file.
If it's pwd=/xxx/yyy/zloader.bios, then you need to get Makefile.bios, where ${pwd#*/zloader.} = BIOS. Where ${AAA#BBB} is a regular expression, and '/* ' represents all of the preceding Zloader in the path string in the PWD.
Explain:
${parameter#pattern}
Substitute the value of parameter with patternremoved to the left side. The smallest portion of the contents of parametermatching pattern is removed. Shell filename substitution characters (*,?, [...],!, and @) May is used in.
Try a script under Linux to prove it.
#!/bin/sh
Mkdir-p Zloader./xxdir
CD Zloader./xxdir
pwd=$ (PWD)
echo "pwd = $pwd"
echo "This'll substitue pwd about the Patternzloader., into NULL"
echo "${pwd#*/zloader.}"
Cd.. /..