Makefile project keeps importing/reloading



I have a fairly big Makefile project I'm working on that reloads and imports literally all the time unless I manually stop the process just as it starts. Sometimes if I clean the project before reloading ("Clean and Reload Makefile Project") it works and stops looping. It always gets to the "Configuring project" step, says something about restoring from cache and reloads before I even have time to read the results.

What can I do to stop this? If I don't let CLion import the project I don't get any code insight.

Thank you.

Comment actions Permalink
Official comment


Our apologies for the inconvenience.

If CLion keeps reloading the project and closing/reopening it doesn't help, you can simply comment out your pre-configure commands (using the # character on UNIX/Cygwin/WSL and the rem command on MinGW).

Alternatively, you can make sure the Makefile is only generated when necessary:


if [ ! -f Makefile ]
# Your
# pre-configuration
# commands
# here


Comment actions Permalink


This is most probably Feel free to comment or upvote the issue in order to get updates. See if you are not familiar with YouTrack.

This sometimes happens for Makefile projects with the pre-configuration step enabled:

  1. the commands in this step usually generate a new Makefile;
  2. CLion observes that a file has been externally modified;
  3. since Makefile is a project file, the complete project reload cycle is triggered;
  4. the pre-configuration step is re-run;
  5. ...

So far, there is no workaround except for hitting the red Stop button in the Build tool window while the project is being reloaded (i. e. while the button is enabled) or, alternatively, re-loading the project.

Comment actions Permalink


Thank you for the answer. It does seem like that issue fits what I'm observing. Is there no way to make CLion simply ignore the newly generated Makefile? Or to generate it outside of the project folder? Should I just remove the pre-configuration steps?

Stopping the reload at the wrong time also causes it to loop back into the reload. It also usually disables code insights for me depending on when the project is stopped.


Please sign in to leave a comment.