Re: [CEDET-devel] EDE make project with Fortran 90

David Engster <deng@...> writes:
> I'll try to keep this short: module files (*.mod) are, roughly spoken,
> something like binary includes, i.e. they have to be available at
> compile time. They are generated by the compiler during compilation of
> the source files containing the definition of the modules. In fact, one
> source file can create *two* output files: an object file and a module
> file.
[...]
> Module files result from a normal compilation, but the resulting *.mod
> files do not get linked. Do I have to create a new target for this, or
> is there something readily available that I could use or modify?
Hi Eric,
OK, I think I'm almost there. I've created a very simple target
(defclass ede-proj-target-makefile-fmod (ede-proj-target-makefile)
((menu :initform nil)
(keybindings :initform nil)
(availablecompilers :initform (ede-fmod-compiler))
(sourcetype :initform (ede-f90-source)))
"Target for a single module.")
[... ede-f90-source is defined in ede-proj-obj.el ...]
(defvar ede-fmod-compiler
(ede-compiler
"ede-fmod-compiler"
:name "gfortran"
:variables '(("F90MOD" . "gfortran"))
:commands '("$(F90MOD) -c $<")
:sourcetype '(ede-fmod-source)
)
"Compile Fortran modules.")
(defmethod ede-proj-makefile-sourcevar ((this ede-proj-target-makefile-fmod))
"Return the variable name for THIS's sources."
(concat (ede-pmake-varname this) "_FMODULES"))
(ede-proj-register-target "fmodule" 'ede-proj-target-makefile-fmod)
Now consider a simple example: one source file which generates the
module, and one source file which depends on that module and generates
the program. With the above target everything works if I *first* create
the "fmodule" target, and after that the "program" target. If I do it
vice versa, it fails, since I have
all: program module
in the Makefile, but I need to have 'module' before 'program'. Is there
some easy way to enforce this, no matter in which order I create the
targets?
Regards,
David