automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stupid problem: how to specify the directory for .h files?


From: Simon Richter
Subject: Re: Stupid problem: how to specify the directory for .h files?
Date: Sun, 16 Feb 2003 14:26:48 +0100
User-agent: Mutt/1.5.3i

Jean-Guillaume,

>     So, in the Makefile.am of the src dir, I put something like:

> INCLUDES = $(PROJECT_ROOT_DIR)/include -I$(XERCES_DIR)/include ....

I presume you're not pasting... There's a -I missing here. How about

INCLUDES = -I${top_srcdir}/include ${XERCESINCDIR} ...

top_srcdir is already predefined for you, so no need to substitute it
in. Also, you should make the complete -I specs in your configure file
-- this way you're free to make XERCESINCDIR empty if it is on the
search path anyway.

[...]

> dsiSecManager_LDFLAGS = $(LDFLAGS) -L$(DSI_ROOT_DIR)/bin
> -L$(XERCES_DIR)/lib

Is DSI_ROOT_DIR the build root of your project? If so, you should
probably not -L it, but rather use a path in LDADD.

> dsiSecManager_LDADD = $(SM_OBJS)  $(COS_OBJS) -lxerces-c -lPL -lc
> $(LIBS)

Don't include -lc yourself. Your compiler will do that for you, with the
added bonus that the compiler knows how libc is named on your system.
:-)

> #rule to compile the .o files

> %.o:  %.cpp %.h
>         $(CC) $(DEFINED) -c $(INCLUDES)  $< -o $@

Unneccesary. Automake generates this rule for you and also keeps track
of the .h files.

> Yes despite this, IF the .h files are not in the src dir, automake
> doesn't follow the rules I wrote for the .o files and doesn't compile
> with the $(DEFINED) flags, making it eventually crash.

What kind of flags do you need?

> I tried several things, for example

> dsiSecManager_SOURCES = file1.cpp .$(PROJECT_ROOT_DIR)/include/file1.h
> ..

Listing .h files as sources adds them to the distribution, but automake
knows that they cannot be compiled directly.

   Simon

-- 
GPG Fingerprint: 040E B5F7 84F1 4FBC CEAD  ADC6 18A0 CC8D 5706 A4B4

Attachment: pgp_OLgO4NNer.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]