Make target issue

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Make target issue

Highley, David M
Using GNU make 3.80 in the Cygwin environment we are seeing an
interesting inconsistent behavior. If we use this construct:

$(TARGET_LIST)::
        rules

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

all: $(LIB_LIST) $(APP_LIST)

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

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

all: libs $(APP_LIST)

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

Our goal is to flatten the make process to expose more opportunities for
doing parallel work.

David Highley


_______________________________________________
Help-make mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-make
Reply | Threaded
Open this post in threaded view
|

FW: Make target issue

Highley, David M


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

$(TARGET_LIST)::
        rules

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

all: $(LIB_LIST) $(APP_LIST)

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

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

all: libs $(APP_LIST)

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

Our goal is to flatten the make process to expose more opportunities for
doing parallel work.

David Highley


_______________________________________________
Help-make mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-make
Reply | Threaded
Open this post in threaded view
|

Re: Make target issue

Paul Smith-20
In reply to this post by Highley, David M
%% "Highley, David M" <[hidden email]> 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 <[hidden email]>          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


_______________________________________________
Help-make mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-make