# # This is a template Makefile to be put in the implementation/executables/JVM # directory of a 206 project. Goto the lines labeled "FILL IN HERE" to # customize this template for your project. # # In order for this Makefile to work properly, your project directory must be # set up per the 206 SOP, Volume 1. In particular, you must have the following # directories defined: # # DIRECTORY CONTENTS # ===================================================================== # implementation/source/java root directory for the .java source files # of your project, organized into packages # # implementation/executables/JVM root directory for the .class executable # files generated by the Java compiler # CSC 206 java lib directory LIB206 = /users/gfisher/classes/206/lib/JVM # # NOTES ABOUT EXECUTING COMPILED JAVA PROGRAMS. # # The compilation rule in the implementation-Makefile results in an executable # program that consists of .class files stored in this directory -- # implementation/executables/JVM. The program is invoked as follows from this # directory: # # java protoj.Main # # where "protoj" is the name of your top-level project package, and Main # is the name of the class that contains the definition of the program's main # method. Executing in this way assumes that the CLASSPATH environment # variable includes the path of the CSC 206 library directory, which on waldorf # is # # /users/faculty/gfisher/classes/206/lib/JVM # # If CLASSPATH does not include this path, then the program can be invoked by # specifying the CLASSPATH as a command-line argument as follows: # # java -classpath /users/faculty/gfisher/classes/206/lib/JVM:. \ protoj.Main # # Per standard Java invocation conventions, the preceding invocations assume # that the current working directory is the executables/JVM directory in which # the .class files reside. If this is not the case, then the classpath must be # extended with the directory in which the compiled package resides. # Specifically, to run protoj.Main from some directory other than JVM, # invoke it as follows: # # java -classpath /users/faculty/gfisher/classes/206/lib/JVM:full-project-path/protoj/implementation/executables/JVM protoj.Main # # where "full-project-path" is the absolute path to the location of your # project directory. # # # The following make rules use the jar utility (the Java archiver) to build two # other forms of executable programs -- one a transportable version and another # that is a stand-alone executable version. These rules should be run after # the compilation has been performed in the implementation-Makefile in # ../../source/java/Makefile. # # Run the Jar utility on all of the files to build a stand-alone executable # .jar file that includes .class files, 206 library .class files, and a # MANIFEST file that defines the Main-Class attribute as the Main class. # # This rule builds a jar file that can be invoked stand-alone, without # unpacking it and without linking to the external 206 library. It is invoked # as follows: # # java -jar protoj.jar # # This invocation can be performed in any working directory that contains a # copy of protoj.jar, with no required settings of the CLASSPATH # environment variable. The stand-alone .jar file can also be invoked from any # other working directory simply by specifying the full path to the location of # the .jar file. # # FILL IN HERE: change "protoj" to a suitable name for the executable # version of your program, e.g., the name of your top-level project package. # Change "protoj" to the name of your top-level project package. Also, # create a file named MANIFEST containing the following single line: # # Main-Class: protoj.Main # jar: rm -f mvp lib206 protoj/protoj_ui/images ln -s $(LIB206)/mvp . ln -s $(LIB206)/lib206 . jar xf ../../source/java/bsh-1.2b7.jar cd protoj/protoj_ui; ln -s ../../../../source/java/protoj/images . jar cmf MANIFEST protoj.jar protoj mvp lib206 bsh chmod a+x protoj.jar rm -rf mvp lib206 bsh # Run the Jar utility on all of the files to build a transportable program # archive file. # # FILL IN HERE: change "protoj" to a suitable name for the executable # version of your program, e.g., the name of your top-level project package. # Change "protoj" to the name of your top-level project package. # jar-simple: $(FILES) jar cf protoj.jar protoj # This .jar file is primarily intended for file transfer purposes, not for # direct invocation. For convenient execution from a jar file, see instead the # exec rule below. The .jar file can be invoked if desired as follows: # # java -classpath \ /users/faculty/gfisher/classes/206/lib/JVM:protoj.jar \ protoj.Main