Commit 137b4784 authored by Bernd Machenschalk's avatar Bernd Machenschalk
Browse files

Merge branch 'improve_Makefile' into 'master'

Makefile improvements

See merge request !3
parents 7439e79e 4967ca64
default: linux
linux:
$(MAKE) -C src
$(MAKE) -C example
linux: static shared sample
macos: linux
static:
$(MAKE) -C src static
shared:
$(MAKE) -C src shared
macos:
$(MAKE) -C src
sample:
$(MAKE) -C example
win32:
......
......@@ -5,7 +5,19 @@ CXX ?= g++
TARGET = clfft_example
CXXFLAGS += -O3 -Wall -g -I$(NVIDIA_SDK_INSTALL_PATH)/OpenCL/common/inc -I$(AMDAPPSDKROOT)/include -I../include
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
LDFLAGS += $(PWD)/../lib/libclfft.a
OS = $(shell uname -s)
......
......@@ -3,25 +3,45 @@ AMDAPPSDKROOT ?= /opt/AMDAPP
CXX ?= g++
AR ?= ar
TARGET = libclfft.a
TARGET2 = libclfft.so
TARGET = libeclfft.a
TARGET2 = libeclfft.so
CXXFLAGS += -O3 -Wall -g -I$(NVIDIA_SDK_INSTALL_PATH)/OpenCL/common/inc -I$(AMDAPPSDKROOT)/include -I../include -fPIC
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
OS = $(shell uname -s)
ifeq ($(OS), Darwin)
CXXFLAGS += -I/System/Library/Frameworks
LDFLAGS += -framework OpenCL
endif
OBJECTS = fft_setup.o fft_execute.o fft_kernelstring.o
PREFIX ?= "."
default: static shared
static: $(TARGET)
shared: $(TARGET2)
$(TARGET): $(OBJECTS)
$(AR) rcs $(TARGET) $(OBJECTS)
$(CXX) -shared -o $(TARGET2) $(OBJECTS)
mkdir -p ../lib
cp $(TARGET) ../lib/
cp $(TARGET2) ../lib/
cp $(TARGET) ../lib/libclfft.a
$(TARGET2): $(OBJECTS)
$(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
......@@ -32,12 +52,10 @@ fft_execute.o: fft_execute.cpp ../include/clFFT.h fft_internal.h
fft_kernelstring.o: fft_kernelstring.cpp ../include/clFFT.h fft_internal.h
$(CXX) $(CXXFLAGS) -c fft_kernelstring.cpp
install: $(TARGET) ../include/clFFT.h
install: ../include/clFFT.h libeclfft.*
mkdir -p $(PREFIX)/lib $(PREFIX)/include
cp ../include/clFFT.h $(PREFIX)/include/eclfft.h
cp $(TARGET) $(PREFIX)/lib/libeclfft.a
cp $(TARGET2) $(PREFIX)/lib/libeclfft.so
cp libeclfft.* $(PREFIX)/lib/
clean:
rm -f *.o
rm -f *.a
rm -f *.o *.a *.so
......@@ -3,7 +3,7 @@ AMDAPPSDKROOT ?= /opt/AMDAPP
CXX ?= i586-mingw32msvc-g++
AR ?= i586-mingw32msvc-ar
TARGET = libclfft.a
TARGET = libeclfft.a
CXXFLAGS += -O3 -Wall -g -I$(NVIDIA_SDK_INSTALL_PATH)/OpenCL/common/inc -I$(AMDAPPSDKROOT)/include -I../include
......
Markdown is supported
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