makefile for compiling multiple kernels

Hi,

I am relatively new to CUDA, trying to parallelize kind of a large application that consists of multiple .c files. I wrote two kernels so far, but they should be launched from different .c files. I have used a makefile from SDK to test one of the kernels (it worked fine), but having trouble figuring out how to compile this all with a makefile. So file1.cu has file1_kernel, file2.cu has file2_kernel, both file1.cu and file2.cu share .h files and other .c files. How should i modify the makefile?

[codebox]

Add source files here

EXECUTABLE := my_executable

Cuda source files (compiled with cudacc)

CUFILES := file1.cu \

                     file2.cu

#cuda dependency files:

CU_DEPS := file1_kernel.cu \

                       file1.h

#where should file2_kernel go???

C/C++ source files (compiled with gcc / c++)

CFILES := \

    some1.c \

    some2.c  (bla...bla...)

###########################################

Rules and targets

include …/…/common/common.mk

[/codebox]

any help on this is appreciated…

you can put in CU_DEPS too. In SDK you have a example called dct8x8 with two kernels. Look its makefile. Remember that if you put “make -n” you can see the all lines that makefile will executes.