Hi,
Can anybody tell me the difference between makefile,makefile.am and makefile.in.
What is the hierarchy of these file..ie which file is created first and after that which one..??
Thanks
Hi,
Can anybody tell me the difference between makefile,makefile.am and makefile.in.
What is the hierarchy of these file..ie which file is created first and after that which one..??
Thanks
Yes, there is a hierarchy. Makefile.am is a "automake" makefile. Makefile.in is a "template" makefile, and Makefile is a file created from the former two, usually usign "./configure".
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Hi matsp,
Thanks for your reply.........
I am working on a linux project and I want a little explanation regarding makefile concept.
As you write that makefile is created from makefile.am and makefile.in by running ./configure....
I have a question regarding this..........
In my project I have several directories for same project so individual folder has there own makefile.am and so on........
When I tried to include A .h file from one folder say A to another B.h file say in B folder I got the complier error that A.h does not exist.......so for this I include the folder path of directory A to the makefile.am file of folder B.....then again it give me the same error.........
Then I apply a trick......what I do is that ...I don't include the header file A.h in B.h but include the directory path in makefile.am of directory B....then I run "make install" command............
It make changes in makefile.in and makefile...........
After this I include the A.h header file to B.h and at this time It doesn't give any error...........
Why this happen ???
As you have said that makefile.in and makefile is created from ./configure command then why these file created from "make install " command ???
I should run ./configure to create makefile and then run "make install" ??
Actually I am new to linux programming and need help to understand project functionality........
It will be great if anybody explain with flow...........waiting for reply
Thanks
So are you modifying the actual project, or just trying to build it?
Normally, you do something likeand all works just fine.Code:$ ./configure $ make install
However, different projects may work differently, and there's certainly nothing to say that a particular project will not have bugs that are exposed when you try to build on a certain machine. Some projects also deal badly with missing required files - e.g. to build X, you need to install Y first. If Y isn't installed, it doesn't recognise this, but rather tries to compile and finds lots of header files and/or libraries missing during the build process.
Note that "Automake" files are non-trivial to deal with in my experience. I can fix simple automake bugs, but I've also run into problems where I can't understand the makefile.am well enough to make it work [I usually manage quite well with regular makefiles, but even these CAN be hard to follow].
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Thanks for reply ............
Actually I am adding some functionality to the existing project..............
I am explaining u what I have understood yet...........plz let me know if I am correct.........
makefile.am was created earlier.When I run command autoreconf -i (not ./configure) then it create the makefile.in and makefile .............
When I run command "make install" it call makefile and create it's exe...
I want to know that if I want to make changes then should I make changes in makefile.am or in makefile ??????
Thanks
Yes, as far as I know, that would be the way to do it.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
If you're the only one who's going to be using the modified program, then it really doesn't matter -- although the Makefile might be pretty long and difficult to follow.I want to know that if I want to make changes then should I make changes in makefile.am or in makefile ??????
If you're going to give the modified version to other people, then don't modify the Makefile, because as soon as someone runs ./configure again, the Makefile will be overwritten.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
You shouldn't modify auto-generated files out of basic principle. Always modify the source.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law