diff --git a/Makefile b/Makefile
index d5a9d376e0f279a1d9cbebffd7f9e3402e0272e1..b2a34a16257ef8ef77b3678180b6b3b9aabc8eb1 100644
--- a/Makefile
+++ b/Makefile
@@ -147,7 +147,7 @@ ifeq ($(BUILD_VHOOK),yes)
 endif
 
 .depend: $(SRCS)
-	$(CC) -MM $(CFLAGS) $^ 1>.depend
+	$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
 
 .libs: lib
 	@test -f .libs || touch .libs
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 40f189bd04580538b9135c5cd790063711f2b2b7..03d90fe767479e5a003f7746cfbb2a4f6a9e392f 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -119,6 +119,7 @@ OBJS += i386/fdct_mmx.o i386/cputest.o \
 	i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o
 ifdef TARGET_BUILTIN_VECTOR
 i386/fft_sse.o: CFLAGS+= -msse
+depend: CFLAGS+= -msse
 endif
 endif