Commit 167e5b78 authored by Bernd Machenschalk's avatar Bernd Machenschalk
Browse files

Makefile improvements

- allow to build shared and static versions separately

- fix OSX shared build
parent 7439e79e
......@@ -3,25 +3,33 @@ AMDAPPSDKROOT ?= /opt/AMDAPP
CXX ?= g++
AR ?= ar
TARGET = libclfft.a
TARGET = libeclfft.a
CXXFLAGS += -O3 -Wall -g -I$(NVIDIA_SDK_INSTALL_PATH)/OpenCL/common/inc -I$(AMDAPPSDKROOT)/include -I../include -fPIC
OS = $(shell uname -s)
ifeq ($(OS), Darwin)
CXXFLAGS += -I/System/Library/Frameworks
LDFLAGS += -framework OpenCL
OBJECTS = fft_setup.o fft_execute.o fft_kernelstring.o
PREFIX ?= "."
default: static shared
static: $(TARGET)
shared: $(TARGET2)
$(AR) rcs $(TARGET) $(OBJECTS)
$(CXX) -shared -o $(TARGET2) $(OBJECTS)
mkdir -p ../lib
cp $(TARGET) ../lib/
cp $(TARGET2) ../lib/
cp $(TARGET) ../lib/libclfft.a
$(CXX) $(LDFLAGS) -shared -o $(TARGET2) $(OBJECTS)
fft_setup.o: fft_setup.cpp fft_internal.h fft_base_kernels.h
$(CXX) $(CXXFLAGS) -c fft_setup.cpp
......@@ -35,9 +43,7 @@ fft_kernelstring.o: fft_kernelstring.cpp ../include/clFFT.h fft_internal.h
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
cp $(TARGET2) $(PREFIX)/lib/
cp libeclfft.* $(PREFIX)/lib/
rm -f *.o
rm -f *.a
rm -f *.o *.a *.so
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment