5

An existing Java project uses makefiles (which in turn uses ANT).

I want to work on this project using IntelliJ IDEA. However, no IntelliJ specific files, e.g. project files, should be checked in to version control.

How can I configure the project so that:

  1. Makefiles can be run from inside IntelliJ IDEA.
  2. Change Build > Make Project so that it either does nothing or runs some make target (in a makefile). I do not want to the standard behavior of compiling into ./bin since this potentially can conflict with the makefiles.
0xcaff
  • 13,085
  • 5
  • 47
  • 55
Linus
  • 3,254
  • 4
  • 22
  • 36
  • You might have a partial answer here: https://stackoverflow.com/questions/35100649/how-to-add-a-custom-build-script-to-idea Although it seems there is no way to integrate it with `Build > Make Project` – Peeyush Kushwaha Sep 25 '18 at 08:42

2 Answers2

0

A compilation database feature became available in 2018.

The help page says:

Make-based projects: The compiledb-generator tool creates compilation databases for make-based build systems.

Bear and intercept-build tools: Bear and intercept-build from scan-build are the tools to help you get a compilation database by intercepting compiler calls during the build.

(Bear and intercept-build work on Linux, by injecting themselves into LD_LIBRARY_PATH)

Victor Sergienko
  • 13,115
  • 3
  • 57
  • 91
  • 1
    I guess this is for Linux. If so, mention it in the first line so that people can quickly get to know the platform for which the solution applicable – Bhuvan Nov 10 '22 at 09:28
0

For Windows users

So far, the guidance provided by Dannil Maslov ( see intelliJ IDEA thread here ) worked for me.

  1. Install GnuWin32 (Make for Windows).

  2. Install the IDEA Makefile plugin.

  3. Go to settings and specify the path to make executable under: File | Settings | Build, Execution, Deployment | Make | Path to Make executable (by default: C:\Program Files (x86)\GnuWin32\bin\make.exe). Check "Use Cygwin" if necessary.

If you have used chocolatey ( choco install make ) , change the path in step 3 accordingly.

You should be up and running.

exaucae
  • 2,071
  • 1
  • 14
  • 24
  • 1
    I installed GnuWin32 as mentioned in step 1. I did not come across any errors during the installation. I do not see "make" in the folder GnuWin32\bin\. What could be the reason? – Bhuvan Nov 10 '22 at 09:23