PRISM USER'S GUIDE Version 2.0, April 1994 Copyright (c) 1991-1994 Thinking Machines Corporation. CHAPTER 7: EDITING AND COMPILING PROGRAMS ****************************************** You can edit and compile source code by invoking the appropriate utilities from Prism. To learn: o How to edit source code, see Section 7.1, below. o How to use the UNIX make utility from within Prism to compile and link source code, see Section 7.2. 7.1 EDITING SOURCE CODE ------------------------ Prism provides an interface to the editor of your choice. You can use this editor to edit source code (or anything else). To call the editor from within Prism: From the menu bar: From the Utilities menu, choose the Edit selection. From the command window: On the command line, issue the command edit. You can specify which editor Prism is to call by using the Customize utility to set a Prism resource; see Section 9.3. If this resource has no setting, Prism uses the setting of your EDITOR environment variable. Otherwise, Prism uses a default editor, as listed in the Customize window. The editor is invoked on the current file, as displayed in the source window. If possible, the editor is also positioned at the current execution point, as seen in the source window; this depends on the editor. If you issue the edit command from the command window, you can specify a filename or a function name, and the editor will be invoked on the specified file or function. After the editor has been created, it runs independently. This means that changes you make in the current file are not reflected in the source window. To update the source window, you must recompile and reload the program. You can do this using the Make selection from the Utilities menu, as described below. 7.2 USING THE MAKE UTILITY --------------------------- Prism provides an interface to the standard UNIX tool make. The make utility lets you automatically recompile and relink a program that is broken up into different source files. See your UNIX documentation for an explanation of make and makefiles. 7.2.1 Creating the Makefile ---------------------------- Create the makefile as you normally would. Within Prism, you can choose the Edit selection from the Utilities menu to bring up a text editor in which you can create the file; see Section 7.1. 7.2.2 Using the Makefile ------------------------- After you have made changes in your program, you can run make to update the program. Prism uses the standard UNIX make utility, /bin/make, unless you specify otherwise. You do this by using the Customize utility to change the setting of a Prism resource; see Section 9.3. To run make: From the menu bar: From the Utilities window, choose the Make selection. A window appears; Figure 35 is an example. [ Figure Omitted ] Figure 35. The Make window. The window prompts for the names of the makefile, the target file(s), the directory in which the makefile is located, and other arguments to make. If a file is loaded, its name is in the Target box, and the directory in which it is located is in the Directory box; you can change these if you like. If you leave the Makefile or the Target box empty, Make uses a default. See your UNIX documentation for a discussion of these defaults. If you leave the Directory box empty, Make looks for the makefile in the directory from which you started Prism. You can specify any standard make arguments in the Other Args box. The window also asks if you want to reload after the make. Answering Yes (the default) automatically reloads the newly compiled program into Prism if the make is successful. If you answer No, the program is not reloaded. To cancel the make while it is in progress, click on the Cancel button. If a make is not in progress, clicking on Cancel closes the window. The output from make is displayed in the box at the bottom of the Make window. Subsequent makes use the same window, unless you start a new make while a previous make is still in progress. From the command window: Issue the make command on the command line. You can specify any arguments that are valid in the UNIX version of make. ***************************************************************** The information in this document is subject to change without notice and should not be construed as a commitment by Think- ing Machines Corporation. Thinking Machines reserves the right to make changes to any product described herein. Although the information in this document has been reviewed and is believed to be reliable, Thinking Machines Corporation assumes no liability for errors in this document. Thinking Machines does not assume any liability arising from the application or use of any information or product described herein. ***************************************************************** Connection Machine (r) is a registered trademark of Thinking Machines Corporation. CM, CM-2, CM-200, and CM-5 are trademarks of Thinking Machines Corporation. CMOST, CMAX, and Prism are trademarks of Thinking Machines Corporation. C* (r) is a registered trademark of Thinking Machines Corporation. Paris and CM Fortran are trademarks of Thinking Machines Corporation. CMMD, CMSSL, and CMX11 are trademarks of Thinking Machines Corporation. CMview is a trademark of Thinking Machines Corporation. Thinking Machines (r) is a registered trademark of Thinking Machines Corporation. SPARC and SPARCstation are trademarks of SPARC International, Inc. Sun, Sun-4, and Sun Workstation are trademarks of Sun Microsystems, Inc. UNIX is a trademark of UNIX System Laboratories, Inc. The X Window System is a trademark of the Massachusetts Institute of Technology. OSF and Motif are trademarks of The Open Software Foundation, Inc. Worldview is a trademark of Interleaf, Inc. Copyright (c) 1991-1994 by Thinking Machines Corporation. All rights reserved. This file contains documentation produced by Thinking Machines Corporation. Unauthorized duplication of this documentation is prohibited. Thinking Machines Corporation 245 First Street Cambridge, Massachusetts 02142-1264 (617) 234-1000