help-make
[Top][All Lists]
Advanced

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

eval/call generated rules cause strange errors


From: Levent Yilmaz
Subject: eval/call generated rules cause strange errors
Date: Wed, 30 Nov 2005 17:41:03 -0500
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

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








reply via email to

[Prev in Thread] Current Thread [Next in Thread]