Shell Variable

$$var $$( python -c ‘import sys; print(sys.implementation.name)’ )

Make Variable

T ?= foo # give a default value T := $(shell whoami) # execute shell immediately to put in the var

PHONY to execute several makefile

Example 1

SUBDIRS = foo bar baz

## dir is a Shell variables
## SUBDIR and MAKE are Internal make variables
subdirs:
        for dir in $(SUBDIRS); do \
          $(MAKE) -C $$dir; \
        done

Example 2

SUBDIRS = foo bar baz

.PHONY: subdirs $(SUBDIRS)
subdirs: $(SUBDIRS)
$(SUBDIRS):
        $(MAKE) -C $@
foo: baz

Idea for a testing tools

git clone xxx /tmp/xxx&& make -C !$/Makefile
make download le conteneur
make build le binaire
make met le dans /use/local/bin
make clean
make help

Sources:

Tutorials

A Gist for a colored help

The RAW version