Idarhillgaar
asked on
How to create a Makefile that sorts out lots of dependencies
Hi everybody,
My problem is that I can't compile the test class because the header it uses also uses several headers that again uses their headers etc.
the Library I'm working on is called ghmm (www.ghmm.org) the main directory for ghmm where the configuration etc is, is /ghmm/
Where the headers and their sources are locted is at /ghmm/ghmm/
The Test files are located, this is also where my files are stored /ghmm/tests/
Cheers
Idar
My problem is that I can't compile the test class because the header it uses also uses several headers that again uses their headers etc.
the Library I'm working on is called ghmm (www.ghmm.org) the main directory for ghmm where the configuration etc is, is /ghmm/
Where the headers and their sources are locted is at /ghmm/ghmm/
The Test files are located, this is also where my files are stored /ghmm/tests/
Cheers
Idar
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi guys, I solved it here, my problem was that the link did now know where to look
Solved:
test.c
gcc -o output.run test.o -lstdc++ ../ghmm/.libs/libghmm.a -lm -lpthread
test.o: test.c
gcc -c test.o output.run -I.. (the class must then help the make file find the library by ie #include <ghmm/sequences.h>
clean:
rm test.o output.run
thanks though, Manish you were closest to my final solution - thanks
Solved:
test.c
gcc -o output.run test.o -lstdc++ ../ghmm/.libs/libghmm.a -lm -lpthread
test.o: test.c
gcc -c test.o output.run -I.. (the class must then help the make file find the library by ie #include <ghmm/sequences.h>
clean:
rm test.o output.run
thanks though, Manish you were closest to my final solution - thanks
> .. you were closest to my final solution ..
.. which (suggestion and solution) has nothing to do with the initial question :-/
.. which (suggestion and solution) has nothing to do with the initial question :-/
ASKER
just simpler thats all - implemented before I saw your solution though
gcc -MM list of your C-files >>Makefile