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.cuh nvcc -c

I had the following error,

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

ivrmse is function defined in

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


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