PROG = Demo PROG2 = Demo2 PACKAGEPATH = com/blah/myproject CLASSPATH = .:/usr/java/default/lib/tools.jar JAVAC = /usr/bin/javac JAR = /usr/bin/jar JFLAGS = -deprecation -source 1.6 -target 1.6 -sourcepath "./." all: $(PROG).class $(PROG2).class clean: echo removing all .class files rm -f *.class rm -f $(PACKAGEPATH)/*.class $(PROG).class: mkdir -p $(PACKAGEPATH) $(JAVAC) $(JFLAGS) $(PROG).java cp $(PROG).class $(PACKAGEPATH)/$(PROG).class $(PROG2).class: mkdir -p $(PACKAGEPATH) $(JAVAC) $(JFLAGS) $(PROG2).java cp $(PROG2).class $(PACKAGEPATH)/$(PROG2).class %.class: %.java $(JAVAC) $(JFLAGS) $<