# Optflag for g++. Set to e.g. -O3. May also be empty.
OPTFLAG = -O3
#OPTFLAG =

# Enable blocking calls for correct timing. Increases the total time on gpu
TIMINGFLAG = -DTIMING
#TIMINGFLAG =

# Debugflag for g++. Set to -g to use debugging symbols. Otherwise leave empty.
#DEBUGFLAG = -g
DEBUGFLAG =

all: convolucl

convolucl: convolucl.cpp convolve.o png.o timer.o kernels.hpp
	g++ $(DEBUGFLAG) convolucl.cpp convolve.o png.o timer.o -lOpenCL -lpng $(OPTFLAG) -o convolucl

convolve.o: convolve.cpp timer.o
	g++ $(DEBUGFLAG) -c convolve.cpp $(OPTFLAG) $(TIMINGFLAG) -o convolve.o

png.o: png.cpp
	g++ $(DEBUGFLAG) -c png.cpp $(OPTFLAG) -o png.o

timer.o: timer.cpp
	g++ $(DEBUGFLAG) -c timer.cpp $(OPTFLAG) -o timer.o

clean:
	rm -f convolve.o png.o timer.o types.o
