How can I automatically create (and remove) a temp directory in a Makefile?
Is it possible to have make create a temp directory before it executes the first target? Maybe using some hack, some additional target etc.? All commands in the Makefile would be able to refer to the automatically created directory as $TMPDIR , and the directory would be automatically removed when the make command ends. paxdiablo I seem to recall being able to call make recursively, something along the lines of: all: -mkdir $(TEMPDIR) $(MAKE) $(MLAGS) old_all -rm -rf $(TEMPDIR) old_all: ... rest of stuff. I've done similar tricks for making in subdirectories: all: @for i in $(SUBDIRS); do \