Makefile.am 1.58 KB
Newer Older
1
SUFFIXES=.c .cu
2
AM_CPPFLAGS = -I$(top_srcdir)/include $(PTHREAD_CFLAGS)
3
AM_LDFLAGS = $(PTHREAD_LIBS)
4
noinst_LTLIBRARIES=
5

6 7
#############################################
# .C sources
8 9 10 11 12

AREA_SOURCES = \
	       area/area.c \
	       area/linux.c

13 14 15 16 17
LAYOUT_SOURCES = \
	       layout/layout.c \
	       layout/dense.c \
	       layout/reshape.c

18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
DMA_SOURCES = \
	      dma/dma.c \
	      dma/dma_linux_par.c \
	      dma/dma_linux_seq.c

SCRATCH_SOURCES = \
		  scratch/scratch.c \
		  scratch/scratch_par.c \
		  scratch/scratch_seq.c

TILING_SOURCES = \
		 tiling/tiling.c \
		 tiling/tiling_1d.c \
		 tiling/tiling_2d.c

UTILS_SOURCES = \
		utils/bitmap.c \
		utils/error.c \
		utils/vector.c

LIB_SOURCES = \
	      $(AREA_SOURCES) \
	      $(DMA_SOURCES) \
	      $(SCRATCH_SOURCES) \
	      $(TILING_SOURCES) \
43
	      $(LAYOUT_SOURCES) \
44
	      $(UTILS_SOURCES) \
45
	      $(CUDA_AREA_SOURCES) \
46
	      aml.c
47

48
lib_LTLIBRARIES = libaml.la
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77

libaml_la_LDFLAGS=
libaml_la_SOURCES=$(LIB_SOURCES)

#############################################
# Cuda sources

if BUILD_CUDA

# Build .c sources using cuda runtime library.
libaml_la_SOURCES+=area/cuda.c
libaml_la_LDFLAGS+=-lcudart

# Build .cu sources containing device code.
#
# CUDA_LO_FILES= # .lo files result of .cu files.
# CUDA_FLAGS=--x=cu
#
# .cu.lo: .cu
# 	$(NVCC) $(CUDA_FLAGS) -I$(top_srcdir)/include -dc -o $<.cu.o $<
# 	$(NVCC) $(CUDA_FLAGS) -I$(top_srcdir)/include -c -o $<.o $<
# 	$(top_builddir)/o2lo $@ $<.cu.o $<.o
#
# libamlcuda.la: $(CUDA_LO_FILES)
# 	$(LIBTOOL) --tag=CC --mode=link $(NVCC) -dlink -o $@ $< -lcudart
#
# libaml_la_LIBADD+=libamlcuda.la

endif