Makefile 1.45 KB
Newer Older
Laurent Aimar's avatar
Laurent Aimar committed
1
2
3
# Makefile: tuned for i386/MMX system only
# For ppc append
#  SRCS: core/ppc/mc.c core/ppc/pixel.c 
4
#  Defines: HAVE_PPC
Laurent Aimar's avatar
Laurent Aimar committed
5
6
#  CFLAGS: -faltivec
#
Min Chen's avatar
Min Chen committed
7
PFLAGS=-DARCH_X86 -DHAVE_MMXEXT -DHAVE_SSE2
Laurent Aimar's avatar
Laurent Aimar committed
8
CC=gcc
Min Chen's avatar
Min Chen committed
9
CFLAGS=-g -Wall -I. -DDEBUG -O4 -funroll-loops -D__X264__ -DHAVE_MALLOC_H $(PFLAGS)
Laurent Aimar's avatar
Laurent Aimar committed
10
11
12
13
14
15

SRCS=  core/mc.c core/predict.c core/pixel.c core/macroblock.c \
       core/frame.c core/dct.c core/cpu.c core/cabac.c \
       core/common.c core/mdate.c core/csp.c \
       encoder/analyse.c encoder/me.c encoder/ratecontrol.c \
       encoder/set.c encoder/macroblock.c encoder/cabac.c encoder/cavlc.c \
16
       encoder/encoder.c encoder/eval.c \
Laurent Aimar's avatar
Laurent Aimar committed
17
18
19
20
21
       core/i386/mc-c.c core/i386/dct-c.c core/i386/predict.c \
       x264.c

AS= nasm
# for linux
Min Chen's avatar
Min Chen committed
22
ASFLAGS=-f elf $(PFLAGS)
Laurent Aimar's avatar
Laurent Aimar committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# for cygwin
#ASFLAGS=-f gnuwin32 -DPREFIX

ASMSRC= core/i386/dct.asm core/i386/cpu.asm core/i386/pixel.asm  core/i386/mc.asm
OBJASM= $(ASMSRC:%.asm=%.o)

OBJS = $(SRCS:%.c=%.o)
DEP  = depend

default: $(DEP) x264

libx264.a: $(OBJS) $(OBJASM)
	ar rc libx264.a $(OBJS) $(OBJASM)

x264: libx264.a x264.o
	$(CC) $(CFLAGS) -o x264 x264.o libx264.a -lm

checkasm: testing/checkasm.c libx264.a
	$(CC) $(CFLAGS) -o checkasm $< libx264.a -lm

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

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

depend: .depend
ifneq ($(wildcard .depend),)
include .depend
endif

clean:
Måns Rullgård's avatar
Måns Rullgård committed
55
	rm -f $(OBJS) $(OBJASM) *.a x264.o .depend x264 TAGS
Laurent Aimar's avatar
Laurent Aimar committed
56

Måns Rullgård's avatar
Måns Rullgård committed
57
distclean: clean
Laurent Aimar's avatar
Laurent Aimar committed
58

Måns Rullgård's avatar
Måns Rullgård committed
59
60
61
62
etags: TAGS

TAGS:
	etags $(SRCS)