how to support .cu file to dsexample_lib?

> dsexample_lib
   > (new add)
   >cudaCrop.h (new add)
   >cudaUtility.h (new add)
   >cudaMath.h (new add)

here is my document tree. i wanna call cuda_function.

in dsexample_lib.h file, the cudaCrop.h is included

#include "cudaCrop.h"
/* other code*/

is there any suggestion?

run: dsexample_lib.o cudaCrop.o
	gcc -L /usr/local/cuda-10.0/lib64 -c -o dsexample_lib_cuda.o -fPIC dsexample_lib.o cudaCrop.o -lcudart -lcuda

dsexample_lib.o: dsexample_lib.c cudaCrop.h
	gcc -I /usr/local/cuda-10.0/include -I . -c -o dsexample_lib.o dsexample_lib.c

cudaCrop.o: cudaCrop.h
	$(NVCC) -c -o cudaCrop.o

	ar rcs libdsexample.a dsexample_lib_cuda.o

here is my makefile. i am using deepstream4.0 jetson nano
but it throws out this error!

gcc -L /usr/local/cuda-10.0/lib64 -c -o dsexample_lib_cuda.o -fPIC dsexample_lib.o cudaCrop.o -lcudart -lcuda
gcc: warning: dsexample_lib.o: linker input file unused because linking not done
gcc: warning: cudaCrop.o: linker input file unused because linking not done

could you refer the Makefile under sources/objectDetector_Yolo/nvdsinfer_custom_impl_Yolo.

the yolo compile the .cu as .so
but the gst-dsexample require .a
Hi , thank you very much, finally i finish it
finally , i use this makefile

CC:= g++

CFLAGS:=-Wall -std=c++11
CFLAGS+=-I/usr/local/cuda-$(CUDA_VER)/include dsexample_lib.c
INCS:= $(wildcard *.h)
# $(warning $(TARGET_OBJS))

LIBS:=-L/usr/local/cuda-$(CUDA_VER)/lib64 -lcudart -lcublas
LFLAGS:=-Wl,--start-group $(LIBS) -Wl,--end-group

TARGET_LIB:= libdsexample.a

all: $(TARGET_LIB)

%.o: $(INCS) Makefile
	$(NVCC) -c -o $@ --compiler-options '-lib' $<

%.o: %.c $(INCS) Makefile
	$(CC) -c -o $@ $(CFLAGS) $<

	ar rcs -o $@  $(TARGET_OBJS)

	rm -rf $(TARGET_LIB)