help-make
[Top][All Lists]
Advanced

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

Re: @echo name1 = $(name1) does not work


From: Paul D. Smith
Subject: Re: @echo name1 = $(name1) does not work
Date: Sun, 29 Jan 2006 00:03:14 -0500

%% Morten Gulbrandsen <address@hidden> writes:

  mg> make
  mg> cc -c -o helloworld.o helloworld.c
  mg> cc    -o helloworld helloworld.o

  mg> according to the manual
  mg> http://www.gnu.org/software/make/manual/html_chapter/make_3.html#SEC13
  mg> then you would expect to see this output:

  mg> name1 = Makefile
  mg> name2 = inc.mk

Why would you expect to see that?

Make always runs the first defined target; in this case you include
inc.mk, which defines the target "helloworld" first, before you define
the "all" target.

So, when you run make, it builds helloworld.

If you want it to build "all", then either run "make all" or define that
target first before including inc.mk.

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