Skip to content

Instantly share code, notes, and snippets.

@smutch
Created February 5, 2018 06:35
Show Gist options
  • Save smutch/e595dfb54ddc9097d583d40ba20ac662 to your computer and use it in GitHub Desktop.
Save smutch/e595dfb54ddc9097d583d40ba20ac662 to your computer and use it in GitHub Desktop.
make: Simple makefile to run a standard cmake build
.PHONY: default config cleanbuild
default: build/Makefile
@make -C build --no-print-directory $(MFLAGS)
config:
@cmake . -Bbuild $(CMAKE_OPTS)
cleanbuild:
@rm -r build
build/Makefile:
@if [ ! -d "build" ]; then cmake . -Bbuild $(CMAKE_OPTS); fi
% :: build/Makefile
@make -C build --no-print-directory $@ $(MFLAGS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment