Skip to content

Commit

Permalink
Very simple Makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
mithro committed Jun 4, 2019
1 parent 892b83b commit f08f698
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
NUM_PROC=$(shell nproc)

SOURCE_DIR := $(PWD)
BUILD_DIR ?= build

.PHONY: all clean $(MAKECMDGOALS)

${BUILD_DIR}/Makefile:
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR} && cmake ${SOURCE_DIR}

all $(MAKECMDGOALS): $(BUILD_DIR)/Makefile
$(MAKE) -k -j${NUM_PROC} -C $(BUILD_DIR) $(MAKECMDGOALS) \
|| $(MAKE) -j1 -C $(BUILD_DIR) $(MAKECMDGOALS)

0 comments on commit f08f698

Please sign in to comment.