3

I know makefiles are totally outdated for Java projects but we have to make one for a course assignment. Here is the makefile they gave us to use:

JAVAC=javac
sources = $(wildcard *.java)
classes = $(sources:.java=.class)

all: $(classes)

clean :
    rm -f *.class

%.class : %.java
    $(JAVAC) $<

I assume this should work because my prof gave it to us, does this look correct? Common practices/clarity isn't required it just needs to compile the one .java file in the same folder.

Assuming the file is okay, how do I run it from windows cmd prompt?

Jedediah
  • 133
  • 1
  • 11
  • 1
    Wow, you need to get a new teacher. If you are working in a Java ecosystem, you should be using ant or maven. – OldProgrammer Feb 03 '19 at 17:28
  • 2
    I looked at that question and the answer is in reference to Visual Studio, plus the the entire question is about a C/C++ makefile. – Jedediah Feb 03 '19 at 17:31

0 Answers0