Makefile 2.2 KB
Newer Older
1 2
include ../config.mak

3
CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H
F
Fabrice Bellard 已提交
4 5 6
LDFLAGS= -g

OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
7
      mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
F
Fabrice Bellard 已提交
8 9
      motion_est.o imgconvert.o imgresample.o msmpeg4.o \
      mpeg12.o h263dec.o rv10.o
10
ASM_OBJS=
F
Fabrice Bellard 已提交
11 12

# currently using libac3 for ac3 decoding
13
ifeq ($(CONFIG_AC3),yes)
F
Fabrice Bellard 已提交
14 15 16
OBJS+= ac3dec.o \
       libac3/bit_allocate.o libac3/bitstream.o libac3/downmix.o \
       libac3/imdct.o  libac3/parse.o
17
endif
F
Fabrice Bellard 已提交
18 19

# currently using mpglib for mpeg audio decoding
20
ifeq ($(CONFIG_MPGLIB),yes)
F
Fabrice Bellard 已提交
21 22 23
OBJS+= mpegaudiodec.o \
       mpglib/layer1.o mpglib/layer2.o mpglib/layer3.o \
       mpglib/dct64_i386.o mpglib/decode_i386.o  mpglib/tabinit.o
24
endif
F
Fabrice Bellard 已提交
25 26

# i386 mmx specific stuff
27
ifeq ($(TARGET_MMX),yes)
28
ASM_OBJS += i386/fdct_mmx.o i386/sad_mmx.o
29
OBJS += i386/fdctdata.o i386/cputest.o \
F
Fabrice Bellard 已提交
30 31
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
        i386/idct_mmx.o
F
Fabrice Bellard 已提交
32 33
endif

F
Fabrice Bellard 已提交
34 35 36 37 38 39
# armv4l specific stuff
ifeq ($(TARGET_ARCH_ARMV4L),yes)
ASM_OBJS += armv4l/jrevdct_arm.o
OBJS += armv4l/dsputil_arm.o
endif

40 41
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)

F
Fabrice Bellard 已提交
42 43 44
LIB= libavcodec.a
TESTS= imgresample-test dct-test

45
all: $(LIB)
N
Nick Kurshev 已提交
46
tests: apiexample cpuid_test $(TESTS)
F
Fabrice Bellard 已提交
47

48
$(LIB): $(OBJS) $(ASM_OBJS)
F
Fabrice Bellard 已提交
49
	rm -f $@
50
	$(AR) rcs $@ $(OBJS) $(ASM_OBJS)
F
Fabrice Bellard 已提交
51 52 53 54 55 56

dsputil.o: dsputil.c dsputil.h

%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $< 

F
Fabrice Bellard 已提交
57 58 59
%.o: %.S
	$(CC) $(CFLAGS) -c -o $@ $<

F
Fabrice Bellard 已提交
60 61 62
%.o: %.s
	nasm -f elf -o $@ $<

63 64 65 66 67 68
# depend only used by mplayer now
dep:	depend

depend:
	$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend

F
Fabrice Bellard 已提交
69 70
clean: 
	rm -f *.o *~ *.a i386/*.o i386/*~ \
F
Fabrice Bellard 已提交
71
	   armv4l/*.o armv4l/*~ \
F
Fabrice Bellard 已提交
72 73 74 75
           libac3/*.o libac3/*~ \
           mpglib/*.o mpglib/*~ \
           apiexample $(TESTS)

76 77 78
distclean: clean
	rm -f Makefile.bak .depend

F
Fabrice Bellard 已提交
79 80 81 82
# api example program
apiexample: apiexample.c $(LIB)
	$(CC) $(CFLAGS) -o $@ $< $(LIB) -lm

N
Nick Kurshev 已提交
83 84 85 86
# cpuid test
cpuid_test: i386/cputest.c
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<

F
Fabrice Bellard 已提交
87 88 89 90 91
# testing progs

imgresample-test: imgresample.c
	$(CC) $(CFLAGS) -DTEST -o $@ $^ 

F
Fabrice Bellard 已提交
92 93
dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o i386/fdctdata.o \
          fdctref.o jrevdct.o i386/idct_mmx.o
F
Fabrice Bellard 已提交
94
	$(CC) -o $@ $^
95 96 97 98 99 100 101

#
# include dependency files if they exist
#
ifneq ($(wildcard .depend),)
include .depend
endif