# OpenDivX encoder

LIBNAME = libencore.a

include ../config.mak

SRCS	= encore.c mom_access.c bitstream.c mom_util.c mot_code.c mot_est_comp.c mot_est_mb.c mot_util.c putvlc.c rc_hist.c rc_q2.c rgb2yuv.c text_bits.c text_code.c text_code_mb.c text_dct.c vop_code.c
OBJS	= $(SRCS:.c=.o)
INCLUDE = -I. $(EXTRA_INC)
CFLAGS  = $(OPTFLAGS) $(INCLUDE)

.SUFFIXES: .c .o

# .PHONY: all clean

.c.o:
	$(CC) -c $(CFLAGS) -o $@ $<

$(LIBNAME):	$(OBJS)
	$(AR) r $(LIBNAME) $(OBJS)

all:	$(LIBNAME)

clean:
	rm -f *.o *.a *~

distclean:
	rm -f Makefile.bak *.o *.a *~ .depend

dep:    depend

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

#
# include dependency files if they exist
#
ifneq ($(wildcard .depend),)
include .depend
endif
