# Makefile for vmpeg

# Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved.

#
# Disclaimer of Warranty
#
# These software programs are available to the user without any license fee or
# royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
# any and all warranties, whether express, implied, or statuary, including any
# implied warranties or merchantability or of fitness for a particular
# purpose.  In no event shall the copyright-holder be liable for any
# incidental, punitive, or consequential damages of any kind whatsoever
# arising from the use of these programs.
#
# This disclaimer of warranty extends to the user of these programs and user's
# customers, employees, agents, transferees, successors, and assigns.
#
# The MPEG Software Simulation Group does not represent or warrant that the
# programs furnished hereunder are free of infringement of any third-party
# patents.
#
# Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
# are subject to royalty fees to patent holders.  Many of these patents are
# general enough such that they are unavoidable regardless of implementation
# design.
#
#

WARNINGS = -dontwarn=129
#VERIFY = -DVERIFY

#disable this flag if you do not want bitstream element tracing 
#this will speed up the decoder some since it does not have to test
#the trace flag at several critical inner loop locations.
#TRACE = -DTRACE

#disable this flag if you do not need verbose trace, such as
#header information
#VERBOSE = -DVERBOSE


#
# vbcc Compiler
#
CC = vc +warposdb_wos
INCLUDEDIR = -I.
CPPFLAGS =
CDEFS = $(TRACE) $(VERBOSE) $(VERIFY) $(WARNINGS) -DDISPLAY
CFLAGS = -c -cpu=604 -O3 -maxoptpasses=64 -amiga-align $(INCLUDEDIR) $(CDEFS)
AS = pasm
ASFLAGS = -F2 -I mpegaudio
LD = vlink
LDFLAGS = -bamigaehf -r
LDLIBS = -lauto -lamiga -lcgfx -lp96 -lppcmath -lm


OBJ = mpeg2dec.o getpic.o motion.o getvlc.o gethdr.o getblk.o getbits.o \
      store.o recon.o spatscal.o idctPPC.o idctref.o systems.o subspic.o \
      verify.o amidisplay.o audio.o audioPPC.o writeframe.o

all: vmpeg

clean:
	delete quiet force #?.o mpegaudio/#?.o vmpeg


vmpeg: $(OBJ) mpegaudio/mpegaudio.o
	$(CC) $(OBJ) mpegaudio/mpegaudio.o $(LDLIBS) -o vmpeg


mpegaudio/mpegaudio.o: mpegaudio/common.o mpegaudio/commonPPC.o \
                       mpegaudio/decode.o mpegaudio/decodePPC.o
	$(LD) $(LDFLAGS) -o mpegaudio/mpegaudio.o \
                            mpegaudio/common.o mpegaudio/commonPPC.o \
                            mpegaudio/decode.o mpegaudio/decodePPC.o


#
# dependencies
#
amidisplay.o: amidisplay.c config.h global.h mpeg2dec.h
	$(CC) $(CFLAGS) amidisplay.c

getbits.o: getbits.c config.h global.h mpeg2dec.h
	$(CC) $(CFLAGS) getbits.c

getblk.o: getblk.c config.h global.h mpeg2dec.h
	$(CC) $(CFLAGS) getblk.c

gethdr.o: gethdr.c config.h global.h mpeg2dec.h
	$(CC) $(CFLAGS) gethdr.c

getpic.o: getpic.c config.h global.h mpeg2dec.h
	$(CC) $(CFLAGS) getpic.c

getvlc.o: getvlc.c config.h global.h mpeg2dec.h getvlc.h
	$(CC) $(CFLAGS) getvlc.c

idct.o: idct.c config.h
	$(CC) $(CFLAGS) idct.c

idctref.o: idctref.c config.h
	$(CC) $(CFLAGS) idctref.c

motion.o: motion.c config.h global.h mpeg2dec.h
	$(CC) $(CFLAGS) motion.c

mpeg2dec.o: mpeg2dec.c config.h global.h mpeg2dec.h
	$(CC) $(CFLAGS) mpeg2dec.c

recon.o: recon.c config.h global.h mpeg2dec.h
	$(CC) $(CFLAGS) recon.c

spatscal.o: spatscal.c config.h global.h mpeg2dec.h
	$(CC) $(CFLAGS) spatscal.c

store.o: store.c config.h global.h mpeg2dec.h
	$(CC) $(CFLAGS) store.c

systems.o: systems.c config.h global.h mpeg2dec.h
	$(CC) $(CFLAGS) systems.c

subspic.o: subspic.c config.h global.h mpeg2dec.h
	$(CC) $(CFLAGS) subspic.c

verify.o: verify.c config.h global.h mpeg2dec.h
	$(CC) $(CFLAGS) verify.c

writeframe.o: writeframe.s
	$(AS) $(ASFLAGS) writeframe.s

idctPPC.o: idctPPC.s
	$(AS) $(ASFLAGS) idctPPC.s

audioPPC.o: audioPPC.s
	$(AS) $(ASFLAGS) audioPPC.s


mpegaudio/common.o: mpegaudio/common.c mpegaudio/common.h audio.h
	$(CC) $(CFLAGS) mpegaudio/common.c

mpegaudio/commonPPC.o: mpegaudio/commonPPC.s mpegaudio/common.i
	$(AS) $(ASFLAGS) mpegaudio/commonPPC.s

mpegaudio/decode.o: mpegaudio/decode.c mpegaudio/common.h mpegaudio/decoder.h
	$(CC) $(CFLAGS) mpegaudio/decode.c

mpegaudio/decodePPC.o: mpegaudio/decodePPC.s mpegaudio/common.i
	$(AS) $(ASFLAGS) mpegaudio/decodePPC.s
