Makefile 1.51 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
#  CFLAGS: -faltivec
6
# For FreeBSD, remove -DHAVE_MALLOC_H and add -DSYS_FREEBSD
Laurent Aimar's avatar
Laurent Aimar committed
7
#
Min Chen's avatar
Min Chen committed
8
PFLAGS=-DARCH_X86 -DHAVE_MMXEXT -DHAVE_SSE2
Laurent Aimar's avatar
Laurent Aimar committed
9
CC=gcc
Min Chen's avatar
Min Chen committed
10
CFLAGS=-g -Wall -I. -DDEBUG -O4 -funroll-loops -D__X264__ -DHAVE_MALLOC_H $(PFLAGS)
Laurent Aimar's avatar
Laurent Aimar committed
11 12 13 14 15 16

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 \
17
       encoder/encoder.c encoder/eval.c \
Laurent Aimar's avatar
Laurent Aimar committed
18 19 20 21 22
       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
23
ASFLAGS=-f elf $(PFLAGS)
Laurent Aimar's avatar
Laurent Aimar committed
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 55
# 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
56
	rm -f $(OBJS) $(OBJASM) *.a x264.o .depend x264 TAGS
Laurent Aimar's avatar
Laurent Aimar committed
57

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

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

TAGS:
	etags $(SRCS)