# neues Muster-Makefile (17.1.2012)

# 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  = -O2  #-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: beispiel1

beispiel1: beispiel1.cc beispiel1.h beispiel1_cuda.o beispiel1_opencl.o

beispiel1_cuda.o: beispiel1_cuda.cu
	nvcc -c beispiel1_cuda.cu -o beispiel1_cuda.o

beispiel1_opencl.o: beispiel1_opencl.cc

install:
	cp beispiel1 $(HOME)/bin

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