makefile “no rule to make a target” error

后端 未结 1 335
甜味超标
甜味超标 2021-01-29 04:31

I have been looking at this problem for a while and still don\'t know what is wrong.

My makefile looks like:

    F90    = pgf90
NETCDF_DIR = /opt/netcdf
         


        
1条回答
  •  庸人自扰
    2021-01-29 05:10

    Make doesn't know that .f90 is a suffix, so your suffix rule is not valid. It's not enough to just declare a suffix rule if make doesn't know about the suffix. If you want to use suffix rules, you also have to add the new suffix with the .SUFFIXES pseudo-target, like this:

    .SUFFIXES: .f90
    

    Or you can use pattern rules, which don't require this (but are GNU make-specific):

    %.o : %.f90
            ${F90} -c ${INCLUDE_MODULES} $<
    

    0 讨论(0)
提交回复
热议问题