Skip to content

Instantly share code, notes, and snippets.

@Terminus-IMRC
Last active May 8, 2020 14:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Terminus-IMRC/3e6b9e8bc5ca8160a1c72acc87c51182 to your computer and use it in GitHub Desktop.
Save Terminus-IMRC/3e6b9e8bc5ca8160a1c72acc87c51182 to your computer and use it in GitHub Desktop.
An infinite loop in Makefile with remaking rules
$(info ** Remaking: MAKE_RESTARTS=$(MAKE_RESTARTS) **)
#
# If WAIT >= t, this Makefile will loop infinitely.
# If WAIT < t, it won't loop infinitely due to filesystem's time resolution.
# +------------+------+
# | Filesystem | t |
# +------------+------+
# | ext4 | 0.01 |
# | hfsplus | 1 |
# +------------+------+
#
WAIT = 1
.PRECIOUS: Makefile
Makefile: FORCE
touch $@
sleep $(WAIT)
.PHONY: FORCE
FORCE:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment