help-make
[Top][All Lists]
Advanced

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

Re: Make target issue


From: Paul D. Smith
Subject: Re: Make target issue
Date: Tue, 28 Jun 2005 14:54:39 -0400

%% "Highley, David M" <address@hidden> writes:

  hdm> Using GNU make 3.80 in the Cygwin environment we are seeing an
  hdm> interesting inconsistent behavior. If we use this construct:

  hdm> $(TARGET_LIST)::
  hdm>  rules

  hdm> It seems to work for libraries, but not executable builds. When we try
  hdm> this for the executables it builds the first one in the list and does a
  hdm> normal exit. So we tried this in an effort to change work around the
  hdm> issue.

  hdm> all: $(LIB_LIST) $(APP_LIST)

  hdm> Then we created an individual target for each library and each
  hdm> application. Seems like bad form since they are all duplicates of each
  hdm> other:
  hdm> lib or app::
  hdm>  $(SET_E); cd $@ && PATH=$(PATH) "$(MAKE)"

  hdm> What we see from this experiment is the all the libraries build and then
  hdm> the make stops. Currently testing a mixture of a shell loop in a target
  hdm> to build all the libraries and individual build targets for the
  hdm> libraries which tested individually has worked. By the way we are using
  hdm> the cl.exe compiler and the link.exe linker, from Studio 7.1.

  hdm> all: libs $(APP_LIST)

  hdm> libs:
  hdm>  $(SET_E); \
  hdm>  for dir in $(DIRS); \
  hdm>  do
  hdm>          (cd $$dir && PATH=$(PATH) "$(MAKE)"); \
  hdm>  done

Sorry, but I'm not quite sure what you mean here.  The examples you give
don't seem like exactly what you're doing and I can't tell which ones
are working correctly and which ones are failing.

There's no way make knows the difference between a library and an
executable.  A target is a target as far as make is concerned.  So,
there must be more to it than that.


I just tried a simple makefile based on your comments above:

    all: foo bar on you

    foo bar on you:: ; @echo $@

And I got the expected results:

    foo
    bar
    on
    you

(note "::" is not really necessary here).

Of course, if you remove the "all" rule then make only builds the FIRST
target it sees, which is "foo" in my example, so you'd just get that one
line printed.  Maybe this is what you're seeing?


If not, please provide a small, precise, complete example using simple
things like "echo", etc. to emulate the build process, rather than
specialized tools like cl.exe which exist only on some platforms.

Thanks!

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