# Sample Makefile # # This simple make file should be used for your # programming assignments # # We want you to have two default targets: # # > make # -- this should compile your java program. # # > make test # -- this should run your java program. # # > make p=MySort # -- this is the same as "make" but the variable p is "MySort" # # # Try to pick up some tricks from the examples below: # (1) use of variables # (2) use of alternative names for a target # # You may ignore the stuff below the "HOUSEKEEPING" line... # # Basic Algorithms Class, Fall 2005 # Prof.Yap ################################################### # VARIABLES: ################################################### p=List p=p p=sol p=MergeSort ################################################### # TARGETS: ################################################### j default: javac $(p).java ################################################### t test run: $(p).class java $(p) ################################################### # HOUSEKEEPING ################################################### clean: -@rm -f *~ *.class ################################################### l h h.dvi: h.tex latex h ################################################### ps: h.dvi dvips h -o ################################################### pdf h.pdf: h.tex pdflatex h ################################################### pub publish: h.pdf Makefile MergeSort.java chmod a+r h.pdf chmod a+r Makefile chmod a+r MergeSort.java ################################################### # end ###################################################