I already searched the emacs documentation, the cedet website and here on SO in vain. If my question is already been answered, fell free to (point out to an existing answer and) close it.
I'm trying to familiarize myself with EDE-projects in emacs. So far I can set up a simple project with one or more files.
Now I'd like to separate a part of my code and pack it into a library. Basically I'm trying to achieve the same thing I get with the following hand-written naive Makefile:
matrix:
g++ -c -o lib/libmatrix.o lib/matrix.cpp -std=c++0x
ar crf lib/libmatrix.a lib/libmatrix.o
num:
g++ num.cpp -Llib -Ilib -std=c++0x -o num -g
Here I have a library consisting of "lib/matrix.h" and "lib/matrix.cpp" (it's a toy implementation of a matrix type) and a file "num.cpp" that uses matrix.
I don't know how to tell emacs to compile matrix properly. So far I got the following EDE-project, but of course it doesn't compile.
;; Object Numbers
;; EDE project file.
(ede-proj-project "Numbers"
:name "Numbers"
:file "Project.ede"
:targets (list
(ede-proj-target-makefile-program "num"
:name "num"
:path ""
:source '("num.cpp")
:compiler 'ede-g++-compiler
:linker 'ede-g++-linker
:configuration-variables 'nil
:ldflags '("-std=c++0x" "-Llib" "-Ilib")
:ldlibs '("matrix")
)
(ede-proj-target-makefile-archive "matrix"
:name "matrix"
:path "/lib"
:source '("matrix.cpp")
:compiler 'ede-g++-compiler
:linker 'ede-archive-linker
:configuration-variables 'nil
)
)
:configuration-variables 'nil
)
So,
i think I solved it. I'm answering the question myself, in case someone stumbles on the same difficulties.
Basically I needed to define a subproject in the directory "lib/" which compiles and archives the library.
I now have the following files
the config-file lib/Project.ede is the subproject responsible for the library and it looks like this:
The main file ./Project.ede looks like this: