CC = g++
C	= cpp
H	= h

CFLAGS = -g

# path to directory holding the ezdraw.h file
IDIR = ~/ezdraw/
# path to the directory holding the libezdraw.a files
LDIR = ~/ezdraw/

# loader flags showing where to find the SDL libraries
LDFLAGS = `sdl2-config --libs` -lm

# non SDL libraries to load: ezdraw and math library
LIBS = -lezdraw -lm

# compiler flags for maximum warnings, debugger information,
# and where to find SDL include files
CFLAGS = `sdl2-config --cflags` -g -W -Wall -Wextra -pedantic -O0 -I `sdl2-config --prefix`/include/

HFILES = Shape.h Circle.h Triangle.h
OFILES = Shape.o Circle.o Triangle.o

PROJECT = shapes

${PROJECT}:	${PROJECT}.o ${OFILES}
	${CC} ${CFLAGS} -o ${PROJECT} ${PROJECT}.o ${OFILES} -L $(LDIR) $(LIBS) ${LDFLAGS}

${PROJECT}.o: ${PROJECT}.${C} ${HFILES}
	${CC} ${CFLAGS} -I $(IDIR) -c ${PROJECT}.${C}
	
Shape.o:  Shape.cpp Shape.h
	${CC} ${CFLAGS} -I $(IDIR) -c Shape.${C}

Circle.o:  Circle.cpp Circle.h Shape.h
	${CC} ${CFLAGS} -I $(IDIR) -c Circle.${C}

Triangle.o:  Triangle.cpp Triangle.h Shape.h
	${CC} ${CFLAGS} -I $(IDIR) -c Triangle.${C}

clean:
	rm -f *.o *~ ${PROJECT}

