bug-make
[Top][All Lists]
Advanced

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

problems with $(eval include...)


From: Fabio Alemagna
Subject: problems with $(eval include...)
Date: Thu, 26 Jun 2003 20:49:02 +0200 (CEST)

My goal is to have make include .d files only when they are actually
needed, so that when make starts, it doesn't have to check whether any .c
files (from which all the .d ones are generated) have changed, so I've
come up with this solution:

----
OBJS := ...
DEPS := ...

program: program-deps $(OBJS)

program-deps:
        $(eval include $(DEPS))
----

The above is not exactly what I'm using, but gives the general idea:
basically, before the .o prerequisites are evaluated, the program-deps one
is, and the command part of the program-deps target just includes the .d
files. Dunno if this usage of $(eval) was foreseen, but it works.

Well, almost. The problem is that if the included file doesn't exist, make
doesn't try to regenerate it, which shows that something nasty is going
on, specially because if I try to include "too many" files, make
segfaults, and gdb shows this:

#0  0x0805e7a3 in update_file_1 (file=0x808fdb0, depth=5) at remake.c:435
435           check_renamed (d->file);
(gdb) bt
#0  0x0805e7a3 in update_file_1 (file=0x808fdb0, depth=5) at remake.c:435
#1  0x0805e1bc in update_file (file=0x808fdb0, depth=4) at remake.c:306
#2  0x0805f81f in check_dep (file=0x808fdb0, depth=4, this_mtime=1,
    must_make_ptr=0xbfffdab8) at remake.c:848
#3  0x0805e8d7 in update_file_1 (file=0x808dc08, depth=3) at remake.c:457
#4  0x0805e1bc in update_file (file=0x808dc08, depth=2) at remake.c:306
#5  0x0805f81f in check_dep (file=0x808dc08, depth=2, this_mtime=1,
    must_make_ptr=0xbfffdc18) at remake.c:848
#6  0x0805e8d7 in update_file_1 (file=0x8087f60, depth=1) at remake.c:457
#7  0x0805e1bc in update_file (file=0x8087f60, depth=0) at remake.c:306
#8  0x0805dda9 in update_goal_chain (goals=0x8094e00, makefiles=0)
    at remake.c:155
#9  0x08056f2c in main (argc=4, argv=0xbffff604, envp=0xbffff618) at
main.c:1975
#10 0x4009a7f7 in __libc_start_main () from /lib/i686/libc.so.6

Any ideas?

Fabio Alemagna





reply via email to

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