Makefile 1.42 KB
Newer Older
1
NVIDIA_SDK_INSTALL_PATH ?= /usr/local/cuda
2
AMDAPPSDKROOT ?= /opt/AMDAPP
3
4
CXX ?= g++
AR ?= ar
5

Bernd Machenschalk's avatar
Bernd Machenschalk committed
6
7
TARGET = libeclfft.a
TARGET2 = libeclfft.so
8

9
10
11
12
13
14
15
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
16
17
18
endif
ifndef OPENCL_INCLUDE
OPENCL_INCLUDE = $(AMDAPPSDKROOT)/include -I$(NVIDIA_SDK_INSTALL_PATH)/OpenCL/common/inc
19
20
21
endif

CXXFLAGS += -O3 -Wall -g -I$(OPENCL_INCLUDE) -I../include -fPIC
22
23
24
OS = $(shell uname -s)
ifeq ($(OS), Darwin)
	CXXFLAGS += -I/System/Library/Frameworks
Bernd Machenschalk's avatar
Bernd Machenschalk committed
25
	LDFLAGS += -framework OpenCL
26
27
28
29
endif

OBJECTS = fft_setup.o fft_execute.o fft_kernelstring.o

Bernd Machenschalk's avatar
Bernd Machenschalk committed
30
PREFIX ?= "."
31

Bernd Machenschalk's avatar
Bernd Machenschalk committed
32
33
34
35
36
37
default: static shared

static: $(TARGET)

shared: $(TARGET2)

38
$(TARGET): $(OBJECTS)
39
	$(AR) rcs $(TARGET) $(OBJECTS)
40
	mkdir -p ../lib
Bernd Machenschalk's avatar
Bernd Machenschalk committed
41
42
43
44
	cp $(TARGET) ../lib/libclfft.a

$(TARGET2): $(OBJECTS)
	$(CXX) $(LDFLAGS) -shared -o $(TARGET2) $(OBJECTS)
45
46

fft_setup.o: fft_setup.cpp fft_internal.h fft_base_kernels.h
47
	$(CXX) $(CXXFLAGS) -c fft_setup.cpp
Bernd Machenschalk's avatar
Bernd Machenschalk committed
48

49
fft_execute.o: fft_execute.cpp ../include/clFFT.h fft_internal.h
50
	$(CXX) $(CXXFLAGS) -c fft_execute.cpp
51
52

fft_kernelstring.o: fft_kernelstring.cpp ../include/clFFT.h fft_internal.h
53
	$(CXX) $(CXXFLAGS) -c fft_kernelstring.cpp
54

55
install: ../include/clFFT.h libeclfft.*
Bernd Machenschalk's avatar
Bernd Machenschalk committed
56
57
	mkdir -p $(PREFIX)/lib $(PREFIX)/include
	cp  ../include/clFFT.h $(PREFIX)/include/eclfft.h
Bernd Machenschalk's avatar
Bernd Machenschalk committed
58
	cp  libeclfft.* $(PREFIX)/lib/
Bernd Machenschalk's avatar
Bernd Machenschalk committed
59

60
clean:
Bernd Machenschalk's avatar
Bernd Machenschalk committed
61
	rm -f *.o *.a *.so