From: Ben Hutchings Date: Mon, 19 Nov 2012 04:51:39 +0000 Subject: Select wlc_hybrid.o based on the target kernel architecture Origin: http://bugs.debian.org/651787 --- amd64/Makefile | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/amd64/Makefile b/amd64/Makefile index a323a0d..994a146 100644 --- a/amd64/Makefile +++ b/amd64/Makefile @@ -145,9 +145,27 @@ ifeq "$(GE_49)" "1" EXTRA_CFLAGS += -Wno-date-time endif -EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped +# Look for kernel architecture. +# Check for a config symbol that should always be defined, so we don't +# fail on 'make clean' which doesn't include .config +ifeq ($(CONFIG_NET),y) + ifeq ($(CONFIG_X86_32),y) + SHIPPED=wlc_hybrid.o_i386 + $(info Kernel architecture is X86_32) + else + ifeq ($(CONFIG_X86_64),y) + SHIPPED=wlc_hybrid.o_amd64 + $(info Kernel architecture is X86_64) + else # Error! + $(error Unsupported kernel architecture) + endif + endif +endif + +EXTRA_LDFLAGS := $(src)/lib/$(SHIPPED) -KBASE ?= /lib/modules/`uname -r` +KVER ?= $(shell uname -r) +KBASE ?= /lib/modules/$(KVER) KBUILD_DIR ?= $(KBASE)/build MDEST_DIR ?= $(KBASE)/kernel/drivers/net/wireless