Created
May 8, 2016 20:36
-
-
Save jeschkies/614c81023c3a26d009b6eadff5e72fe1 to your computer and use it in GitHub Desktop.
Example dependency management with Make
This file contains 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
build-deps: catch docopt | |
vendor: | |
mkdir -p vendor | |
vendor/.last-build: deps.mk | |
make build-deps -j4 | |
touch vendor/.last-build | |
catch: REPO = https://github.com/philsquared/Catch | |
catch: COMMIT = c984fc3 | |
vendor/catch: | vendor | |
git clone $(REPO) $@ | |
catch: vendor/catch | |
cd $< && git fetch && git checkout $(COMMIT) | |
docopt: REPO = https://github.com/docopt/docopt.cpp.git | |
docopt: COMMIT = a4177cc | |
vendor/docopt: | vendor | |
git clone $(REPO) $@ | |
docopt: vendor/docopt | |
cd $< && git fetch && git checkout $(COMMIT) \ | |
&& cmake . && make |
This file contains 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
#… | |
bootstrap: vendor/.last-build | |
# run bootstrap before building anything | |
*.o **/*.o: | bootstrap | |
clean: | |
rm -rf *.o lib/*.o test_assimp *.dSYM *.gcov *.gcno *.gcda genfiles $(BINS) | |
distclean: clean | |
rm -rf vendor | |
include deps.mk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment