# Lines starting with the pound sign are comments.
#
# These things are options that you might need
# to tweak.

OBJS = io.o init.o compute.o
EXECUTABLE = myprogram

# You can modify the below as well, but probably
# won't need to.

CC = gcc
CFLAGS = -Wall
COMPILE = $(CC) $(CFLAGS) -c

# "all" is the default target. Simply make it point to myprogram.

all: $(EXECUTABLE)

# Define the components of the program, and how to link them together.
# These components are defined as dependencies; that is, they must be
# made up-to-date before the code is linked.

$(EXECUTABLE): $(OBJS)
	$(CC) -o $(EXECUTABLE) $(OBJS)

# Add any special rules here.

io.o init.o: myprogram.h

# Specify that all .o files depend on .c files, and indicate how
# the .c files are converted (compiled) to the .o files.

%.o: %.c
	$(COMPILE) -o $@ $<

clean:
	-rm $(OBJS) $(EXECUTABLE) *~
