diff --git a/common.mak b/common.mak
index c4054303087039d77819415c1cd6cc8a5c448e95..66297ef5a1cfb730616939db524593e0cadfd2da 100644
--- a/common.mak
+++ b/common.mak
@@ -36,6 +36,7 @@ OBJS     += $(OBJS-yes)
 ASM_OBJS += $(ASM_OBJS-yes)
 CPP_OBJS += $(CPP_OBJS-yes)
 FFLIBS   := $(FFLIBS-yes) $(FFLIBS)
+TESTS    += $(TESTS-yes)
 
 FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
 FFLDFLAGS   := $(addprefix -L$(BUILD_ROOT)/lib,$(FFLIBS)) $(LDFLAGS)
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 124fc8d025bae19471e6411a2cd5aa004303bc39..3652464c7e8ae61ce310cb4f0763e89bd5b5f591 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -465,9 +465,7 @@ ASM_OBJS-$(ARCH_BFIN)                  += bfin/pixels_bfin.o \
                                           bfin/vp3_idct_bfin.o   \
 
 TESTS = $(addsuffix -test$(EXESUF), cabac dct eval fft h264 imgresample rangecoder snow)
-ifeq ($(ARCH_X86),yes)
-TESTS += cpuid-test$(EXESUF) motion-test$(EXESUF)
-endif
+TESTS-$(ARCH_X86) += cpuid-test$(EXESUF) motion-test$(EXESUF)
 
 CLEANFILES = \
     alpha/*.o alpha/*~ \