[Top][All Lists]

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

Re: make: config file for library linking

From: Henrik Carlqvist
Subject: Re: make: config file for library linking
Date: Sun, 02 Mar 2008 22:11:52 +0100
User-agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)

Martin Vcelak <> wrote:
> Now I would like to add the possibility that for each .cpp file is a 
> special config file in the same directory as the .cpp file what 
> determines what libraries should be linked to the executable.
> Do you have any idea or experiences?

This sounds a bit like the dependency files that are possibly to create
with the -MM flag for gcc, those files contain makefile rules to keep
track of dependencies of .h files. Usually make does includ on such files.

One way to solve your problem would be to include your config files in
Makefile, something like this:

include $(wildcard *.conf)

And each .conf file would have a line looking something like this:

LDFLAGS += -lm -lX11

regards Henrik
The address in the header is only to prevent spam. My real address is:
hc3(at) Examples of addresses which go to spammers:
root@localhost postmaster@localhost

reply via email to

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