(Fix) make: *** No rule to make target

In Linux, various packages are obtained by building and compiling their source codes. The make utility is the primary catalyst in this regard. While using the make utility, you may encounter the error “make: *** No rule to make target”.

This blog will help you understand the cause of this error and provide its solution for Linux distribution. The content of the post is as follows:

Let’s start with the reason.

Reason: Package is not available in the Current Directory

While compiling source code or different GCC files, this error of the “make: *** No rule to make target [with come file names]” occurs because the source files are not available in the directory where we are using the “make” utility to compile it.

For example, we were trying to install the package sqlite3 on Ubuntu. We experienced the error on the screen by running the make command:

$ make install

Solution: Use the make Utility in the Correct Directory

To fix the “make: ***No rule to make target” on Linux, ensure that the files are present in the same directory where they will be compiled. For a better explanation, we have provided an example that will compile the SQLite3 source files

Example: Compiling SQLite3 Source Files

For example; we will navigate to the SQLite3 directory, where the files which are to be compiled are available by using the command:

$ cd SQLite3 && cd sqlite-autoconf-3390000

Now, convert the compiled files into binaries using the make install command.

$ make install

The installation files are now being compiled without displaying the error on the screen.

That’s how you can fix the error.

Conclusion

To fix the “make:*** No rule to make target”, the users must ensure that the files compiling with the make command are in the same directory where you are using make. In this blog, the cause of the error of “make: *** No rule to make target” is explained with its solution in Linux.