Ah, shit.
kaos> The kernel makefile system assumes that everything is either kernel or
kaos> module, not both. The components in drmlib.a get compiled for kernel
kaos> only, when used in a module they are missing the symbol versions.
I agree with Keith.
The kernel version is going to get compiled, and then the module version is
going to get compiled with different compilation flags: -DMODULE. The two
versions are always going to fight.
kaos> +$(patsubst %.o,%.c,$(lib-objs-mod)):
kaos> + @ln -sf $(subst -mod,,$@) $@
kaos> +
This looks good to me. It's missing a dependency though. If foo-mod.c
exists, and someone edits or patches foo.c, then foo-mod.c needs to be
re-created.
Keith, what do you think of this:
source-objs-mod := $(patsubst %-mod.o,%-mod.c,$(lib-objs-mod))
$(source-objs-mod): $(patsubst %-mod.c,%.c,$(source-objs-mod))
ln -sf $(patsubst %-mod.c,%.c,$@) $@
It suffers from the thundering herd problem (each *-mod.c depend on
all *.c files) but I think it's correct.
Michael
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/