Make vs Ninja

Get FREE domain for 1st year and build your brand new site

Free book on Graph Algorithms

In this article, we have explored the differences between Make and Ninja build tools. We have presented a table summarizing the differences.

Table of contents:

  1. Background of Make and Ninja
  2. Make vs Ninja
  3. Summary Table
  4. Conclusion

Make vs Ninja

Background of Make and Ninja

Make tool was developed in April 1976 by Bell Labs. In 1976, software using Make to compile and run it had a Makefile and the steps to compile it were:

make
make install

As different systems started to emerged in the Industry, developers needed to compile the same source code in different systems. This came with a problem as the Makefile need different parameters for different systems. Developers had to edit the Makefile to compile the source code on a specific system.

There were several intermediate solutions that came with Make but the final fix was in 2000 with the introduction of Build Generator CMake.

One problem remained that Make was too slow to build large projects.

The solution to this came in 2012 with the introduction of a new Build tool named Ninja. There were key differences like it had to be used wth CMake which was a good practice.

Ninja performed significantly well compared to Make and this resulted it in becoming a strong alternative to Make. Ninja is used to several important projects like Google Chrome and LLVM.

Differences between Make and Ninja

  • For incremental builds, Make is significantly slow. Ninja is faster and helps developers spend less time on building software. This becomes a driving force for large projects such as Google Chrome. In general, performance of Ninja is much better than Make.
  • Make tool was developed in April 1976 by Bell Labs. On the other hand, Ninja was developed by Google in 2012 that is 36 years after Make.
  • Ninja build files are not meant to be implemented manually so Build generators like CMake are compulsory for Ninja. On the other hand, Build generators are optional for Make.
  • In constrast to Make, Ninja does not have any support form String Manipulation. This is mainly because Ninja build files are intented to be generated by Build Generators.
  • Make is currently, managed by Free Software Foundation (FSF) and is not an open-source software. It is a free tool. On the other hand, Ninja is an open-source project.
  • Make is not actively developed or maintained currently. Similarly, Ninja's last release was in November 2020 and there is no further plans of development or maintenance.

Summary Table

Following table summarize the differences between Make and Ninja:

Make vs Ninja
Differences between Make and Ninja
Prepared by iq.OpenGenus.org
PointMakeNinja
Developed inApril 19762012
Developer?Bell LabsGoogle
Speed?SlowFast
Open-SourceNoYes
Build Generator
needed?
OptionalCompulsory
String manipulation?YesNo

Conclusion

As a concluding note, you should use Make if you are working on a project with less than 1000 files and which aims to build and run on only one system. If you want to support multiple system, Make can be used along with CMake.

You should use Ninja if you are working on a large production project which has more than 1000 files and aims to support a wide range of systems. Ninja will be potentially the best solution.