i have a code as
echo -e "\\n" "===== Making: $(@D)\n";\
if [ ! -d $(@D) ]; then \
mkdir $(@D); \
else \
if [ -e $(@D)\PackageBuild.error ]; then \
rm $(@D)\PackageBuild.error;\
fi; \
i am not sure what this @D is doing. can someone help me out here
' $(@D) ' The directory part of the file name of the target, with the trailing slash removed. If the value of ' $@ ' is dir/foo.o then ' $(@D) ' is dir .
Example of command substitution using $() in Linux: Again, $() is a command substitution which means that it “reassigns the output of a command or even multiple commands; it literally plugs the command output into another context” (Source).
In order to check if a directory exists in Bash, you have to use the “-d” option and specify the directory name to be checked. if [[ -d "$DIRECTORY" ]] then echo "$DIRECTORY exists on your filesystem." fi. As an example, let's say that you want to check with Bash if the directory /etc exists on your system.
• $* - It stores complete set of positional parameter in a single string. • $@ - Quoted string treated as separate arguments. • $? - exit status of command.
Usually $(command)
executes command and replaces $(command)
with the output of command.
So there must be a file named @D which is executable and located in the search path.
But if this is not a shell script but a make file it means:
$(@D)
The directory part of the file name of the target, with the trailing slash removed. If the value of
$@
isdir/foo.o
then$(@D)
isdir
. This value is.
if$@
does not contain a slash.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With