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

6
TARGET = libclfft.a
7
TARGET2 = libclfft.so
8

9
CXXFLAGS += -O3 -Wall -g -I$(NVIDIA_SDK_INSTALL_PATH)/OpenCL/common/inc -I$(AMDAPPSDKROOT)/include -I../include -fPIC
10
11
12
13
14
15
16
OS = $(shell uname -s)
ifeq ($(OS), Darwin)
	CXXFLAGS += -I/System/Library/Frameworks
endif

OBJECTS = fft_setup.o fft_execute.o fft_kernelstring.o

Bernd Machenschalk's avatar
Bernd Machenschalk committed
17
PREFIX ?= "."
18
19

$(TARGET): $(OBJECTS)
20
	$(AR) rcs $(TARGET) $(OBJECTS)
21
	$(CXX) -shared -o $(TARGET2) $(OBJECTS)
22
23
	mkdir -p ../lib
	cp $(TARGET) ../lib/
24
	cp $(TARGET2) ../lib/
25
26

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

29
fft_execute.o: fft_execute.cpp ../include/clFFT.h fft_internal.h
30
	$(CXX) $(CXXFLAGS) -c fft_execute.cpp
31
32

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

Bernd Machenschalk's avatar
Bernd Machenschalk committed
35
36
37
38
install: $(TARGET) ../include/clFFT.h
	mkdir -p $(PREFIX)/lib $(PREFIX)/include
	cp  ../include/clFFT.h $(PREFIX)/include/eclfft.h
	cp  $(TARGET) $(PREFIX)/lib/libeclfft.a
39
	cp  $(TARGET2) $(PREFIX)/lib/libeclfft.so
Bernd Machenschalk's avatar
Bernd Machenschalk committed
40

41
42
clean:
	rm -f *.o
43
	rm -f *.a