Hi,

I am trying to create a make file for a java project.
It has a directory structure look like this:

src folder
-package1
-java files
-package2
-java files
-package3
-java files
-package4
-java files


I am new to makefile, but tried to create one according to some tutorials on google,
but it doesn't work.
Can anyone help me with this?


Thanks for your time!

JFLAGS = -g
JC = javac
.SUFFIXES: .java .class
.java.class:
        $(JC) $(JFLAGS) $*.java
CLASSES=\
	./src/package1/*.java \
	./src/package2/*.java \
	./src/package3/*.java \
	./src/package4/*.java

default: classes

classes:
	$(CLASSES:.java=.class)

clean:
	$(RM) *.class

Edited 5 Years Ago by darangho: n/a

One fairly obvious problem is at lines 14-15. The way it is written it means that a (phony) target classes depends on nothing, and the recipe is a very strange command. You want classes to depend on the list of class files with no recipe.
Join those two lines together.

I have solved the problem.
Thank you for your comment nezachem :)

This question has already been answered. Start a new discussion instead.