compile cuda file inside a c project

Hello,

I’m trying to rewrite a compression algorithm in cuda, I made the profiling for the C project and I found only one function that takes a long time in the cpu, I rewrote it in cuda, which means I replaced that .c file (containing the function) with a .cu file.
now, the whole project has a makefile that compiles and links the files,
my question is how to compile and link the .cu file newly created with the rest of the project, is there a way to change the makefile or is there any other method to do so?
thanks

You can compile your .cu file
nvcc devicequery.cu -o devicequery,

Then add the binary to the list of dependents in your makefile.