# # generic makefile for java projects, including the suffix rule for # building class files automaticly. # # created: Wed Apr 22 14:02:28 EDT 1998 Kyle R. Burton # # # all you should need to change is the TARGET, and add your sources. # # set this to the name of your main class TARGET=net_sccs # # this shouldn't need any changes FILE_ID=makefile.$(TARGET) # # add your source files here SRCS=$(TARGET).java net_msgs.java getopts.java net_util.java # # you can leave this be CLASSES=$(SRCS:.java=.class) # # java compiler CJ=javac # # java compiler flags JFLAGS=-deprecation # # java virtual machine JVM=java # # jvm flag JVMFLAGS= # # suffix declaration for new extensions .SUFFIXES: .java .class # # dependency rule for runing a .java file into a .class file .java.class: $(CJ) $(JFLAGS) $< # # default rule is to dump a summary of the settings, and build all classes all: identify $(CLASSES) # # clean's purpose is to remove all output files clean: identify -rm *.class -rm $(TARGET).tar.gz # # backup just archives all the files in the current directory into # a single gzip'd tar file. backup: identify @if [ -e $(TARGET).tar ]; then \ rm -f $(TARGET).tar ;\ fi @if [ -e $(TARGET).tar.gz ]; then \ rm -f $(TARGET).tar.gz ;\ fi tar cvf $(TARGET).tar * gzip $(TARGET).tar # # test executes the main class in the jvm test: all $(JVM) $(JVMFLAGS) $(TARGET) # # dump a summary of the make file settings identify: @echo " [$(FILE_ID)] Settings:" @echo " [$(FILE_ID)] TARGET: $(TARGET)" @echo " [$(FILE_ID)] SRCS: $(SRCS)" @echo " [$(FILE_ID)] CLASSES: $(CLASSES)" @echo " [$(FILE_ID)] JC: $(JC)" @echo " [$(FILE_ID)] JFLAGS: $(JFLAGS)" @echo " [$(FILE_ID)] JVM: $(JVM)"