Makefile 1.84 KB
Newer Older
1
# Makefile
2

3
4
5
6
7
8
9
10
include config.mak

SRCS = common/mc.c common/predict.c common/pixel.c common/macroblock.c \
       common/frame.c common/dct.c common/cpu.c common/cabac.c \
       common/common.c common/mdate.c common/csp.c \
       encoder/analyse.c encoder/me.c encoder/ratecontrol.c \
       encoder/set.c encoder/macroblock.c encoder/cabac.c \
       encoder/cavlc.c encoder/encoder.c encoder/eval.c
Laurent Aimar's avatar
Laurent Aimar committed
11

12
13
# MMX/SSE optims
ifeq ($(ARCH),X86)
14
15
16
17
18
SRCS   += common/i386/mc-c.c common/i386/dct-c.c common/i386/predict.c
ASMSRC  = common/i386/dct-a.asm common/i386/cpu-a.asm \
          common/i386/pixel-a.asm common/i386/mc-a.asm \
          common/i386/mc-a2.asm common/i386/predict-a.asm
OBJASM  = $(ASMSRC:%.asm=%.o)
19
20
21
22
endif

# AltiVec optims
ifeq ($(ARCH),PPC)
23
SRCS += common/ppc/mc.c common/ppc/pixel.c
24
25
endif

Laurent Aimar's avatar
Laurent Aimar committed
26
27
28
29
30
OBJS = $(SRCS:%.c=%.o)
DEP  = depend

default: $(DEP) x264

Loren Merritt's avatar
Loren Merritt committed
31
libx264.a: $(DEP) $(OBJS) $(OBJASM)
Laurent Aimar's avatar
Laurent Aimar committed
32
	ar rc libx264.a $(OBJS) $(OBJASM)
33
	ranlib libx264.a
Laurent Aimar's avatar
Laurent Aimar committed
34
35

x264: libx264.a x264.o
Loren Merritt's avatar
Loren Merritt committed
36
37
38
39
	$(CC) -o $@ x264.o libx264.a $(LDFLAGS)

x264vfw.dll: libx264.a $(wildcard vfw/*.c vfw/*.h)
	make -C vfw/build/cygwin
Laurent Aimar's avatar
Laurent Aimar committed
40

Eric Petit's avatar
Eric Petit committed
41
checkasm: testing/checkasm.o libx264.a
42
	$(CC) -o $@ $< libx264.a $(LDFLAGS)
Laurent Aimar's avatar
Laurent Aimar committed
43
44
45
46

%.o: %.asm
	$(AS) $(ASFLAGS) -o $@ $<

Loren Merritt's avatar
Loren Merritt committed
47
.depend: config.mak config.h
48
	rm -f .depend
49
# Hacky - because gcc 2.9x doesn't have -MT
50
	$(foreach SRC, $(SRCS) x264.c, ( echo -n "`dirname $(SRC)`/" && $(CC) $(CFLAGS) $(SRC) -MM -g0 ) 1>> .depend;)
Laurent Aimar's avatar
Laurent Aimar committed
51

52
config.h: $(wildcard .svn/entries */.svn/entries */*/.svn/entries)
53
54
	./version.sh

Laurent Aimar's avatar
Laurent Aimar committed
55
56
57
58
59
60
depend: .depend
ifneq ($(wildcard .depend),)
include .depend
endif

clean:
61
	rm -f $(OBJS) $(OBJASM) config.h *.a x264.o .depend x264 TAGS
Laurent Aimar's avatar
Laurent Aimar committed
62

Måns Rullgård's avatar
Måns Rullgård committed
63
distclean: clean
Loren Merritt's avatar
Loren Merritt committed
64
	rm -f config.mak vfw/build/cygwin/config.mak
Laurent Aimar's avatar
Laurent Aimar committed
65

Loren Merritt's avatar
Loren Merritt committed
66
67
68
69
70
71
DIR_INSTALL="/usr/local"
install: x264
	install x264.h $(DIR_INSTALL)/include/
	install libx264.a $(DIR_INSTALL)/lib/
	install x264 $(DIR_INSTALL)/bin/

Måns Rullgård's avatar
Måns Rullgård committed
72
73
74
75
etags: TAGS

TAGS:
	etags $(SRCS)