diff --git a/Makefile.am b/Makefile.am
index 50ff1eb4dc19df184f1dcd2439eef7a29a86c390..452f6d228397d262e637269315fb358142737128 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -97,6 +97,14 @@ include lpcnet_headers.mk
 include silk_headers.mk
 include opus_headers.mk
 
+LPCNET_HEAD =
+if ENABLE_DEEP_PLC
+LPCNET_HEAD += $(DEEP_PLC_HEAD)
+endif
+if ENABLE_DRED
+LPCNET_HEAD += $(DRED_HEAD)
+endif
+
 libopus_la_SOURCES = $(CELT_SOURCES) $(SILK_SOURCES) $(LPCNET_SOURCES) $(OPUS_SOURCES)
 libopus_la_LDFLAGS = -no-undefined -version-info @OPUS_LT_CURRENT@:@OPUS_LT_REVISION@:@OPUS_LT_AGE@
 libopus_la_LIBADD = $(NE10_LIBS) $(LIBM)
diff --git a/celt/celt_decoder.c b/celt/celt_decoder.c
index 7508a245c453f99116b19e21457a852539c62ac7..dd727976681049225d2040c848d1aa43990e6ab5 100644
--- a/celt/celt_decoder.c
+++ b/celt/celt_decoder.c
@@ -50,8 +50,11 @@
 #include <stdarg.h>
 #include "celt_lpc.h"
 #include "vq.h"
+
+#ifdef ENABLE_DEEP_PLC
 #include "lpcnet.h"
 #include "lpcnet_private.h"
+#endif
 
 /* The maximum pitch lag to allow in the pitch-based PLC. It's possible to save
    CPU time in the PLC pitch search by making this smaller than MAX_PERIOD. The
diff --git a/lpcnet_headers.mk b/lpcnet_headers.mk
index f09adf16f46908cf899aef48bc6ae7eefb67b9da..c4c8f7d45ebd4f897f1f016193aa71b8e6b8b725 100644
--- a/lpcnet_headers.mk
+++ b/lpcnet_headers.mk
@@ -1,9 +1,4 @@
-LPCNET_HEAD = \
-silk/dred_coding.h \
-silk/dred_config.h \
-silk/dred_decoder.h \
-silk/dred_encoder.h \
-dnn/dred_rdovae.h \
+DEEP_PLC_HEAD = \
 dnn/lpcnet.h \
 dnn/burg.h \
 dnn/common.h \
@@ -17,11 +12,18 @@ dnn/tansig_table.h \
 dnn/vec.h \
 dnn/vec_avx.h \
 dnn/vec_neon.h \
+dnn/pitchdnn.h \
+dnn/pitchdnn_data.h
+
+DRED_HEAD = \
+silk/dred_coding.h \
+silk/dred_config.h \
+silk/dred_decoder.h \
+silk/dred_encoder.h \
+dnn/dred_rdovae.h \
 dnn/dred_rdovae_constants.h \
 dnn/dred_rdovae_enc.h \
 dnn/dred_rdovae_enc_data.h \
 dnn/dred_rdovae_dec.h \
 dnn/dred_rdovae_dec_data.h \
-dnn/dred_rdovae_stats_data.h \
-dnn/pitchdnn.h \
-dnn/pitchdnn_data.h
+dnn/dred_rdovae_stats_data.h
diff --git a/lpcnet_sources.mk b/lpcnet_sources.mk
index b8313f305bdf325d51f39e0bcbeec3172cfb0f06..051d3c44e38adf653cc332a3609b5c86c13b5cae 100644
--- a/lpcnet_sources.mk
+++ b/lpcnet_sources.mk
@@ -11,6 +11,7 @@ dnn/plc_data.c \
 dnn/parse_lpcnet_weights.c \
 dnn/pitchdnn.c \
 dnn/pitchdnn_data.c
+
 DRED_SOURCES = \
 dnn/dred_rdovae.c \
 dnn/dred_rdovae_enc.c \
diff --git a/silk/API.h b/silk/API.h
index 82ae681198334eac74acfb0d114a31621ab39ba9..6e623b844b876697110a21fc57bffd1a152e632c 100644
--- a/silk/API.h
+++ b/silk/API.h
@@ -33,7 +33,10 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "errors.h"
 #include "entenc.h"
 #include "entdec.h"
+
+#ifdef ENABLE_DEEP_PLC
 #include "lpcnet_private.h"
+#endif
 
 #ifdef __cplusplus
 extern "C"
diff --git a/src/opus_decoder.c b/src/opus_decoder.c
index 1f098e82c475c039436575f4ade819ec67af174a..0a500398c5c49348420f8c3757f3131ae79ac02c 100644
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -51,7 +51,10 @@
 #include "define.h"
 #include "mathops.h"
 #include "cpu_support.h"
+
+#ifdef ENABLE_DEEP_PLC
 #include "dred_rdovae_dec_data.h"
+#endif
 
 struct OpusDecoder {
    int          celt_dec_offset;
@@ -1125,7 +1128,9 @@ int opus_decoder_get_nb_samples(const OpusDecoder *dec,
 }
 
 struct OpusDREDDecoder {
+#ifdef ENABLE_DRED
    RDOVAEDec model;
+#endif
    int arch;
    opus_uint32 magic;
 };