Introduction to Sun WorkShop |
Getting Started
Once Sun WorkShop is installed and added to your command path (see Access to Sun WorkShop Development Tools), you can start Sun WorkShop by typing the following at a command line:
% workshop&
For more information about the
workshop
command, see theworkshop
(1) man page.This chapter describes how to begin working in the Sun WorkShop programming environment and contains basic information about:
- Working with projects
- Using the WorkShop main window
For step-by-step instructions and more information, see the Sun WorkShop online help (you can access the online help through the Help menu in any Sun WorkShop window).
Working With Projects
This release of Sun WorkShop uses projects to keep track of the files, programs, and targets associated with your development projects and to build your programs without your needing to write a makefile. A project is a list of files and compiler, debugger, and build-related options used to build an executable, a static library/archive, a shared library, a Fortran application, a complex application, or a user makefile application.
When you start Sun WorkShop, the Welcome to Sun WorkShop dialog box opens and gives you immediate access to Sun WorkShop projects and the project wizard. Click on the "projects" link in the description pane to access information about projects in the online help. You can also click Help in the Welcome to Sun WorkShop dialog box for more information about that dialog box.
Through the Welcome to Sun WorkShop dialog box or the commands available from the Project menu in the WorkShop main window, you can:
- Create a new project or build a simple program using the project wizard and your own makefile or a makefile Sun WorkShop creates for you (see "Creating a New Project" in the Working With Projects section of the online help)
- Change existing project settings, including how you want your project compiled and whether you want source browsing information generated (see "Editing a Project" and "Edit Current Project Window" in the Working With Projects section of the online help)
If you have Sun WorkShop worksets, you can automatically convert your worksets to Sun WorkShop 6 projects when you load them (for step-by-step instructions, see "Converting a Workset to a Project" in the Working With Projects section of the online help).
You can also choose to use the Sun WorkShop 6 programming environment without loading a project. Picklists keep track of the files, programs, directories, and targets associated with your development projects (see "WorkShop Targets" in the Building Programs section of the online help for more information). You can access each file, build target, and debug executable from the menus in the WorkShop main window.
Creating a Project
Through the Welcome to Sun WorkShop dialog box or through the Project menu in the WorkShop main window, you can ask the project wizard to help you create a project.
From the Welcome to Sun WorkShop dialog box, you can:
The Create New Project wizard prompts you to define your project settings. Then Sun WorkShop creates the type of project you defined (a file with a
.prd
file extension) with the source files you requested.You can share that project file information with multiple members of your development team by creating a project that has an absolute/full path to the project file and a relative (file/base name only) project directory. For example, your team has a workspace for your project, and you create a project named
ws.prd
in the top level directory of the workspace:
- Project file name:
/home/workspaces/ws/ws.prd
Project directory:.
A team member can have a copy of the workspace in
/export/myws
and by opening the project file/export/myws/ws.prd
, the project applies to that team member's local files and to no other team member's files.Building Project Targets
Once you have created your project, you can build project targets by doing one of the following:
- Click Build in the WorkShop main window tool bar.
- Choose Build Build Project from the WorkShop main window menu bar.
- Use the
makeprd
command at the command line (for example, to build your project from the command line as part of a script or cron file).After you select one of these methods, Sun WorkShop:
- Creates a makefile from the project settings you defined in the Create New Project wizard or the Edit Current Project window.
- Opens the Building window.
- Starts the
make
utility.- Shows the results of the build in the Building window.
- Chapter 3
- The Building Programs section of the online help
- The
makeprd
(1) man pageEditing a Project
You can edit your project through the Edit Current Project window. To open the Edit Current Project window, choose Project Edit Project in the WorkShop main window. For more information, see "Editing a Project" and "Edit Current Project Window" in the Working With Projects section of the online help.
Using the WorkShop Main Window
The WorkShop main window helps you access the tools you need to create, develop, debug, and fine tune your applications and lets you choose your text editor and set different types of options.
FIGURE 2-1 displays the WorkShop main window.
FIGURE 2-1 WorkShop Main WindowFor more information about the WorkShop main window, see "WorkShop Main Window" in the online help. (To open the online help, choose Help Contents in the WorkShop main window.) To set colors, fonts and other types of resources used in WorkShop windows, see Appendix A.
Choosing a Text Editor and Text Editor Options
This release of Sun WorkShop provides the following integrated editors:
- NEdit, version 5.0.2 (the Sun WorkShop default editor)
- XEmacs, version 20.4 or compatible versions
- GNU Emacs, version 19.28 or compatible versions
- Vim, version 5.3 with graphical user interface option
- Vi
To change your default editor and set text editor options, choose Options Text Editor Options in the WorkShop main window. The Text Editor Options dialog box opens. The options displayed in the dialog box change depending upon the editor you choose in the Editor to Use pull-down menu. The editor you choose will remain your default editor until you select another editor in the Text Editor Options dialog box.
For more information about each editor's options, see:
- The online documentation available from the Help menu in the editor's menu bar
- "Text Editor Options Dialog Box" in the Text Editing section of the WorkShop online help
You can set colors, fonts and other types of resources used in WorkShop integrated text editors. For information on changing the default resources of Sun WorkShop in the Common Desktop Environment (CDE) and non-CDE environments, see Appendix A.
Setting Startup and Project Options
Sun WorkShop offers you startup and project options through the Options menu in the WorkShop main window.
Startup Options
By default, Sun WorkShop at startup:
- Remembers the size and position of its windows from your previous Sun WorkShop session and redisplays them
- Shows the Sun WorkShop splash screen
- Shows the Welcome to Sun WorkShop dialog box
To change these startup options, choose Options Startup Options from the WorkShop main window menu bar to open the Startup Options dialog box. For more information about these options, see "Startup Options Dialog Box" in the WorkShop Main Window section of the online help.
Project Options
By default, Sun WorkShop treats projects in the following way:
- At startup, Sun WorkShop opens the last project you had open and populates your menu picklists with the items contained in that project.
- When you exit Sun WorkShop or open another project, Sun WorkShop prompts you to save or discard project changes instead of saving automatically.
- When you exit Sun WorkShop or open another project, Sun WorkShop automatically saves your menu picklist entries on all your menus.
- Sun WorkShop sets the maximum number of menu picklist entries at 20.
- Sun WorkShop uses the directory from which it was started as the default directory for its tools.
To change these project options, choose Options Project Options from the WorkShop main window menu bar to open the Project Options dialog box. For more information about these options, see "Project Options Dialog Box" in the WorkShop Main Window section of the online help.
Accessing Sun WorkShop Components
The WorkShop main window helps you access the tools you need to create, develop, debug, and fine tune your applications. The following chapters introduce you to the components of Sun WorkShop and how Sun WorkShop can help you:
- Build your development projects
- Debug your programs
- Browse your code
- Analyze your program's performance
- Merge your source files
Sun Microsystems, Inc. Copyright information. All rights reserved. Feedback |
Library | Contents | Previous | Next | Index |