diff --git a/src/Kconfig b/src/Kconfig
index ac9322ee9..0445685ef 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -18,6 +18,9 @@ source "src/simulator/Kconfig"
 config HAVE_GPIO_ADC
     bool
     default n
+config HAVE_GPIO_SPI
+    bool
+    default n
 
 config INLINE_STEPPER_HACK
     # Enables gcc to inline stepper_event() into the main timer irq handler
diff --git a/src/Makefile b/src/Makefile
index 5a640863e..5c7dc0850 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,4 +1,5 @@
 # Main code build rules
 
-src-y += sched.c command.c stepper.c basecmd.c gpiocmds.c spicmds.c endstop.c
+src-y += sched.c command.c stepper.c basecmd.c gpiocmds.c endstop.c
 src-$(CONFIG_HAVE_GPIO_ADC) += adccmds.c
+src-$(CONFIG_HAVE_GPIO_SPI) += spicmds.c
diff --git a/src/avr/Kconfig b/src/avr/Kconfig
index 9cfbec074..efc8484a3 100644
--- a/src/avr/Kconfig
+++ b/src/avr/Kconfig
@@ -6,6 +6,7 @@ config AVR_SELECT
     bool
     default y
     select HAVE_GPIO_ADC
+    select HAVE_GPIO_SPI
 
 config BOARD_DIRECTORY
     string