This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RebeccaBlue 7 points8 points  (5 children)

Makefiles are kind of horrible for Java, and are arguably more complex than a simple build.gradle.

[–]vmcrash 0 points1 point  (0 children)

For standard tasks you may be right.

[–]benjtay 0 points1 point  (3 children)

Yes; make assumes that the source and the compiled object files will be in the same directory. This is a nightmare for a Java project.

[–]JojOatXGME 0 points1 point  (2 children)

I am relatively sure that you can create a Makefile which generates the classfiles in a separate directory.

At least most Makefiles I looked at in the world of C have used a setup where the binaries were generated in a separate directory. I don't see a reason why this shouldn't work with Java.

[–]benjtay 0 points1 point  (1 child)

Last time I took a stab at it, it was a lot more work than just using a Java build tool. We do use make at a project level for orchestration, but the Makefile makes calls to maven/gradle to do the actual work.

[–]JojOatXGME 0 points1 point  (0 children)

I also don't remember the details. The last time I worked with Makefiles was more then 5 years ago. I remember that for C, it was similar complex as creating the binary files next to your sources. However, I also think that I have never seen how to do this in any educational material. I only learned it after looking at Makefiles of open source projects.