Makefile 1.4 KB
Newer Older
Laurent Aimar's avatar
Laurent Aimar committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 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 55 56 57 58
# Makefile: tuned for i386/MMX system only
# For ppc append
#  SRCS: core/ppc/mc.c core/ppc/pixel.c 
#  Defines: HAVE_ALTIVEC
#  CFLAGS: -faltivec
#
CC=gcc
CFLAGS=-g -Wall -I. -DDEBUG -O4 -funroll-loops -D__X264__ -DHAVE_MALLOC_H -DHAVE_MMXEXT -DARCH_X86

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 \
       encoder/encoder.c \
       core/i386/mc-c.c core/i386/dct-c.c core/i386/predict.c \
       x264.c

AS= nasm
# for linux
ASFLAGS=-f elf
# 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:
	rm -f $(OBJS) $(OBJASM) *.a x264.o .depend x264

distclean:
	rm -f $(OBJS) $(OBJASM) *.a x264.o .depend x264