# Makefile for drawing programs
# P. Conrad 10/24/04
# Every line that starts with a # is a comment

# The line CCC= g++ says that we are using "g++" as the C compiler.
# You could change it to say CCC= CC instead.

CCC= g++

# the \ at the end of a line says to "continue the definition on the next
# line.  Note that there CANNOT be any spaces after the \; it must be
# EXACTLY the last character on the line.

BINARIES = drawNightFlags \
	drawTexasFlag 

PNGFILES = drawNightFlags.png \
	drawTexasFlag.png 

all: ${BINARIES} ${PNGFILES}

TARGETDIR = ${HOME}/public_html/cisc181/lab04

install: ${PNGFILES}
	mkdir -p -m 755 ${TARGETDIR}
	cp ${PNGFILES} ${TARGETDIR}
	chmod -R a+rx ${TARGETDIR} 

drawings.o: drawings.cpp drawings.h
	$(CCC) -c drawings.cpp

drawNightFlags.png: drawNightFlags
	chmod u+x drawNightFlags.sh
	./drawNightFlags.sh

drawNightFlags: drawings.o drawNightFlags.o
	$(CCC) drawings.o drawNightFlags.o -o $@ 

drawNightFlags.o: drawNightFlags.cpp drawings.h
	$(CCC) -c drawNightFlags.cpp 

drawTexasFlag.png: drawTexasFlag
	chmod u+x drawTexasFlag.sh
	./drawTexasFlag.sh

drawTexasFlag: drawings.o drawTexasFlag.o
	$(CCC) drawings.o drawTexasFlag.o -o $@ 

drawTexasFlag.o: drawTexasFlag.cpp drawings.h
	$(CCC) -c drawTexasFlag.cpp 


clean:
	/bin/rm -f *.o *.dat *.gnuplot a.out core
	/bin/rm -f ${BINARIES} ${PNGFILES} 
