#/************************* MPEG-2 NBC Audio Decoder **************************
# *                                                                           *
# *                                                                           *
# ****************************************************************************/

# Common
OBJS1 =	aiff_support.o config.o coupling.o decdata.o decoder.o \
	huffdec1.o huffdec2.o huffdec3.o huffinit.o hufftables.o \
	intensity.o intrins.o monopred.o portio.o stereo.o tns.o pns.o

# DOLBY imdct
OBJS3 =	block.o dolby_adapt.o util.o weave.o transfo.o

# SONY gain control
OBJS4 = gc_unpac.o gc_compensate.o gc_common.o \
        gc_pqf_common.o gc_ipqf.o gc.o gc_mdct_common.o gc_imdct.o

# NOKIA long term prediction
OBJS5 = nok_lt_prediction.o

# Configuration
OBJS	=	$(OBJS1) $(OBJS3) $(OBJS4) $(OBJS5)

DEFS    =	-DDOUBLE_WIN -DDOLBY_MDCT -DSSR  -DHAS_ULONG -DMPEG4V1

optimization =	-g
CC =		gcc
LD =		$(CC) $(optimization)
FLAGS =		$(optimization) -Wall -I. $(DEFS)

H	=	all.h stdinc.h interface.h monopred.h tns.h port.h gc.h

DEC	=	dec

all: $(DEC) show_adif

%.o : %.c $(H)
	$(CC) -c $(FLAGS) $< 

$(DEC):	$(OBJS) nulltio.o
	$(LD) -o $(DEC) $(OBJS) nulltio.o -lm 

show_adif: show_adif.c
	$(LD) -o show_adif show_adif.c

clean:
	rm -f *.o config.status config.cache config.log

clobber:
	rm -f *.o $(DEC) show_adif config.status config.cache config.log

aiff_support.o: aiff_support.c aiff_support.h
config.o:	config.c
coupling.o:	coupling.c
decdata.o:	decdata.c
decoder.o:	decoder.c	block.h dolby_def.h
huffdec1.o:	huffdec1.c
huffdec2.o:	huffdec2.c	
huffdec3.o:	huffdec3.c	
huffinit.o:	huffinit.c	
hufftables.o:	hufftables.c
intensity.o:	intensity.c
intrins.o:	intrins.c
monopred.o:	monopred.c	monopred.h
nulltio.o:	nulltio.c
portio.o:	portio.c        aiff_support.h
stereo.o:	stereo.c
tns.o:          tns.c

block.o:	block.c 	block.h dolby_win.h
dolby_adapt.o:	dolby_adapt.c	weave.h dolby_def.h block.h \
				mdct_fhg_1024.h util.h
transfo.o:	transfo.c  	transfo.h
util.o:		util.c
weave.o:	weave.c		mdct_fhg_1024.h weave.h

gc_unpac.o:     gc_unpac.c
gc_common.o:    gc_common.c
gc_compensate.o:        gc_compensate.c
gc_pqf_common.o:        gc_pqf_common.c
gc_ipqf.o:      gc_ipqf.c
gc.o:           gc.c
gc_mdct_common.o:       gc_mdct_common.c
gc_imdct.o:     gc_imdct.c

nok_lt_prediction.o: \
		nok_lt_prediction.c nok_lt_prediction.h nok_ltp_common.h \
		nok_ltp_common_internal.h

