help-gnu-utils
[Top][All Lists]
Advanced

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

Re: simple makefile but getting nothing to be done


From: Paul D. Smith
Subject: Re: simple makefile but getting nothing to be done
Date: 04 Mar 2005 00:33:24 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

%% atapi103@gmail.com writes:

  a> Im realy new to Makefiles and am trying to make one after reading
  a> several tutorials on the topic.

Perhaps not closely enough, though :-).

  a> $AR = ar

You do not use the "$" when you set variables in make; they are only
used when you write a reference to them.

A "$" followed by a non-paren (normal or curly) provides an evaluation
of that single character as a variable.  So, the above is actually
not setting the variable "AR" to the value "ar", it's setting the
variable named as the result of evaluating the variable "$A", which is
empty, plus "R", or just the variable named "R", to the value "ar".

  a> $CPP = g++
  a> $CFLAGS = -c

Similarly for these; since the variable C has no value, so $C expands to
the empty string, you're setting the variable "PP" to "g++" and the
variable "FLAGS" to "-c"

  a> $CXXINCS = -I"$(MINGW)/include"
  a> -I"$(MINGW)/lib/gcc/mingw32/$(GCC_VERSION)/include"
  a> -I"$(MINGW)/include/c++/$(GCC_VERSION)"
  a> -I"$(MINGW)/include/c++/$(GCC_VERSION)/mingw32"
  a> -I"$(MINGW)/include/c++/$(GCC_VERSION)/backward"

Are you sure you're not missing some backslashes that do appear in your
makefile, because this as written is a syntax error and you'd get an
error message from make if it was in your makefile.

  a> $BIN = LibKomodia.a
  a> $OBJS = obj/KomodiaTCPIPLib/AsyncSocket.o

Here you're setting the variable "IN" to "LibKomodia.a" and the variable
"BJS" to "obj/KomodiaTCPIPLib/AsyncSocket.o"

  a> all: $(BIN)

So here when make expands the variable "BIN", which you never set, it
goes to the empty string and sure enough, "all" doesn't depend on
anything and make says there's nothing to do.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@gnu.org>          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]