Unix Programming Tools
Source: cslibrary.stanford.edu
Topic: Shell Programming
Short Desciption:Unix Programming Tools By Parlante, Zelenski, and many others Copyright ©1998 ... link-debug programming cycle and introduces several common Unix programming tools -- gcc, make, gdb, emacs, and the Unix shell.
Content Inside:
Unix
Programming
Tools
By Parlante, Zelenski, and many others
Copyright ©1998-2001, Stanford University
Introduction
This article explains the overall edit-compile-link-debug programming cycle and
introduces several common Unix programming tools -- gcc, make, gdb, emacs, and the
Unix shell. The goal is to describe the major features and typcial uses of the tools and
show how they fit together with enough detail for simple projects. Weve used a version
of this article at Stanford to help students get started with Unix.
Contents
Introduction — the compile-link process
1
The gcc compiler/linker
2
The make project utility
5
The gdb debugger
8
The emacs editor
13
Summary of Unix shell commands
15
This is document #107, Unix Programming Tools, in the Stanford CS Education Library.
This and other free educational materials are available at http://cslibrary.stanford.edu/.
This document is free to be used, reproduced, or sold so long as it is intact and
unchanged.
Other Resources
This article is an introduction — for more detailed information about a particular tool, see
the tools man pages and xinfo entries. Also, OReilly & Associates publishes a pretty
good set of references for many Unix related tools (the books with animal pictures on the
cover). For basic coverage of the C programming language, see CS Education Library
#101, (http://cslibrary.stanford.edu/101/).
The Compile Process
Before going into detail about the individual tools themselves, it is useful to review the
overall process that goes into building an executable program. After the source text files
have been edited, there are two steps in the build process: compiling and linking . Each
source file (foo.c) is compiled into an object file (foo.o). Each object file contain a system
dependent, compiled representation of the program as described in its source file.
Typically the file name of an object module is the same as the sourc ...

