Re: Documentation for the eval function

2013-05-23 Thread Sascha Ziemann

 If your version is 3.80 or newer, please cut/paste (exactly) your
 makefile so we can see it.


I took the example from the documentation:

http://www.gnu.org/software/make/manual/html_node/Eval-Function.html#Eval-Function

$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-redhat-linux-gnu
$ cat Makefile
PROGRAMS= server client

server_OBJS = server.o server_priv.o server_access.o
server_LIBS = priv protocol

client_OBJS = client.o client_api.o client_mem.o
client_LIBS = protocol

# Everything after this is generic

.PHONY: all
all: $(PROGRAMS)

define PROGRAM_template =
 $(1): $$($(1)_OBJS) $$($(1)_LIBS:%=-l%)
 ALL_OBJS   += $$($(1)_OBJS)
endef

$(foreach prog,$(PROGRAMS),$(eval $(call PROGRAM_template,$(prog

$(PROGRAMS):
$(LINK.o) $^ $(LDLIBS) -o $@

clean:
rm -f $(ALL_OBJS) $(PROGRAMS)
$ make clean
rm -f  server client

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Documentation for the eval function

2013-05-22 Thread Sascha Ziemann
Hi,

I think the example in the documentation for the eval function is
broken. I copied the example to a file and tried it with make clean.
The action for the clean target is rm -f $(ALL_OBJS) $(PROGRAMS).
The PROGRAMS variable is set at the beginning to server client and
the ALL_OBJS variable should be filled by the foreach call of the eval
function. Because of that I think that the intended action for the
clean target is rm -f server.o server_priv.o server_access.o client.o
client_api.o client_mem.o server client. But when I try the example I
get the following output:

make clean
rm -f  server client

So I think the example must be wrong, isn't it?

Regards
Sascha

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make