Makefile 921 Bytes
Newer Older
1
2
PWD = $(shell pwd)
NVIDIA_SDK_INSTALL_PATH ?= /usr/local/cuda
3
AMDAPPSDKROOT ?= /opt/AMDAPP
4
CXX ?= g++
5

6
7
TARGET = clfft_example

8
9
10
11
12
13
14
15
16
17
18
19
20
ifndef OPENCL_INCLUDE
ifdef CUDA_INSTALL_PATH
OPENCL_INCLUDE = $(CUDA_INSTALL_PATH)/include
endif
ifdef OPENCL_INSTALL_PATH
OPENCL_INCLUDE = $(OPENCL_INSTALL_PATH)/include
endif
endif
ifndef OPENCL_INCLUDE
OPENCL_INCLUDE = $(AMDAPPSDKROOT)/include -I$(NVIDIA_SDK_INSTALL_PATH)/OpenCL/common/inc
endif

CXXFLAGS += -O3 -Wall -g -I$(OPENCL_INCLUDE) -I../include -fPIC
21
LDFLAGS += $(PWD)/../lib/libclfft.a
22
23

OS = $(shell uname -s)
24
ARCH = $(shell uname -m)
Oliver Bock's avatar
Oliver Bock committed
25
26
27
ifneq ($(ARCH), x86_64)
        ARCH = x86
endif
28
29
ifeq ($(OS), Darwin)
	LDFLAGS += -framework OpenCL
30
	LDFLAGS += -framework Accelerate
31
else
32
	LDFLAGS += -L$(AMDAPPSDKROOT)/lib/$(ARCH)
33
	LDFLAGS += -lOpenCL
34
35
36
endif


37
$(TARGET): main.cpp Makefile $(PWD)/../lib/libclfft.a
38
	$(CXX) $(CXXFLAGS) main.cpp $(LDFLAGS) -o $(TARGET)
39
40
41

clean:
	rm -f $(TARGET)