Skip to content

Instantly share code, notes, and snippets.

@h0tw1r3
Created August 20, 2024 17:56
Show Gist options
  • Save h0tw1r3/15f9ee948e60d646afa44ab247c6afd0 to your computer and use it in GitHub Desktop.
Save h0tw1r3/15f9ee948e60d646afa44ab247c6afd0 to your computer and use it in GitHub Desktop.
ifeq (${MAKELEVEL},0)
export SCRATCH := $(shell mktemp -d ./.tmp_XXXXXXXX)
$(info Launching clean up task for ${SCRATCH})
$(shell bash -c "set -m ; trap 'rm -rvf ${SCRATCH};' EXIT; lsof -p $$PPID +r 1;" </dev/null >/dev/null 2>/dev/null & disown)
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment