Message ID | CACqU3MVh7JYsO94UEcxOp+jx2PCO_J3o+5MyU-ivx1utP9aDnw@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/Makefile b/Makefile index b927e75..a15b773 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,11 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ # Default value for CROSS_COMPILE is not to prefix executables # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile export KBUILD_BUILDHOST := $(SUBARCH) +ifeq ($(shell test -e .config && echo n),n) ARCH ?= $(SUBARCH) +else +ARCH ?= $(shell sed '/^\# Linux\/\(.*\) .* Kernel Configuration/!d; s//\1/' .config) +endif CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)