# ============================================================================== # Unix Makefile for libxnd # ============================================================================== LIBSTATIC = @LIBSTATIC@ LIBNAME = @LIBNAME@ LIBSONAME = @LIBSONAME@ LIBSHARED = @LIBSHARED@ CC = @CC@ CXX = @CXX@ LD = @LD@ AR = @AR@ RANLIB = @RANLIB@ CUDA_CXX = @CUDA_CXX@ GM_INCLUDES = @CONFIGURE_INCLUDES@ CONFIGURE_CFLAGS = @CONFIGURE_CFLAGS@ GM_CFLAGS = $(strip -I.. -I$(GM_INCLUDES) $(CONFIGURE_CFLAGS) $(CFLAGS)) GM_CFLAGS_SHARED = $(GM_CFLAGS) -fPIC CONFIGURE_CXXFLAGS = @CONFIGURE_CXXFLAGS@ GM_CXXFLAGS = $(strip -I$(GM_INCLUDES) $(CONFIGURE_CXXFLAGS) $(CXXFLAGS)) GM_CXXFLAGS_SHARED = $(GM_CXXFLAGS) -fPIC CONFIGURE_LDFLAGS = @CONFIGURE_LDFLAGS@ GM_LDFLAGS = $(strip $(CONFIGURE_LDFLAGS) $(LDFLAGS)) CONFIGURE_CUDA_CXXFLAGS = @CONFIGURE_CUDA_CXXFLAGS@ GM_CUDA_CXXFLAGS = $(strip $(CONFIGURE_CUDA_CXXFLAGS) $(CUDA_CXXFLAGS)) default: $(LIBSTATIC) $(LIBSHARED) OBJS = apply.o func.o nploops.o tbl.o thread.o xndloops.o cpu_host_unary.o \ cpu_device_unary.o cpu_host_binary.o cpu_device_binary.o common.o \ examples.o graph.o quaternion.o pdist.o SHARED_OBJS = .objs/apply.o .objs/func.o .objs/nploops.o .objs/tbl.o .objs/thread.o .objs/xndloops.o \ .objs/cpu_host_unary.o .objs/cpu_device_unary.o .objs/cpu_host_binary.o .objs/cpu_device_binary.o \ .objs/common.o .objs/examples.o .objs/graph.o .objs/quaternion.o .objs/pdist.o ifdef CUDA_CXX OBJS += cuda_host_unary.o cuda_device_unary.o cuda_host_binary.o cuda_device_binary.o SHARED_OBJS += .objs/cuda_host_unary.o .objs/cuda_device_unary.o .objs/cuda_host_binary.o .objs/cuda_device_binary.o endif $(LIBSTATIC): Makefile $(OBJS) $(AR) rc $(LIBSTATIC) $(OBJS) $(RANLIB) $(LIBSTATIC) $(LIBSHARED): Makefile $(SHARED_OBJS) $(LD) $(GM_LDFLAGS) -o $(LIBSHARED) $(SHARED_OBJS) ln -sf $(LIBSHARED) $(LIBNAME) ln -sf $(LIBSHARED) $(LIBSONAME) apply.o:\ Makefile apply.c gumath.h $(CC) $(GM_CFLAGS) -c apply.c .objs/apply.o:\ Makefile apply.c gumath.h $(CC) $(GM_CFLAGS_SHARED) -c apply.c -o .objs/apply.o func.o:\ Makefile func.c gumath.h $(CC) $(GM_CFLAGS) -c func.c .objs/func.o:\ Makefile func.c gumath.h $(CC) $(GM_CFLAGS_SHARED) -c func.c -o .objs/func.o nploops.o:\ Makefile nploops.c gumath.h $(CC) $(GM_CFLAGS) -c nploops.c .objs/nploops.o:\ Makefile nploops.c gumath.h $(CC) $(GM_CFLAGS_SHARED) -c nploops.c -o .objs/nploops.o tbl.o:\ Makefile tbl.c gumath.h $(CC) $(GM_CFLAGS) -c tbl.c .objs/tbl.o:\ Makefile tbl.c gumath.h $(CC) $(GM_CFLAGS_SHARED) -c tbl.c -o .objs/tbl.o thread.o:\ Makefile thread.c gumath.h $(CC) $(GM_CFLAGS) -c thread.c .objs/thread.o:\ Makefile thread.c gumath.h $(CC) $(GM_CFLAGS_SHARED) -c thread.c -o .objs/thread.o xndloops.o:\ Makefile xndloops.c gumath.h $(CC) $(GM_CFLAGS) -c xndloops.c .objs/xndloops.o:\ Makefile xndloops.c gumath.h $(CC) $(GM_CFLAGS_SHARED) -c xndloops.c -o .objs/xndloops.o cpu_device_unary.o:\ Makefile kernels/cpu_device_unary.cc kernels/common.h gumath.h $(CXX) -I. $(GM_CXXFLAGS) -Wno-absolute-value -c kernels/cpu_device_unary.cc .objs/cpu_device_unary.o:\ Makefile kernels/cpu_device_unary.cc kernels/common.h gumath.h $(CXX) -I. $(GM_CXXFLAGS_SHARED) -Wno-absolute-value -c kernels/cpu_device_unary.cc -o .objs/cpu_device_unary.o cpu_host_unary.o:\ Makefile kernels/cpu_host_unary.c kernels/common.h gumath.h $(CC) -I. $(GM_CFLAGS) -Wno-absolute-value -c kernels/cpu_host_unary.c .objs/cpu_host_unary.o:\ Makefile kernels/cpu_host_unary.c kernels/common.h gumath.h $(CC) -I. $(GM_CFLAGS_SHARED) -Wno-absolute-value -c kernels/cpu_host_unary.c -o .objs/cpu_host_unary.o cpu_host_binary.o:\ Makefile kernels/cpu_host_binary.c kernels/common.h gumath.h $(CC) -I. $(GM_CFLAGS) -c kernels/cpu_host_binary.c .objs/cpu_host_binary.o:\ Makefile kernels/cpu_host_binary.c kernels/common.h gumath.h $(CC) -I. $(GM_CFLAGS_SHARED) -c kernels/cpu_host_binary.c -o .objs/cpu_host_binary.o cpu_device_binary.o:\ Makefile kernels/cpu_device_binary.cc kernels/common.h gumath.h $(CXX) -I. $(GM_CXXFLAGS) -c kernels/cpu_device_binary.cc .objs/cpu_device_binary.o:\ Makefile kernels/cpu_device_binary.cc kernels/common.h gumath.h $(CXX) -I. $(GM_CXXFLAGS_SHARED) -c kernels/cpu_device_binary.cc -o .objs/cpu_device_binary.o common.o:\ Makefile kernels/common.c kernels/common.h gumath.h common.o:\ Makefile kernels/common.c kernels/common.h gumath.h $(CC) -I. $(GM_CFLAGS) -c kernels/common.c .objs/common.o:\ Makefile kernels/common.c kernels/common.h gumath.h $(CC) -I. $(GM_CFLAGS_SHARED) -c kernels/common.c -o .objs/common.o examples.o:\ Makefile extending/examples.c gumath.h $(CC) -I. $(GM_CFLAGS) -c extending/examples.c -o examples.o .objs/examples.o:\ Makefile extending/examples.c gumath.h $(CC) -I. $(GM_CFLAGS_SHARED) -c extending/examples.c -o .objs/examples.o graph.o:\ Makefile extending/graph.c gumath.h $(CC) -I. $(GM_CFLAGS) -c extending/graph.c -o graph.o .objs/graph.o:\ Makefile extending/graph.c gumath.h $(CC) -I. $(GM_CFLAGS_SHARED) -c extending/graph.c -o .objs/graph.o quaternion.o:\ Makefile extending/quaternion.c gumath.h $(CC) -I. $(GM_CFLAGS) -c extending/quaternion.c -o quaternion.o .objs/quaternion.o:\ Makefile extending/quaternion.c gumath.h $(CC) -I. $(GM_CFLAGS_SHARED) -c extending/quaternion.c -o .objs/quaternion.o pdist.o:\ Makefile extending/pdist.c gumath.h $(CC) -I. $(GM_CFLAGS) -c extending/pdist.c -o pdist.o .objs/pdist.o:\ Makefile extending/pdist.c gumath.h $(CC) -I. $(GM_CFLAGS_SHARED) -c extending/pdist.c -o .objs/pdist.o # Cuda cuda_host_unary.o:\ Makefile kernels/cuda_host_unary.c kernels/common.h kernels/cuda_device_unary.h gumath.h $(CC) -I. $(GM_CFLAGS) -Wno-absolute-value -c kernels/cuda_host_unary.c .objs/cuda_host_unary.o:\ Makefile kernels/cuda_host_unary.c kernels/common.h kernels/cuda_device_unary.h gumath.h $(CC) -I. $(GM_CFLAGS_SHARED) -Wno-absolute-value -c kernels/cuda_host_unary.c -o .objs/cuda_host_unary.o cuda_device_unary.o:\ Makefile kernels/cuda_device_unary.cu kernels/common.h kernels/cuda_device_unary.h gumath.h $(CUDA_CXX) --compiler-options "$(GM_CXXFLAGS)" $(GM_CUDA_CXXFLAGS) -c kernels/cuda_device_unary.cu .objs/cuda_device_unary.o:\ Makefile kernels/cuda_device_unary.cu kernels/common.h kernels/cuda_device_unary.h gumath.h $(CUDA_CXX) --compiler-options "$(GM_CXXFLAGS_SHARED)" $(GM_CUDA_CXXFLAGS) -c kernels/cuda_device_unary.cu -o .objs/cuda_device_unary.o cuda_host_binary.o:\ Makefile kernels/cuda_host_binary.c kernels/common.h kernels/cuda_device_binary.h gumath.h $(CC) -I. $(GM_CFLAGS) -Wno-absolute-value -c kernels/cuda_host_binary.c .objs/cuda_host_binary.o:\ Makefile kernels/cuda_host_binary.c kernels/common.h kernels/cuda_device_binary.h gumath.h $(CC) -I. $(GM_CFLAGS_SHARED) -Wno-absolute-value -c kernels/cuda_host_binary.c -o .objs/cuda_host_binary.o cuda_device_binary.o:\ Makefile kernels/cuda_device_binary.cu kernels/common.h kernels/cuda_device_binary.h gumath.h $(CUDA_CXX) --compiler-options "$(GM_CXXFLAGS)" $(GM_CUDA_CXXFLAGS) -c kernels/cuda_device_binary.cu .objs/cuda_device_binary.o:\ Makefile kernels/cuda_device_binary.cu kernels/common.h kernels/cuda_device_binary.h gumath.h $(CUDA_CXX) --compiler-options "$(GM_CXXFLAGS_SHARED)" $(GM_CUDA_CXXFLAGS) -c kernels/cuda_device_binary.cu -o .objs/cuda_device_binary.o # Coverage coverage:\ Makefile clean runtest ./tests/runtest for file in *.c; do gcov -l "$$file" > /dev/null 2>&1; done FORCE: clean: FORCE rm -f *.o *.so *.gch *.gcda *.gcno *.gcov *.dyn *.dpi *.lock rm -f $(LIBSTATIC) $(LIBSHARED) $(LIBSONAME) $(LIBNAME) cd .objs && rm -f *.o *.so *.gch *.gcda *.gcno *.gcov *.dyn *.dpi *.lock distclean: clean rm -f Makefile