Compil with multi cuf file and module

I have 38 file that I must to compile to build my exe. And each cuf file are module. So when I use my makefile, I have this error :

NVFORTRAN-F-0004-Unable to open MODULE file module_variables.mod (…/AdhesiveDegradation.cuf: 18)

How I can compile and to know the dependency between the files automatically.

I linked my makefile. If you can help me to perform it in the same time, thank a lot !!

Makefile (4.5 KB)

Hi Troger,

It’s too big of a topic for the forums to teach make, but there’s plenty of tutorials online. Also for your reference, the manual for using make can be found at: GNU make

The basic problem with your current makefile is that you have the build rule comprised of all the compilation lines. To have make build a dependency tree, each object needs it’s own rule with the dependent objects listed on this rule. Alternately, you could create generic rules and then include a dependency file.

There are several utilities that can help determine Fortran dependencies, such as “makedepf90”.

It’s been some number of years since I’ve used makedepf90 myself, so don’t know if it will work for your case, but worth a try. If anything, the link has an example makefile using generic rules and a dependency file that you can use as reference.

Worst case if you can’t get one of these utilities, it’s not too difficult to grep the source for use statements and manually create the dependency list.

Hope this helps,