makefile question about combining c and cuda code

OBJS=main.o ccode.o cudacode.o
COMP=cc -Wall

main: (OBJS) (COMP) (OBJS) -o main -lm # I also tried to change this (COMP) to nvcc, but still have errors. main.o: main.c ccode.h cudacode.cuh (COMP) -c main.c
ccode.o: ccode.c ccode.h
(COMP) -c ccode.c cudacode.o: cudacode.cu cudacode.cuh nvcc -c cudacode.cu

I had the following error,

main.c:(.text+0xa3a): undefined reference to `ivrmse’

ivrmse is function defined in cudacode.cu.

Is there any problems in my makefile? Can anybody help me out?

Thanks

If I changed all the .c file to .cu and use COMP=nvcc, I have no compiling error.