	    Outline for IAP Intro to UNIX Soft Dev Course
		      Erik Nygren     1995.01.17
		======================================
		   --------------------------------

I. Intro - What are we going to talk about and who is this class for?
	A. Software development environments
		1. Can develop scalable and maintainable applications
			ranging from small utilities to massive systems
		2. Could have everything in one big .c file but
			hard to maintain, recompile, etc
		3. Group projects
	B. UNIX as a programming environment (ie compared to
	   Integrated Environments under Windows)
		1. Advantages
			- powerful
			- less GUI
			- portability
			- tons of features added over many years
		2. Disadvantages
			- less GUI (intimidating)
			- steep learning curve
			- tons of features added over many years
	C. This course will primarily cover C as it is the most widely
		used language under UNIX.  Applies elsewhere as well.
	D. What we plan to cover
		1. The compilation process
		2. C programming with multiple files
		3. Some tools to make life easier
		4. Makefiles to automate processes like compiling
		5. Using RCS to manage revisions and lock files
		6. Build trees and multi-platform support
		7. Emacs as an integrated environment
	E. We'll cover GNU versions (where available)
		1. All freely available (source on prep.ai.mit.edu in /pub/gnu)
		2. Superset/subset of what's offered by vendors
		3. Available for all platforms so portable

II. Compilation process simplified
	A. Preprocess -> object code -> link
	B. Preprocessing: #define's, #ifdef's, etc
		1. Uses /lib/cpp which we'll cover more later
	C. Generating object files
		1. Compiles code into machine code but doesn't
		    resolve all symbols
	D. Linking
		1. Resolves symbols between programs and creates executables
	E. Example from /mit/sipb-iap/unixsoftdev/examples/compilation/ex1
		cc -c hello.c
		cc hello.o -o hello
		hello
	F. Functions from elsewhere  (ex2)
		cc hello2.c     -o hello2 [fails]
		cc hello2.c -lm -o hello2 [works]
	G. Compilation options
		gcc -Wall -pedantic -ansi hello.c -o hello
	H. See symbols with nm?  Isn't this cool?



III. Writing programs in multiple files
	A. Review: prototypes  (ex3)
		1. Put prototypes for all your functions before their
			first call. 
		2. Provide interface and help to prevent mistakes.
	B. Externs and symbols between files 
		1. Symbol "placeholder"
		2. Example: (examples/compilation/ex4)
			cc -c main.c
			cc -c blah.c
			cc main.o -o example         [doesn't work]
			cc main.o blah.o -o example  [works]
		3. How applies to global variables
	C. Static keyword
	D. Header (.h) files
		1. Used as interface specification
		2. Should contain:
			- Prototypes for shared functions
			- extern declaration for shared variables
			- typedef's
			- macros
			- structs, enums, other data types
		3. Use of preprocessor defines to avoid recursion
		4. Example: (examples/compilation/ex5)
			cc -c main.c
			cc -c blah.c
			cc main.o blah.o -o example 
	E. Libraries
		1. For putting multiple object files together
		2. Usually named libfoo.a so that -lfoo with work
		3. ar - creates file archives
			ar -r archive files...	-- inserts with replacement
			ar -t archive		-- table of archive contents
		4. ranlib and symbol tables
			ranlib archive		-- on some platforms
			ar -s archive		-on other platforms
		5. Example: (examples/compilation/ex6)
			--- Creating the library
			cc -c bar.c
			cc -c blah.c
			ar -r libblah.a bar.o blah.o
			ar -t		[shows contents]
			ar -s libblah.a   [or ranlib]
			--- Using the library
			cc -c main.c
			cc main.o -L. -lblah -o example
		6. Make sure libraries are self contained so
		   all you need to distribute is them and the header file.
		7. Shared libs are OS dependant but useful
			- often end with .sa or .so

