diff Makefile @ 10400:866dffa620d1 libavcodec

Use hardcoded instead of runtime-calculated ff_cos_* tables if --enable-hardcoded-tables was used. Due to the size, the code for the tables is generated at compile time.
author reimar
date Wed, 14 Oct 2009 21:41:24 +0000
parents 81cf22a16ab3
children 8fd8f6c1cdcc
line wrap: on
line diff
--- a/Makefile	Wed Oct 14 05:28:24 2009 +0000
+++ b/Makefile	Wed Oct 14 21:41:24 2009 +0000
@@ -27,7 +27,8 @@
 # parts needed for many different codecs
 OBJS-$(CONFIG_AANDCT)                  += aandcttab.o
 OBJS-$(CONFIG_ENCODERS)                += faandct.o jfdctfst.o jfdctint.o
-OBJS-$(CONFIG_FFT)                     += fft.o
+FFT-OBJS-$(CONFIG_HARDCODED_TABLES)    += cos_tables.o
+OBJS-$(CONFIG_FFT)                     += fft.o $(FFT-OBJS-yes)
 OBJS-$(CONFIG_GOLOMB)                  += golomb.o
 OBJS-$(CONFIG_MDCT)                    += mdct.o
 OBJS-$(CONFIG_RDFT)                    += rdft.o
@@ -571,6 +572,14 @@
 
 DIRS = alpha arm bfin mlib ppc ps2 sh4 sparc x86
 
+CLEANFILES = cos_tables.c costablegen$(HOSTEXESUF)
+
 include $(SUBDIR)../subdir.mak
 
 $(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o
+
+$(SUBDIR)costablegen$(HOSTEXESUF): $(SUBDIR)costablegen.c
+	$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
+
+$(SUBDIR)cos_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF)
+	./$< > $@