#  Executables
EX=ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 ex11 ex12 ex13 ex14 ex15 ex16 ex17 ex18 ex19 ex20 ex21 ex22 ex23 ex24 ex25 ex26 ex27 ex28 ex29 ex30 ex31 ex32 ex33

#  Main target
all: $(EX)

#  Generic compile rule
.c.o:
	gcc -c -O -Wall $<

#  Generic compile and link
%: %.c CSCIx229.a
	gcc -Wall -O3 -o $@ $^ -lglut

#  Delete
clean:
	rm -f $(EX) *.o *.a

#  Create archive (include glWindowPos if you need it)
CSCIx229.a:fatal.o loadtexbmp.o print.o project.o errcheck.o
	ar -rcs CSCIx229.a $^

#  Create helloworld files
ex2.c: ex2.c.0;cp -a ex2.c.0 ex2.c
ex3.c: ex3.c.0;cp -a ex3.c.0 ex3.c
ex4.c: ex4.c.0;cp -a ex4.c.0 ex4.c
ex5.c: ex5.c.0;cp -a ex5.c.0 ex5.c

#  Obligatory UNIX inside joke
love:
	@echo "not war?"
