Perhaps you've got SUBDIRS defined in your environment?
The following example seems to match the behavior you're reporting:
$ cat test1/Makefile
SUBDIRS = foo bar
all:
make -C test2 all
$ cat test1/test2/Makefile
all:
echo "SUBDIRS = $(SUBDIRS)"
$ make -C test1 all
make: Entering directory `/home/tgl/test1'
make -C test2 all
make[1]: Entering directory `/home/tgl/test1/test2'
echo "SUBDIRS = "
SUBDIRS =
make[1]: Leaving directory `/home/tgl/test1/test2'
make: Leaving directory `/home/tgl/test1'
$ SUBDIRS=env make -C test1 all
make: Entering directory `/home/tgl/test1'
make -C test2 all
make[1]: Entering directory `/home/tgl/test1/test2'
echo "SUBDIRS = foo bar"
SUBDIRS = foo bar
make[1]: Leaving directory `/home/tgl/test1/test2'
make: Leaving directory `/home/tgl/test1'
I find this behavior a tad surprising: if the environment variable is
effective at all, it seems like it shouldn't be overridden by a simple
assignment in the parent makefile. But I dunno if the gmake boys would
think it's a bug.
regards, tom lane