[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to properly define a make file that builds two distinct objects
From: |
Robert P. J. Day |
Subject: |
Re: how to properly define a make file that builds two distinct objects |
Date: |
Mon, 19 May 2008 10:21:19 -0400 (EDT) |
User-agent: |
Alpine 1.10 (LFD 962 2008-03-14) |
On Mon, 19 May 2008, Paul Smith wrote:
> The best practice I've seen used everywhere (and what I use
> personally) is to conditionalize all the variables with the target
> names. So, you can do something like:
>
> TARGETLIB = fubar.so barfoo.so
>
> fobar.so_SRCS = src1.c src2.c
>
> barfoo.so_SRCS = src3.cpp src4.c
>
> etc. Now in your rules to build things, conditionalize all the
> variables with $@ like this:
>
> $(CC) ... $(address@hidden)
>
> anyway, you get the idea. Sometimes it's better to use $* instead;
> it really depends on what you're doing.
ah, yes, this will work nicely, thanks.
rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.
http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================