John Poltorak <[EMAIL PROTECTED]> writes: > On Sat, Apr 24, 2004 at 04:06:50PM -0500, Stephen Torri wrote: >> On Sat, 2004-04-24 at 15:21, John Poltorak wrote: >> > I've never written a Makefile.am file but would like to have a try... >> > >> > GNU ed seems like a relatively simple app, so I'd be interested in writing >> > one for it. Can anyone suggest where I start? >> >> Create a simple app that prints out a string. See your favorite hello >> world code. Use automake and autoconf to build the program by creating a >> simple Makefile.am and a configure.in. > > I tried that once but it isn't very instructive when using libraries. > > I'm trying to retro-fit a Makefile.am into GNU ed for my own purposes but > am unsure about how to handle libs... > > If I have seperate headers for a bin and a lib program should they all be > included under noinst_HEADERS as in:- ? > > > bin_SOURCES = bin_a.c bin_bf.c > noinst_HEADERS = bin_a.h bin_b.h
The headers in _SOURCES won't be installed. If they belong to the program, that's the place to put them. > noinst_LIBRARIES = liblib.a > > > or should noiinst_HEADERS be split between the bin and the lib? Assuming you have a binary and a library, I'd do this: bin_PROGRAMS = prog prog_SOURCES = \ foo.c \ foo.h \ bar.c \ bar.h prog_LDADD = proglib.a noinst_LIBRARIES = proglib.a proglib_a_SOURCES = \ liba.c \ liba.h \ libb.c \ libb.h If you're only using static libs, libtool isn't really required. There's no need to noinst_HEADERS at all (I only use it when there's a directory only containing headers i.e. they don't "belong" to any built object). It would be more helpful if you posted *exactly* what your requirements are. HTH, Roger -- Roger Leigh Printing on GNU/Linux? http://gimp-print.sourceforge.net/ GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.