diff --git a/libavformat/Makefile b/libavformat/Makefile
index 2e5fa97937abee7485946dd26f2e2ba263517cfb..fc289a3b31d8b29b2588dcb5d25424dcd99085fc 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -164,10 +164,10 @@ OBJS+= avio.o aviobuf.o
 
 ifeq ($(CONFIG_PROTOCOLS),yes)
 OBJS+= file.o
+endif
 ifeq ($(CONFIG_NETWORK),yes)
 OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o mpegts.o rtp_h264.o
 endif
-endif
 
 NAME=avformat
 LIBVERSION=$(LAVFVERSION)