# Die folgenden 2 Zeilen sind unter Linux schon vordefiniert,
# andere Systeme brauchen diese Definitionen eventuell?
CC=gcc
CXX=g++

#h = ~/xtekplot1/h  # falls nicht schon im .profile oder .bashrc definiert
#WARN = -Wall #so fuer neue Programme
# nach Wall koennen noch Ausnahmen geschaltet werden:
#WARN = -Wall -Wno-unused-result -Wno-parentheses -Wno-unused-variable -Wno-write-strings
WARN = -Wall -Wno-unused-result -Wno-parentheses 
#DEBUG= -ggdb  # fuer den Gnu-Debugger
OPT  = -O3  #-O3 fuer moeglichst schnell?, -Os fuer moeglist kurz
CFLAGS  = -pthread -std=c++11 $(WARN) $(OPT) $(DEBUG) 
CXXFLAGS= $(CFLAGS)
LDFLAGS = -L/usr/X11R6/lib $(DEBUG)
MYLIBS  = $h/xtekplot1.o 
LDLIBS  = -lm -lX11 -lcudart -lOpenCL

all: beispiel2

beispiel2: beispiel2.cc beispiel2.h beispiel2_opencl.o beispiel2_cuda.o

beispiel2_cuda.o: beispiel2_cuda.cu
	nvcc -c beispiel2_cuda.cu -o beispiel2_cuda.o

beispiel2_opencl.o: beispiel2_opencl.cc

install:
	cp beispiel2 $(HOME)/bin

clean:
	rm -f *.o *~
clean_all:
	rm -f *.o *~
	rm -f beispiel?
