Please consider this short makefile:

#--------------------------------------------------

obj = $(wildcard *.o)
define fubar
$(1).out : $$(obj)
        @echo Linking $$@
endef

$(foreach case,a b c d,$(eval $(call fubar,$(case))))

#--------------------------------------------------

When there are only a few .o files everything runs fine. However if the number of .o files is above certain limit then weird things happen. For instance try

$ touch {0,1,2,3}{0,1,2,3,4,5,6,7,8,9}.o
$ make a.out

(you may need to generate more .o files depending on your system).

I tried this with GNU Make 3.80, on Cywgin (cygwin.dll 1.5.18-1) and the error was:

make: *** virtual memory exhausted.  Stop.

Also on another Linux system (2.4.21-sgi230rp03111013_10029)  the error was:

make:7: *** multiple target patterns.  Stop.

For some other make file with similar constructs I got (on the Linux system)

Makefile:82: *** target pattern contains no `%'.  Stop.


Why is this happening?

thanks

- sly






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

Reply via email to