# # NOTE: There are different versions of this file depending on which machine # you're running. In particular, if you're running on waldorf, use the version # in Makefile-waldorf; on falcon, use Makefile-falcon. # # # This is an illustrative Makefile for compiling and documenting Java programs # on a SUN platform. It uses a standard Makefile layout, consisting of # definitions at the top followed by rules below. # # The directory definitions are based on the following assumptions: # # * This Makefile is in a directory named "JVM" which contains .class files # and/or package subdirectories with .class files generated by javac. # # * Immediately above this JVM directory is a parent directory named # "implementation"; under the implementation directory is a subdirectory # named "java" containing .java source files and/or package sub- # directories with .java files. # # * Two directory levels up is a directory named "design" in which the # .html files generated by javadoc are stored. # # In the definitions section of this file, the source files are subdivided into # three parts to reinforce a Model/View/Process design architecture. The parts # are defined as MODEL_SRC_FILES, VIEW_SRC_FILES, and PROCESS_SRC_FILES. In # addition to these three primary definitions, there are auxiliary file # definitions, such as STUBBED_MODEL_SRC_FILES. # # In the rules section of this file, there are rules for compiling .java files # into .class files and for building .jar archive files. Given the somewhat # arcane requirements for using javac successfully, the rules are clearly # commented to explain what they build and how to run the results. In addition # to the javac rules, there are rules for building documentation and performing # bookkeeping tasks. The documentation is in the form of javadoc .html files, # which are actually generated by the design Makefile stored in # ../../design/Makefile, q.v. # # # # Location of the mvp support package # CLASS_PATH = /users/gfisher/work/support/implementation/executables/JVM # # Destination of .html files generated by javadoc # DESIGN_DIR = ../../../design # # Location of .java sources files # IMPLE_SRC_DIR = ../../source/java/rolodex # # Model source files # MODEL_SRC_FILES = \ $(IMPLE_SRC_DIR)/AddInputErrors.java \ $(IMPLE_SRC_DIR)/Address.java \ $(IMPLE_SRC_DIR)/Age.java \ $(IMPLE_SRC_DIR)/Card.java \ $(IMPLE_SRC_DIR)/ChangeInputErrors.java \ $(IMPLE_SRC_DIR)/DeleteInputError.java \ $(IMPLE_SRC_DIR)/EditStub.java \ $(IMPLE_SRC_DIR)/File.java \ $(IMPLE_SRC_DIR)/Id.java \ $(IMPLE_SRC_DIR)/InputErrors.java \ $(IMPLE_SRC_DIR)/Name.java \ $(IMPLE_SRC_DIR)/Rolodex.java \ $(IMPLE_SRC_DIR)/RolodexTool.java \ $(IMPLE_SRC_DIR)/Sex.java # # Model source files with stubbed-out implementations, for quick view testing # STUBBED_MODEL_SRC_FILES = \ $(IMPLE_SRC_DIR)/EditStub.java \ $(IMPLE_SRC_DIR)/FileStub.java \ $(IMPLE_SRC_DIR)/RolodexStub.java \ $(IMPLE_SRC_DIR)/RolodexToolStub.java # # View source files common to both single-view and multi-view versions of the # tool ui # COMMON_VIEW_SRC_FILES = \ $(IMPLE_SRC_DIR)/AddCardButtons.java \ $(IMPLE_SRC_DIR)/AddCardDialog.java \ $(IMPLE_SRC_DIR)/CancelAddButtonListener.java \ $(IMPLE_SRC_DIR)/CancelChangeButtonListener.java \ $(IMPLE_SRC_DIR)/CancelDeleteButtonListener.java \ $(IMPLE_SRC_DIR)/CancelFindButtonListener.java \ $(IMPLE_SRC_DIR)/ChangeCardDialog.java \ $(IMPLE_SRC_DIR)/ClearAddButtonListener.java \ $(IMPLE_SRC_DIR)/ConfirmChangeButtons.java \ $(IMPLE_SRC_DIR)/ConfirmChangeDialog.java \ $(IMPLE_SRC_DIR)/DeleteCardDialog.java \ $(IMPLE_SRC_DIR)/DoneFindButtonListener.java \ $(IMPLE_SRC_DIR)/EditMenu.java \ $(IMPLE_SRC_DIR)/EmptyDialog.java \ $(IMPLE_SRC_DIR)/ErrorMessageDialog.java \ $(IMPLE_SRC_DIR)/FileMenu.java \ $(IMPLE_SRC_DIR)/FindCardDialog.java \ $(IMPLE_SRC_DIR)/FoundCardsButtons.java \ $(IMPLE_SRC_DIR)/FoundCardsDialog.java \ $(IMPLE_SRC_DIR)/NextCardButtonListener.java \ $(IMPLE_SRC_DIR)/NoFoundCardsDialog.java \ $(IMPLE_SRC_DIR)/OKAddButtonListener.java \ $(IMPLE_SRC_DIR)/OKChangeButtonListener.java \ $(IMPLE_SRC_DIR)/OKConfirmChangeButtonListener.java \ $(IMPLE_SRC_DIR)/OKDeleteButtonListener.java \ $(IMPLE_SRC_DIR)/OKErrorButtonListener.java \ $(IMPLE_SRC_DIR)/OKFindButtonListener.java \ $(IMPLE_SRC_DIR)/PreviousCardButtonListener.java \ $(IMPLE_SRC_DIR)/RolodexMenu.java # # View source files for the single-view menu ui # SINGLE_VIEW_MENU_SRC_FILES = \ $(IMPLE_SRC_DIR)/RolodexMenuUI.java # # View source files for the single-view push button ui # SINGLE_VIEW_BUTTON_SRC_FILES = \ $(IMPLE_SRC_DIR)/RolodexPushButtonUI.java # # View source files for the multi-view menu ui # MULTI_VIEW_MENU_SRC_FILES = \ $(IMPLE_SRC_DIR)/CommandEdTextArea.java \ $(IMPLE_SRC_DIR)/RolodexCommandEditor.java \ $(IMPLE_SRC_DIR)/RolodexMultiViewMenuUI.java \ $(IMPLE_SRC_DIR)/RolodexTextEditor.java \ $(IMPLE_SRC_DIR)/RolodexToolBar.java \ $(IMPLE_SRC_DIR)/WindowsMenu.java # # Common process source files # COMMON_PROCESS_SRC_FILES = \ $(IMPLE_SRC_DIR)/CardList.java \ $(IMPLE_SRC_DIR)/StringList.java # # Single view process source files # SINGLE_VIEW_PROCESS_SRC_FILES = \ $(IMPLE_SRC_DIR)/Main.java # # Multi view process source files # MULTI_VIEW_PROCESS_SRC_FILES = \ $(IMPLE_SRC_DIR)/RolodexCommandProcessor.java \ $(IMPLE_SRC_DIR)/MultiViewMain.java # # Build all executable files. # all: sv mv rolodex.jar sv.jar mv.jar # # Build a rolodex with a single-view pulldown menu GUI. Invoke this build as # follows: # # java rolodex.Main # # This assumes that the CLASSPATH environment variable includes the path of the # mvp package located in # # ~gfisher/projects/support/implementation/JVM # # If CLASSPATH does not include this path, then invoke this build as follows: # # java -classpath ~gfisher/projects/support/implementation/JVM:. \ rolodex.Main # # Per standard Java invocation conventions, the preceding invocations assume # that the current working directory is that of this Makefile or a directory # with a full copy of the ./rolodex package directory. If this is not the # case, then the classpath must be extended with the directory in which the # compiled rolodex package resides. # sv: $(MODEL_SRC_FILES) \ $(COMMON_VIEW_SRC_FILES) \ $(SINGLE_VIEW_MENU_SRC_FILES) \ $(COMMON_PROCESS_SRC_FILES) \ $(SINGLE_VIEW_PROCESS_SRC_FILES) javac -g -d . -classpath $(CLASS_PATH) \ $(MODEL_SRC_FILES) \ $(COMMON_VIEW_SRC_FILES) \ $(SINGLE_VIEW_MENU_SRC_FILES) \ $(COMMON_PROCESS_SRC_FILES) \ $(SINGLE_VIEW_PROCESS_SRC_FILES) # # Build a rolodex with a multi-view pulldown menu GUI. Invoke this build in # the same manner as the sv build immediately above, except use MultiViewMain # instead of Main. # mv: $(MODEL_SRC_FILES) \ $(COMMON_VIEW_SRC_FILES) \ $(SINGLE_VIEW_MENU_SRC_FILES) \ $(MULTI_VIEW_MENU_SRC_FILES) \ $(COMMON_PROCESS_SRC_FILES) \ $(MULTI_VIEW_PROCESS_SRC_FILES) javac -g -d . -classpath $(CLASS_PATH) \ $(MODEL_SRC_FILES) \ $(COMMON_VIEW_SRC_FILES) \ $(SINGLE_VIEW_MENU_SRC_FILES) \ $(MULTI_VIEW_MENU_SRC_FILES) \ $(COMMON_PROCESS_SRC_FILES) \ $(MULTI_VIEW_PROCESS_SRC_FILES) # # Build a .jar archive file that contains all rolodex .class files. This # build is primarily intended for file transfer purposes, not for direct # invocation. For convenient execution from a jar file, see instead the sv.jar # and mv.jar builds below. This build (rolodex.jar) can however be invoked if # desired as follows: # # java -classpath ~gfisher/projects/support/implementation/JVM:rolodex.jar \ rolodex.Main # # for the single-view version, and # # java -classpath ~gfisher/projects/support/implementation/JVM:rolodex.jar \ rolodex.MultiViewMain # # for the multi-view version. # rolodex.jar: jar cf rolodex.jar rolodex/*.class # # Build a stand-alone executable .jar file that includes rolodex .class files, # the mvp package .class files, and a MANIFEST file that defines the Main-Class # attribute as the single-view Main class. This allows the jar file to be # invoked stand-alone without unpacking it and without linking to an external # MVP library. Hence, invoke this build as follows: # # java -jar sv.jar # # This invocation can be performed in any working directory that contains a # copy of sv.jar, with no required settings of the CLASSPATH environment # variable. The stand-alone jar file can be invoked from any other working # directory as follows: # # java -jar ~/projects/rolodex/implementation/JVM/sv.jar # sv.jar: rm -f mvp ln -s $(CLASS_PATH)/mvp . jar cmf MANIFEST-sv sv.jar rolodex/*.class mvp chmod a+x sv.jar rm mvp # # Build the same form of stand-alone executable as the preceding rule, but # with a MANIFEST that defines Main-Class as the multi-view MultiViewMain # class. Invoke this build in exactly the same was as sv.jar. # mv.jar: rm -f mvp ln -s $(CLASS_PATH)/mvp . jar cmf MANIFEST-mv mv.jar rolodex/*.class mvp chmod a+x mv.jar rm mvp # # Goto the design dir to generate the javadoc. # doc: cd $(DESIGN_DIR); make doc # # Generate individual javadoc files. NOTE: this rule has been superseded by # the doc: rule in the design dir Makefile, q.v. The rule there makes the # javadoc files as part of the rolodex package, not individually as the rule # here does. This rule survives for historical purposes. # old_style_doc: $(MODEL_SRC_FILES) $(VIEW_SRC_FILES) $(PROCESS_SRC_FILES) javadoc -d $(DESIGN_DIR)/javadoc -classpath $(CLASS_PATH) \ $(MODEL_SRC_FILES) \ $(COMMON_VIEW_SRC_FILES) \ $(SINGLE_VIEW_MENU_SRC_FILES) \ $(MULTI_VIEW_MENU_SRC_FILES) \ $(COMMON_PROCESS_SRC_FILES) \ $(SINGLE_VIEW_PROCESS_SRC_FILES) \ $(MULTI_VIEW_PROCESS_SRC_FILES) # # Remove all .class and .html files # clean: rm -f rolodex/*.class *.jar $(DESIGN_DIR)/javadoc/*.html # # Convert this Makefile to versions for use on different local platforms. # convert: Makefile csh -q -c ".make-convert"