help-make
[Top][All Lists]
Advanced

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

Re: make more than one target


From: Philip Guenther
Subject: Re: make more than one target
Date: Sat, 6 Nov 2010 23:44:57 -0700

On 11/6/10, peter kotvan <address@hidden> wrote:
> i have to compile few simple programs for demonstrating socket
> communication. I can make them all with one makefile using wildcards
> but they share prerequisities and they would all be linked with same
> libraries. It is posibble to make more targets with different
> prerequisites and libraries for each of them? My makefile looks like
> this now:
...
> %.o: ${SRC_DIR}/%.c client.h server.h
>        ${CC} -o $@ -c $<

You're obviously a busy person, sending three copies of your request
to the list in a 10 minute period, so I'll keep this short.

1) you're using pattern rules, not wildcards
2) if you don't want them all to have the same prerequisites, then declare
   the prerequisities separately
3) if you want a variable to have different values for different targets, then
   perhaps you should read the info pages, particularly those sections that
   use the phrase "target-specific".
4) THIS IS ALL IN THE DOCS.  RTFM!


Philip Guenther



reply via email to

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