# File:          Makefile
# Author:        Henry M. Walker
# Created:       20 April 2008
# Simplified:    18 November 2011
# Acknowledgement:  adapted from an example by Marge Coahran
#----------------------------------------------------------------------------
# Use the clang compiler
CC = clang

# Set compilation flags
#   -g          include debugging information
#   -Wall       report all warnings
#   -std=c11    use the 2011 version of the C standard
CFLAGS = -g -Wall -std=c11

#----------------------------------------------------------------------------
# build rules:
#
# Each rule takes the following form  (Note there MUST be a tab,
# as opposed to several spaces, preceeding each command.
#
# target_name:  dependency_list
#	command(s)

all: list

# List program components, what they depend on, and how to compile or link each

list:  list.o list-proc.o
	$(CC) -o $@ $^

list.o:  list.c node.h list-proc.h
	$(CC) $(CFLAGS) -c $<

list-proc.o:  list-proc.c list-proc.h node.h
	$(CC) $(CFLAGS) -c $<

#----------------------------------------------------------------------------
# cleanup rules: To invoke this command, type "make clean".
# Use this target to clean up your directory, deleting (without warning) 
#   the built program, object files, old emacs source versions, and core dumps.

clean:
	rm -f list *.o *~ core*
