HW #1

Assignment #1.. due Feb. 15 '05 (Tuesday) midnight
FYI, here is a Java implementation of the Bresenham line algorithm. Your code does not have to be interactive however..
Following is a template for a makefile. Copy the following into a file called 'Makefile'. Note that in the lines following each colon (:), you need a TAB (not a bunch of spaces!).

Once you have the Makefile created with names of your own source file(s) (eg. drawLine.c), simply type 'make' in your shell prompt, it should do the compilation (eg. call gcc, CC, cc, etc.) for you.

Saying 'make clean' will remove (rm) the executables so you can start a clean 'make' the next time around.

The 'make' system essentially automates the compilation process so that you don't have to manually create .o files (intermediates) and link them together into a binary.

In 'real' CG production (and in a variety of other industries, including telecom etc.) makefiles are still widely used, so it is good for you to know how to create and use them.. We're not forcing you to use makefiles just to torture you :)

# makefile to compile your program

CC = <name of your compiler - e.g. g++>

# note that in the following, the $(CC) is preceded by a TAB, **not** spaces
        $(CC) <name of .cc or .cpp file> -o <name of executable - e.g. drawline>
        $(CC) <name of second file> -lm -o <name of executable>

# again, the 'rm' needs to have a TAB before it, not spaces
        rm -rf *o *~ <name of executables separated by space>

Here is a simple tutorial on makefiles, if you want more details.