CUDA makefile example with .c and .cu file extension without using rules "include ../&#

Can anyone please give me a simple cuda makefile example using .c and .cu file without the rule “include …/…/common/common.mk”

My header file location \usr\local\cuda\include and linking libraries location \usr\local\cuda\lib64.

Suppose
main.c file contains main function and a call to a c function something like test() which is in the kernel.cu file. and test() calls a kernel in the same kernel.cu file.

Thanks,

all: cudatest

test.o: test.cu
nvcc -c -O3 test.cu

cudatest: main.c test.o
nvcc -o cudatest main.c test.o

Hello everyone,
It is quite old post, but for those who search please try this link: