I have a small makefile that I've "home-grown" over a couple of months.
It uses the nvcc compiler to build a shared library, and builds on Gentoo and Ubuntu.
I'd like to convert this to Autotools.
I could read a lot of docs, and I probably will, but I wouldn't mind paying a little to get a head start.
## Deliverables
This is the makefile in it's entirety that I'd like converted.
FILENAME=regression
BINNAME=CudaCallC
NVCCFLAGS=--compiler-options '-fPIC'
ifeq (,$(findstring Ubuntu,$(shell uname -v)))
JAVA=$(shell readlink --canonicalize $(JAVA_HOME))
else
JAVA=/usr/lib/jvm/java-6-sun-1.6.0.15
endif
LINKPARAMS=-lconfig++ -lxerces-c
PARSERCOMPILE=flex [login to view URL] && bison -d PFtIF.y && cc -Wall -Wextra -pedantic -Wfloat-equal lex.yy.c PFtIF.tab.c -o PFtIF && mv PFtIF ../../../
ifeq (,$(findstring Ubuntu,$(shell uname -v)))
# Gentoo
CUDADIR=/opt/cuda/sdk/C/common/inc
JAVADIR=$(shell readlink --canonicalize $(JAVA_HOME))
ifeq ($(shell uname -m), x86_64)
LINKPARAMS+=-L/opt/cuda/lib64/ -lcudart
else
LINKPARAMS+=-L/opt/cuda/lib/ -lcudart
endif
else
# Ubuntu
CUDADIR=/home/pps-admin/NVIDIA_GPU_Computing_SDK/C/common/inc
JAVADIR=/usr/lib/jvm/java-6-sun-1.6.0.15
NVCCFLAGS+=--compiler-bindir=/home/pps-admin/NVIDIA_GPU_Computing_SDK/C/mygcc
endif
INCLUDEDIRS=-I$(CUDADIR) -I$(JAVADIR)/include -I$(JAVADIR)/include/linux
COMPILEPARAMS=$(INCLUDEDIRS)
COMPILEPARAMS+=$(LINKPARAMS)
all:
$(PARSERCOMPILE) && rm PFtIF.tab.c PFtIF.tab.h lex.yy.c
nvcc -shared $(NVCCFLAGS) [login to view URL] $(COMPILEPARAMS) -o lib$(BINNAME).so -arch=sm_13
clean:
rm -f PFtIF.tab.c PFtIF.tab.h lex.yy.c [login to view URL] regression.cu_o [login to view URL]