Makefile 1.63 KB
Newer Older
Laurent Aimar's avatar
Laurent Aimar committed
1
# Makefile: tuned for i386/MMX system only
2

3
# For FreeBSD, remove -DHAVE_MALLOC_H and add -DSYS_FREEBSD
Laurent Aimar's avatar
Laurent Aimar committed
4

5 6 7 8
# Uncomment this for Mac OS X
#SYS_MACOSX=1

SRCS_COMMON= core/mc.c core/predict.c core/pixel.c core/macroblock.c \
Eric Petit's avatar
Typo  
Eric Petit committed
9 10 11 12 13
             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 encoder/encoder.c encoder/eval.c x264.c
14 15 16 17 18 19 20 21 22 23 24 25 26

ifdef SYS_MACOSX
PFLAGS=-DARCH_PPC -DSYS_MACOSX -faltivec
SRCS= $(SRCS_COMMON) core/ppc/mc.c core/ppc/pixel.c
else
PFLAGS=-DARCH_X86 -DHAVE_MMXEXT -DHAVE_SSE2 -DHAVE_MALLOC_H
SRCS= $(SRCS_COMMON) core/i386/mc-c.c core/i386/dct-c.c core/i386/predict.c
ASMSRC= core/i386/dct.asm core/i386/cpu.asm core/i386/pixel.asm  core/i386/mc.asm
OBJASM= $(ASMSRC:%.asm=%.o)
endif

CC=gcc
CFLAGS=-g -Wall -I. -DDEBUG -O4 -funroll-loops -D__X264__ $(PFLAGS)
Laurent Aimar's avatar
Laurent Aimar committed
27 28 29

AS= nasm
# for linux
Min Chen's avatar
Min Chen committed
30
ASFLAGS=-f elf $(PFLAGS)
Laurent Aimar's avatar
Laurent Aimar committed
31 32 33 34 35 36 37 38 39 40
# for cygwin
#ASFLAGS=-f gnuwin32 -DPREFIX

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

default: $(DEP) x264

libx264.a: $(OBJS) $(OBJASM)
	ar rc libx264.a $(OBJS) $(OBJASM)
41
	ranlib libx264.a
Laurent Aimar's avatar
Laurent Aimar committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

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
61
	rm -f $(OBJS) $(OBJASM) *.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
Laurent Aimar's avatar
Laurent Aimar committed
64

Måns Rullgård's avatar
Måns Rullgård committed
65 66 67 68
etags: TAGS

TAGS:
	etags $(SRCS)