0

I'm tinkering with this project where Step 6 requires me to run a command like make db-prepare-artix7. This command corresponds to this section of the Makefile. I am confused by the @+SKIP_ENV=true in the recipe. What is @+SKIP_ENV here, and what does it do? Couldn't find anywhere referring to SKIP_ENV.

Thanks!

NoobAdmin
  • 25
  • 2
  • Does this answer your question? [What do @, - and + do as prefixes to recipe lines in Make?](https://stackoverflow.com/questions/3477292/what-do-and-do-as-prefixes-to-recipe-lines-in-make) – Andreas Jan 25 '22 at 05:47
  • `SKIP_ENV` is the name of a shell variable. The variable is set to `true` in the context of the following shell command `source...`. – Renaud Pacalet Jan 25 '22 at 07:13
  • @Andreas Thanks, I found that answer before posting. It helped me learn of @ and +, but doesn't tell me what `SKIP_ENV=true` is doing, which is why I'm asking. – NoobAdmin Jan 25 '22 at 09:05
  • @RenaudPacalet But I can't find where `SKIP_ENV` is defined. Interestingly, making `SKIP_ENV=false` does not seem to alter the outcome, whereas deleting `SKIP_ENV=true` entirely (so the line starts with `source...`) would lead to an `AssertionError` about a missing file, but the following `update_parts.py` runs correctly. – NoobAdmin Jan 25 '22 at 09:23
  • 2
    @NoobAdmin As `SKIP_ENV` is defined in the context of sourcing another shell script, and only for this purpose, you should probably look at this other script if you really want to understand what it is used for. – Renaud Pacalet Jan 25 '22 at 09:26
  • @RenaudPacalet Okay found it [here](https://github.com/SymbiFlow/prjxray/blob/5349556bc2c230801d6df0cf11bccb9cfd171639/utils/create_environment.py#L56). It seems that `main()` will `return` as long as `SKIP_ENV` is not void, which might be why `SKIP_ENV=false` and `SKIP_ENV=true` behaves the same. In fact, I found out that even `SKIP_ENV=blah` works! I guess the authors just wrote `true` to help with reading. Thanks! – NoobAdmin Jan 25 '22 at 09:51

1 Answers1

0

Explaining every part:

  • The @ means the command will not be echoed by Make during recipe execution
  • The + means the command will be executed even during dry runs: make --dry-run ...
  • The SKIP_ENV=true is sh(ell) syntax for setting the environment variable SKIP_ENV to the string true for the duration of the command that follows
    • In your case the source ... command
    • The effect of SKIP_ENV depends on the command - dig deeper to find out
Andreas
  • 5,086
  • 3
  • 16
  • 36
  • Thanks! I found `SKIP_ENV` [here](https://github.com/SymbiFlow/prjxray/blob/5349556bc2c230801d6df0cf11bccb9cfd171639/utils/create_environment.py#L56). In this case the variable's value is irrelevant as long as it's set to something. Anyway thanks for answering, now I can keep on researching the project! – NoobAdmin Jan 25 '22 at 09:58