help-make
[Top][All Lists]
Advanced

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

Re: removing spaces from concatenated variables


From: Paul D. Smith
Subject: Re: removing spaces from concatenated variables
Date: Fri, 28 Mar 2003 12:38:12 -0500

%% Dan DeJohn <address@hidden> writes:

  dd> I need to construct a UNIX path from some variables and I don't
  dd> know how to get rid of the space that make puts between the
  dd> variables when concatenating them. I need a $(strip) function that
  dd> will remove the internal spaces as well as the leading and
  dd> trailing ones.

  dd> FOO := foo
  dd> BAR := bar

  dd> PATH := $(FOO):$(BAR)

Make doesn't put any space between variables when concatenating them.

If you are seeing spaces above that must mean that you have whitespace
at the end of the variable setting line for FOO.  Any trailing
whitespace on a variable definition is considered part of the value.

Either get an editor that will allow you to strip trailing whitespace
(Emacs can do this), or start using the $(strip ...) function
religiously.

-- 
-------------------------------------------------------------------------------
 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]