help-make
[Top][All Lists]
Advanced

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

RE: Tricky suffix rule problem for Corba


From: Paul D. Smith
Subject: RE: Tricky suffix rule problem for Corba
Date: Wed, 15 Feb 2006 13:30:54 -0500

%% "CARTER-HITCHIN, David, FM" <address@hidden> writes:

  cdf> my fix is:

  cdf> IDL_HEADERS_TMP = $(subst .idl,.h,$(IDL_FILES))
  cdf> IDL_HEADERS = $(subst ../idl/,,$(IDL_HEADERS_TMP))

You really want to avoid subst, unless you absolutely need the specific
things it does.  It's far too unfocused a tool, and can cause lots of
confusion and hair-pulling down the road.

For example, consider if you had an entry in IDL_FILES like "my.idl.idl"
and what using subst would give you.  Almost always what you want is
$(patsubst ...) instead.

In this case you could use:

    IDL_HEADERS = $(patsubst %.idl,%.h,$(notdir $(IDL_FILES)))

There are other ways of course.

Also, you might consider using := here instead of = (if you can).  That
will potentially make your build faster as make can evaluate that value
just once instead of over and over.

  cdf> Other lists have overcome this problem (for RBS are not alone in
  cdf> this crime) by looking for "--LongSig" and strip off everything
  cdf> after that.  It would be easier for the maintainers of this list
  cdf> (or this list's software) to adopt this practice.

As long as you use a .sig introduction line in your email ("-- ") it's
fine.  If people are upset by long sigs, they can use a mail client that
hides them.

Cheers!

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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