3 ms·
You're missing the final tail call which includes Makefile.debug again. With this, we can make a REPL: $ cat Makefile FOO := bar target: Next:
by kazinator 12y ago
You're missing the final tail call which includes Makefile.debug again. With this, we can make a REPL:
$ cat Makefile
FOO := bar
target:
Next:
$ cat Makefile.debug
ifeq ($(MAKEFILE_INCLUDED),)
-include Makefile
MAKEFILE_INCLUDED := y
endif
REPL_COMMAND := $(shell read line; printf "%s\n" $$line)
$(eval $(REPL_COMMAND))
-include Makefile.debug
Now, here we go:
$ make -f Makefile.debug
$(warning $(FOO)) <--- typed by me
Makefile.debug:8: bar
ABC := xyz <---
$(warning $(ABC)) <---
Makefile.debug:8: xyz
:)
- david-given 12y agoThis is the kind of idea for which the phrase 'genius crazy' was invented. I might actually use this some time, god help me. I won't thank you, but I will remember you and curse a little every time I do.