Last active
December 9, 2024 22:09
-
-
Save lboulard/68a446a76c0a769dbc236b8ba63f1281 to your computer and use it in GitHub Desktop.
makefile sample to rebuild on flags change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*~ | |
*.bak | |
*.orig | |
\#*\# | |
.build/ | |
sh.exe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FLAGS ?= 0 | |
SHELL ?= sh | |
all: .build/all | |
.build/all: .build/a .build/b .build/c .build/d .build/e .build/f | |
touch .build/all | |
.build/: FORCE | |
mkdir -p $@ | |
.build/.flags: .build/ FORCE | |
echo "FLAGS=${FLAGS}" >[email protected]; \ | |
if ! cmp -s [email protected] $@; then mv -f [email protected] $@; fi; \ | |
rm -fr [email protected] | |
.build/a: a .build/.flags | |
touch $@ | |
.build/b: b .build/.flags | |
touch $@ | |
.build/c: c .build/.flags | |
touch $@ | |
.build/d: d .build/.flags | |
touch $@ | |
.build/e: e .build/.flags | |
touch $@ | |
.build/f: f .build/.flags | |
touch $@ | |
.PHONY: FORCE | |
FORCE: ; | |
.PHONY: clean | |
clean: | |
rm -fr .build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment