# You can use this makefile in your
# build directory to drive ninja builds.

# The makefile requires gnu make

RESERVED_CPUS?=1
ifneq ("$(wildcard /proc/cpuinfo)","")
	processor_count=$(shell grep -c "^processor" /proc/cpuinfo)
else # Assume FreeBSD for now...
	processor_count=`sysctl -n kern.smp.cpus`
endif
count=$(shell expr $(processor_count) - $(RESERVED_CPUS) )

__primary: test

all:
	ninja -v -j${count} all

clean:
	ninja clean

test: all
	ninja test
