help-make
[Top][All Lists]
Advanced

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

RE: variables-as-targets driving me insane


From: Luke Shumaker
Subject: RE: variables-as-targets driving me insane
Date: Fri, 01 Oct 2010 18:13:07 -0400

Don't do that.  Try this:

ifneq ($(filter avrlib avrtest,$(MAKECMDGOALS)),)
PLATFORM=avr
endif

ifneq ($(filter dylib,$(MAKECMDGOALS)),)
PLATFORM=osx
endif

### end ###

This does make the assumption that the only way to make the dylib,
avrlib, and avrtest targets is to specify them on the command line; that
no other targets depend on them.  This can easily be fixed by adding any
of these targets into the test.

~ LukeShu

On Fri, 2010-10-01 at 14:35 +1000, address@hidden wrote:
> I guess as with most things of this nature, "it's a feature, not a
> bug". I have worked around the problem by assigning the PLATFORM
> variable in the make invokation, ie:
> 
> # make PLATFORM=avr avrlib
> 
> It works fine now, and is a small price to pay as against the cost of
> reengineering my Makefile.
> 
> Thanks to all who responded,
> 
> Cheers,
> --
> Matt van de Werken
> Electronics Engineer
> Mining Geoscience, CSIRO Earth Science and Resource Engineering
> 1 Technology Ct   Pullenvale   QLD   4069
> P: 07 3327 4142  F: 07 3327 4455  M: 0400 538 608
> E: address@hidden
> "Those that do not understand UNIX are condemned to reinvent it, poorly"
>   - Henry Spencer





reply via email to

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