I recently searched for a way to speedup
make — if you change some header-file it may causes a complete recompilation of the whole source code and it is annoying to wait, if you just changed small stuff or try around etc…
I didn’t found something here regarding this issue, so I want to share what I did:
make can operate parallel if you call it via: “
make --jobs=XX” where X is how many parallel tasks will run. Depending on your CPU cores you can try 2-8 or even more - it will speedup a lot!
In some cases it can result in problems due to the parallel execution of tasks, but for me it run fine - even on building Rack sources.
I added this small peace to my makefile:
ifdef ARCH_MAC CPUS ?= $(shell sysctl -n hw.ncpu || echo 1) MAKEFLAGS += --jobs=$(CPUS) else MAKEFLAGS += --jobs=2 endif
It retrieves the number of CPU cores and automatically set’s a useful number of parallel jobs. Quick and dirty just for Mac, you may change it for your needs or just play around with that.