[Top][All Lists]

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

Re: Help required in gnumake

From: Paul D. Smith
Subject: Re: Help required in gnumake
Date: Thu, 7 Aug 2003 09:12:47 -0400

%% beginner beginner <address@hidden> writes:

  bb>       But as mentioned by you wtiting the same as 
  bb> ifneq ($(DEF_OBJDIR),$(OBJDIR_UNOPT))
  >>> ifneq ($(MCC_FLAGS),)
  >>>       @echo test
  >>>       DEF_CC_FLAGS=$(MCC_FLAGS) 
  >>> @echo Test1

  bb> i.e. putting tab in front of DEF_CC_FLAGS then we will not get any
  bb> error but I am getting a strange error.

  bb> Start building
  bb> Set the value
  bb> DEF_OBJDIR=..\obj
  bb> process_begin: CreateProcess((null), DEF_OBJDIR=..\obj, ...) failed.
  bb> make (e=2): The system cannot find the file specified.
  bb> gmake: *** [dhcpclnt.obj] Error 2

By putting a TAB in front of the DEF_OBJDIR=..\obj (btw, you should try
to use only forward-slashes in makefiles: this works with virtually
every Windows command as well), you have changed it from a line
interpreted by make (the setting of a make variable DEF_OBJDIR) to a
part of the command script, and thus a line passed to the shell.

If you were on a UNIX system, this would cause a shell variable
DEF_OBJDIR to be set and then the shell would exit, which would lose the
setting... so this is basically a no-op.  I'm not sure why Greg
suggested it since it's not really useful.

Anyway, you're running with a Windows shell which doesn't recognize that
syntax, so you get the above error.

In short there is _NO WAY_ to intersperse make variable settings in the
middle of a command script the way you were doing [1].  You will have to
move them all to before or after the target definition.

[1] In GNU make 3.80 you could use $(eval ...) but that's way overkill
    for a problem as trivial to solve using "normal" methods as this.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "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]