# Lines starting with a # are a comment
#
#
# Declare which c compiler you wish to  use.  
#   The cflag -g means compile in symbolic debugging information
#   The -Aa means to  use the ansi version of the hp compiler.

CC = cc
CDEBUGFLAGS = -g
CFLAGS = -Aa ${CDEBUGFLAGS}

#
# We will be doing some math, so we include the math library too.
# We will add more here later.
#

CLIBS = -lm
LIBS = ${CLIBS}

#
# later we will use this.
#

SEARCH =

#
# I always define rm and rmflags, that way it doesn't complain when 
# I make clean if all the files aren't there.
#

RM = /bin/rm
RMFLAGS = -f

# 
# These are the local modules we will include
#
OBJS = point.o line.o

# 
# The main target.  When someone types make, make thinks that means to make all
# and we tell it all, in this case, means to make main.
#

all:: main

# This is the rule to make main.  
#  It depends on main.c mydebug.h line.h point.h mygraph.h plus the objects 
#  defined in OBJS  (point.o line.o).  

main: ${OBJS} main.c mydebug.h line.h point.h mygraph.h
	${CC} ${CFLAGS} -o $@  main.c ${OBJS} ${SEARCH} ${LIBS}

#
# I allways put a clean in my makefiles.  It helps when you need disk space 
# fast.
#
clean:
	${RM} ${RMFLAGS} main ${OBJS}	

# point.c includes mydebug.h and mygraph.h, thus when you make changes to 
# either of these files, you want to recompile point.o 

point.o: mydebug.h mygraph.h
line.o: mydebug.h point.h mygraph.h

