Can I use nvcc to compile .cu file with .cuh file?

I have tried to compile files with command: nvcc -ptx file2.cu
In file2.cu I have included file1.cuh. But the ptx file I get is empty with the following information only:
.version 5.0
.target sm_20
.address_size 64
So I can only move the codes in file1.cuh to file2.cu? Can I compile a file2.cu, which include file1.cuh?

Yes, you can compile that way. There are various CUDA sample codes that demonstrate this. It’s impossible to identify what is happening in your case, based on what you have provided.