Re: Smart CONFIG_* Dependencies

Martin von Loewis (
Sat, 22 Nov 1997 12:50:08 +0100

> Try it out and do let me know what you think.

I like this smart configuration package very much, and I think you
are right on track with it.

Unfortunately, it currently cannot build all modules. I found that
the Hisax ISDN driver and the VFAT filesystem driver won't build
as modules. This is because both drivers define an O_TARGET, and
then define the M_OBJS to include the O_TARGET. Since the O_TARGET
is obtained by linking together the O_OBJS, there is no way defined
to build mod-O_TARGET.

So I want to bring up the flag-dependant recompilation again. My
proposal is to use gmake tricks.

First, produce the string that indicates whether recompilation is


Whenever recompiling, also produce a Makefile include:
a.o: a.c
$(CC) -c $(CFLAGS) a.c
@echo 'ifneq ($(RECOMPILE_CFLAGS),$$(RECOMPILE_CFLAGS))' > $@.flags
@echo ".PHONY: $@" >>$@.flags
@echo endif >>$@.flags

This will produce a file a.o.flags with the contents
.PHONY: a.o

In the Rules.make, include all those files

ifneq ($(wildcard *.flags),)
include $(wildcard *.flags)

What do you think?