Makefile 2.1 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
      motion_est.o imgconvert.o imgresample.o msmpeg4.o \
F
Fabrice Bellard 已提交
9
      mpeg12.o h263dec.o rv10.o mpegaudiodec.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

# i386 mmx specific stuff
20
ifeq ($(TARGET_MMX),yes)
F
Fabrice Bellard 已提交
21
OBJS += i386/fdct_mmx.o i386/cputest.o \
F
Fabrice Bellard 已提交
22
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
F
Fabrice Bellard 已提交
23
        i386/idct_mmx.o i386/motion_est_mmx.o
F
Fabrice Bellard 已提交
24 25
endif

F
Fabrice Bellard 已提交
26 27 28 29 30 31
# armv4l specific stuff
ifeq ($(TARGET_ARCH_ARMV4L),yes)
ASM_OBJS += armv4l/jrevdct_arm.o
OBJS += armv4l/dsputil_arm.o
endif

F
Fabrice Bellard 已提交
32 33 34 35 36 37 38
# sun mediaLib specific stuff
# currently only works when libavcodec is used in mplayer
ifeq ($(HAVE_MLIB),yes)
OBJS += mlib/dsputil_mlib.o
CFLAGS += $(MLIB_INC)
endif

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

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

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

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

dsputil.o: dsputil.c dsputil.h

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

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

59 60 61 62 63 64
# depend only used by mplayer now
dep:	depend

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

F
Fabrice Bellard 已提交
65 66
clean: 
	rm -f *.o *~ *.a i386/*.o i386/*~ \
F
Fabrice Bellard 已提交
67
	   armv4l/*.o armv4l/*~ \
F
Fabrice Bellard 已提交
68
	   mlib/*.o mlib/*~ \
F
Fabrice Bellard 已提交
69 70 71
           libac3/*.o libac3/*~ \
           apiexample $(TESTS)

72 73 74
distclean: clean
	rm -f Makefile.bak .depend

F
Fabrice Bellard 已提交
75 76 77 78
# api example program
apiexample: apiexample.c $(LIB)
	$(CC) $(CFLAGS) -o $@ $< $(LIB) -lm

N
Nick Kurshev 已提交
79 80 81 82
# cpuid test
cpuid_test: i386/cputest.c
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<

F
Fabrice Bellard 已提交
83 84 85 86 87
# testing progs

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

F
Fabrice Bellard 已提交
88
dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
F
Fabrice Bellard 已提交
89
          fdctref.o jrevdct.o i386/idct_mmx.o
F
Fabrice Bellard 已提交
90
	$(CC) -o $@ $^
91

F
Fabrice Bellard 已提交
92 93 94
motion-test: motion_test.o $(LIB)
	$(CC) -o $@ $^

95 96 97 98 99 100
#
# include dependency files if they exist
#
ifneq ($(wildcard .depend),)
include .depend
endif