Skip to content

Instantly share code, notes, and snippets.

@epcim
Created March 30, 2023 11:08
Show Gist options
  • Save epcim/02800b5a4416e5494f60049fa6dd4299 to your computer and use it in GitHub Desktop.
Save epcim/02800b5a4416e5494f60049fa6dd4299 to your computer and use it in GitHub Desktop.

Revisions

  1. epcim created this gist Mar 30, 2023.
    21 changes: 21 additions & 0 deletions Makefile-vars.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    scenarios: `TMPDIR=new/path make` and `make TMPDIR=new/path`

    ```
    SHELL := env TMPDIR=$(TMPDIR) $(SHELL)
    TMPDIR ?= "/tmp"
    all:
    @echo $(TMPDIR)
    ```


    ```
    TMPDIR := "/tmp"
    ifdef $$TMPDIR
    TMPDIR := $$TMPDIR
    endif
    test:
    echo $(TMPDIR)
    ```