On Wednesday 24 May 2006 23:32, you wrote: > On Wednesday, 24 בMay 2006 16:30, Ami Chayun wrote: > > I added to my src/Makefile.am the following line: > > > > include_HEADERS = api.h > > ... > > Project structure is (assuming the project is under dir named > > my_project): > > > > headers - my_project/include > > sources - my_project/src > > Wrong directory. The Makefile.am is in src/ and the header > is in include/ > > Several options: > - You may try to put $(src)/../include/api.h, instead of api.h > but even if this work (didn't test it), it's a bad idea because > it breaks many assumption about directory recursion, dependency > checking etc. > - Restructure you code so the headers are in src/ as well (if > it's only a few headers and only one is installed, than why > bother separating them?) > - Or, simply put a single line Makefile.am in include/ as well. > > Generally, a "deep" project (composed of a directory tree) is done > by: > - Having a toplevel Makefile.am: > SUBDIRS = include src > - Each of the mentioned subdirectories, have its own Makefile.am > include/Makefile.am > src/Makefile.am > - If any subdirectory contains further branches, it can be continued > recursively. E.g: if in src/ you have a lib/ subdirectory, then > put inside src/Makefile.am: > SUBDIRS = lib > # all other local targets: > bin_PROGRAMS = .... > and add an src/lib/Makefile.am as well > - The top level configure.ac should declare *all* Makefiles in > all levels in its output macro, since generally, it's a bad idea > to nest configure scripts. > > Bye,
Oron, Thanks for the answer. It was indeed the mistake. The situation is a bit more complicated though. My api.h is generated from api.h.in I decided to go for the following solution (in the top level Makefile.am): pkginclude_HEADERS = include/something.h include/api.h This is in order to avoid include/Makefile.am In the beginning of my configure.ac I have: AM_CONFIG_HEADER(include/api.h) which I use to create the .h file from the .h.in When I run ./configure && make I get errors in the spirit of: autoheader2.50: warning: missing template: SOCK_PATH autoheader2.50: Use AC_DEFINE([SOCK_PATH], [], [Description]) If I remove include/api.h from the Makefile.am, everything works like a charm. How can I overcome this and still install my precious header file? :-) Thanks again, Ami ================================================================To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
