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/”

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

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


all: cudatest

nvcc -c -O3

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: