Week 3 - 120 lab ---------------------------------- - multiple file compilation: make files - read tutorials on website! Simple example: Suppose you have a file "driver.c" that has main and includes another file "helper.h" in it. Suppose further that there is a "helper.c" implementation file to go along with "helper.h". Put the following 4 lines into a file called "makefile" or "Makefile" in the same directory with the source code files: CFLAGS= -ansi -std=c99 -pedantic -Wall -Wextra -O -g CC=gcc driver: driver.o helper.o driver.o: driver.c helper.h helper.o: helper.c helper.h This file sets up dependencies that are necessary to compile the files together properly so that "driver" will be the resulting executable file. To do the compilation, simply type "make" at your unix command prompt. Then type "driver" at the unix command prompt to run your program. - gdb - read tutorials on website! - use -g option when you compile - type "gdb" at command prompt after compiling your program - type "run" at the gdb prompt to run your program - type "backtrace" or "bt" at the gdb prompt after an error occurs - type "quit" to get out - there are many more useful options! read the tutorials... - partners for new assignment - binky the pointer (video from Stanford) - review homework solutions to pg2