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

src folder
-java files
-java files
-java files
-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!

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

default: classes


	$(RM) *.class

Recommended Answers

All 2 Replies

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 :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.