GCC Installation Fails: make: No targets specified, no Makefile found
When attempting to install the GNU Compiler Collection (GCC), you may encounter an error message stating "make: No targets specified" or "no Makefile found." This issue can occur due to various reasons, including incorrect downloading or extraction of the GCC source code, or missing dependencies.
Instructions for GCC Installation
To install GCC, follow these steps:
- Download the GCC source code from the official website (https://gcc.gnu.org/).
- Extract the downloaded archive using a tool like
taror7z. - Navigate to the extracted directory.
- Run the
configurescript to generate the necessary Makefiles. - Run the
makecommand to compile and install GCC.
Troubleshooting the "make: No targets specified" Error
If you encounter the "make: No targets specified" error during the GCC installation process, try the following steps:
- Make sure you are in the top-level directory of the extracted GCC source code. You can check this by running the command
pwdin the terminal. - Run the
./configurescript again to ensure that it generates the correct Makefiles. If you encounter any errors during this step, check theconfig.logfile for more information. - If the problem persists, try deleting the
Makefileandconfig.statusfiles and running theconfigurescript again. - Check that you have all the required dependencies installed. For Ubuntu, you may need to install the following packages:
build-essentiallibc6-devlibgcc-7-devlibgdbm6libncurses5libncursesw5libreadline6libtinfo5zlib1g-dev
References
For more information on GCC installation, refer to the following resources: