Exe = . all : local examples examples : (cd eg && make local) local : gawks gawks : $(foreach p, $(wildcard gawk/* ), \ (echo '#!'$(shell which gawk)' -f';cat $p) > $(Exe)/$(notdir $p); \ chmod +x $(Exe)/$(notdir $p);)