build: Consistently handle conditional compilation for all optimization OBJS.
authorDiego Biurrun <diego@biurrun.de>
Tue, 27 Mar 2012 21:10:02 +0000 (23:10 +0200)
committerDiego Biurrun <diego@biurrun.de>
Thu, 12 Apr 2012 07:00:49 +0000 (09:00 +0200)
Makefile
arch.mak [new file with mode: 0644]
common.mak
libavcodec/arm/Makefile
libavcodec/mips/Makefile
libavcodec/ppc/Makefile
libavcodec/sparc/Makefile
libavcodec/x86/Makefile
libswscale/Makefile

index b5f8ad8..2d9e435 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -100,7 +100,8 @@ config.h: .config
 
 SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS      \
                ARCH_HEADERS BUILT_HEADERS SKIPHEADERS                    \
-               ALTIVEC-OBJS ARMV6-OBJS MMX-OBJS NEON-OBJS YASM-OBJS      \
+               ALTIVEC-OBJS ARMV5TE-OBJS ARMV6-OBJS ARMVFP-OBJS MMI-OBJS \
+               MMX-OBJS NEON-OBJS VIS-OBJS YASM-OBJS                     \
                OBJS TESTOBJS
 
 define RESET
diff --git a/arch.mak b/arch.mak
new file mode 100644 (file)
index 0000000..33018f3
--- /dev/null
+++ b/arch.mak
@@ -0,0 +1,13 @@
+OBJS-$(HAVE_ARMV5TE) += $(ARMV5TE-OBJS) $(ARMV5TE-OBJS-yes)
+OBJS-$(HAVE_ARMV6)   += $(ARMV6-OBJS)   $(ARMV6-OBJS-yes)
+OBJS-$(HAVE_ARMVFP)  += $(ARMVFP-OBJS)  $(ARMVFP-OBJS-yes)
+OBJS-$(HAVE_NEON)    += $(NEON-OBJS)    $(NEON-OBJS-yes)
+
+OBJS-$(HAVE_MMI)     += $(MMI-OBJS)     $(MMI-OBJS-yes)
+
+OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
+
+OBJS-$(HAVE_VIS)     += $(VIS-OBJS)     $(VIS-OBJS-yes)
+
+OBJS-$(HAVE_MMX)     += $(MMX-OBJS)     $(MMX-OBJS-yes)
+OBJS-$(HAVE_YASM)    += $(YASM-OBJS)    $(YASM-OBJS-yes)
index d781ced..7f2c367 100644 (file)
@@ -5,7 +5,7 @@
 # first so "all" becomes default target
 all: all-yes
 
-OBJS-$(HAVE_MMX) +=  $(MMX-OBJS-yes)
+include $(SRC_PATH)/arch.mak
 
 OBJS      += $(OBJS-yes)
 FFLIBS    := $(FFLIBS-yes) $(FFLIBS)
index 2f5cea7..e6d9218 100644 (file)
@@ -27,21 +27,19 @@ OBJS                                   += arm/dsputil_init_arm.o        \
                                           arm/mpegvideo_arm.o           \
                                           arm/simple_idct_arm.o         \
 
-OBJS-$(HAVE_ARMV5TE)                   += arm/dsputil_init_armv5te.o    \
+ARMV5TE-OBJS                           += arm/dsputil_init_armv5te.o    \
                                           arm/mpegvideo_armv5te.o       \
                                           arm/mpegvideo_armv5te_s.o     \
                                           arm/simple_idct_armv5te.o     \
 
-OBJS-$(HAVE_ARMV6)                     += arm/dsputil_init_armv6.o      \
+ARMV6-OBJS                             += arm/dsputil_init_armv6.o      \
                                           arm/dsputil_armv6.o           \
                                           arm/simple_idct_armv6.o       \
-                                          $(ARMV6-OBJS-yes)
 
-VFP-OBJS-$(HAVE_ARMV6)                 += arm/fmtconvert_vfp.o          \
+ARMVFP-OBJS-$(HAVE_ARMV6)              += arm/fmtconvert_vfp.o
 
-OBJS-$(HAVE_ARMVFP)                    += arm/dsputil_vfp.o             \
+ARMVFP-OBJS                            += arm/dsputil_vfp.o             \
                                           arm/dsputil_init_vfp.o        \
-                                          $(VFP-OBJS-yes)
 
 NEON-OBJS-$(CONFIG_FFT)                += arm/fft_neon.o                \
                                           arm/fft_fixed_neon.o          \
@@ -83,10 +81,9 @@ NEON-OBJS-$(CONFIG_VP6_DECODER)        += arm/vp56dsp_neon.o            \
 
 NEON-OBJS-$(CONFIG_VP8_DECODER)        += arm/vp8dsp_neon.o
 
-OBJS-$(HAVE_NEON)                      += arm/dsputil_init_neon.o       \
+NEON-OBJS                              += arm/dsputil_init_neon.o       \
                                           arm/dsputil_neon.o            \
                                           arm/fmtconvert_neon.o         \
                                           arm/int_neon.o                \
                                           arm/mpegvideo_neon.o          \
                                           arm/simple_idct_neon.o        \
-                                          $(NEON-OBJS-yes)
index 0066176..37899b1 100644 (file)
@@ -1,3 +1,3 @@
-OBJS-$(HAVE_MMI) += mips/dsputil_mmi.o                                  \
-                    mips/idct_mmi.o                                     \
-                    mips/mpegvideo_mmi.o                                \
+MMI-OBJS += mips/dsputil_mmi.o                                          \
+            mips/idct_mmi.o                                             \
+            mips/mpegvideo_mmi.o                                        \
index d15fe2a..31f4fb8 100644 (file)
@@ -11,7 +11,7 @@ ALTIVEC-OBJS-$(CONFIG_VP5_DECODER)     += ppc/vp3dsp_altivec.o
 ALTIVEC-OBJS-$(CONFIG_VP6_DECODER)     += ppc/vp3dsp_altivec.o
 ALTIVEC-OBJS-$(CONFIG_VP8_DECODER)     += ppc/vp8dsp_altivec.o
 
-OBJS-$(HAVE_ALTIVEC)                   += ppc/dsputil_altivec.o         \
+ALTIVEC-OBJS                           += ppc/dsputil_altivec.o         \
                                           ppc/fdct_altivec.o            \
                                           ppc/float_altivec.o           \
                                           ppc/fmtconvert_altivec.o      \
@@ -19,4 +19,3 @@ OBJS-$(HAVE_ALTIVEC)                   += ppc/dsputil_altivec.o         \
                                           ppc/idct_altivec.o            \
                                           ppc/int_altivec.o             \
                                           ppc/mpegvideo_altivec.o       \
-                                          $(ALTIVEC-OBJS-yes)
index d42bed0..1b6ac81 100644 (file)
@@ -1,2 +1,2 @@
-OBJS-$(HAVE_VIS) += sparc/dsputil_vis.o                                 \
-                    sparc/simple_idct_vis.o                             \
+VIS-OBJS += sparc/dsputil_vis.o                                         \
+            sparc/simple_idct_vis.o                                     \
index 89d6bae..6602cce 100644 (file)
@@ -2,7 +2,7 @@ OBJS-$(CONFIG_MLP_DECODER)             += x86/mlpdsp.o
 OBJS-$(CONFIG_TRUEHD_DECODER)          += x86/mlpdsp.o
 OBJS-$(CONFIG_XMM_CLOBBER_TEST)        += x86/w64xmmtest.o
 
-OBJS-$(HAVE_MMX)                       += x86/dsputil_mmx.o             \
+MMX-OBJS                               += x86/dsputil_mmx.o             \
                                           x86/fdct_mmx.o                \
                                           x86/fmtconvert_mmx.o          \
                                           x86/idct_mmx_xvid.o           \
@@ -66,7 +66,6 @@ YASM-OBJS-$(CONFIG_VP6_DECODER)        += x86/vp3dsp.o                  \
                                           x86/vp56dsp.o
 YASM-OBJS-$(CONFIG_VP8_DECODER)        += x86/vp8dsp.o
 
-MMX-OBJS-$(HAVE_YASM)                  += x86/dsputil_yasm.o            \
+YASM-OBJS                              += x86/dsputil_yasm.o            \
                                           x86/deinterlace.o             \
                                           x86/fmtconvert.o              \
-                                          $(YASM-OBJS-yes)
index 7301646..94c6efb 100644 (file)
@@ -15,14 +15,14 @@ OBJS = input.o                                          \
 OBJS-$(ARCH_BFIN)          +=  bfin/internal_bfin.o     \
                                bfin/swscale_bfin.o      \
                                bfin/yuv2rgb_bfin.o
-OBJS-$(HAVE_ALTIVEC)       +=  ppc/swscale_altivec.o    \
+ALTIVEC-OBJS               +=  ppc/swscale_altivec.o    \
                                ppc/yuv2rgb_altivec.o    \
                                ppc/yuv2yuv_altivec.o
-OBJS-$(HAVE_MMX)           +=  x86/rgb2rgb.o            \
+MMX-OBJS                   +=  x86/rgb2rgb.o            \
                                x86/swscale_mmx.o        \
                                x86/yuv2rgb_mmx.o
-OBJS-$(HAVE_VIS)           +=  sparc/yuv2rgb_vis.o
-MMX-OBJS-$(HAVE_YASM)      +=  x86/input.o              \
+VIS-OBJS                   +=  sparc/yuv2rgb_vis.o
+YASM-OBJS                  +=  x86/input.o              \
                                x86/output.o             \
                                x86/scale.o