${LDS_FILE} what is the difference between { and ( in makefile?
时间: 2023-11-23 22:10:37 浏览: 40
In a Makefile, `{}` and `()` have different meanings.
- `{}` is used for creating a shell command block. This is used when you want to execute multiple commands in a single shell instance. For example:
```
target:
{ \
echo "Command 1"; \
echo "Command 2"; \
}
```
- `()` is used for defining dependencies. This is used when you want to group multiple dependencies together. For example:
```
target: dependency1 (dependency2 dependency3)
commands
```
In this example, `dependency2` and `dependency3` are grouped together using `()`. They are treated as a single dependency, and `commands` will only be executed if all dependencies are up-to-date.
相关问题
${LDS_FILE} what is the difference between { and ( ?
In programming, the curly brace `{}` is typically used to enclose a block of code, such as in functions, loops, and conditional statements. On the other hand, parenthesis `()` are often used to enclose arguments in function calls or mathematical expressions.
For example, in C++ or Java, a function definition might look like this:
```
int myFunction(int arg1, int arg2) {
// code block enclosed in curly braces
int result = arg1 + arg2;
return result;
}
```
In this example, the curly braces define the beginning and end of the function's code block.
In contrast, a function call might look like this:
```
int x = myFunction(3, 5);
```
In this example, the arguments `3` and `5` are enclosed in parentheses, indicating that they are being passed as arguments to the `myFunction` function.
$(call if_changed_dep,cpp_lds_S) is cpp_lds_S the argument fot if_changed_deo?
Yes, in the expression `$(call if_changed_dep,cpp_lds_S)`, `cpp_lds_S` is the argument for the `if_changed_dep` function.
The `if_changed_dep` function is a built-in function in Makefile that is used to run a command only if its dependencies have changed. The syntax for using `if_changed_dep` is:
```
$(if_changed_dep,command)
```
Here, `command` is the shell command that you want to run if its dependencies have changed.
In your example, `cpp_lds_S` is being passed as an argument to `if_changed_dep`. This means that `cpp_lds_S` is the command that will be executed by `if_changed_dep` if its dependencies have changed.
So, the `if_changed_dep` function will check if the dependencies of the target that is being built have changed since the last build, and if they have, it will execute the `cpp_lds_S` command. If the dependencies have not changed, `cpp_lds_S` will not be executed.