EXENAME  = mpeg_encode.exe
JPEGDIR  = d:\projects\common\jpeg-6b
JPEGLIB  = $(JPEGDIR)\winnt_4.0\libjpeg.lib
INCLUDES = /Iheaders /I$(JPEGDIR)
CFLAGS   = /nologo /W1 $(INCLUDES) /DWIN32
LIBS     = $(JPEGLIB) kernel32.lib
OBJS     = mfwddct.obj postdct.obj huff.obj bitio.obj mheaders.obj mpeg.obj \
           subsample.obj param.obj rgbtoycc.obj readframe.obj combine.obj \
           jrevdct.obj frame.obj fsize.obj frametype.obj libpnmrw.obj \
           specifics.obj rate.obj opts.obj iframe.obj pframe.obj bframe.obj \
           psearch.obj bsearch.obj block.obj noparallel.obj jpeg.obj main.obj

.SILENT:

all: $(EXENAME)

clean:
    -del /F $(OBJS) $(EXENAME) 2>nul

$(EXENAME): $(OBJS)
    link /OUT:$@ /RELEASE /PDB:NONE $(OBJS) $(LIBS)

test:
    -del /F \tmp\ts.stat 2>nul
    $(EXENAME) -stat \tmp\ts.stat .\tst\ts.param >nul
	.\tst\diffscript \tmp\ts.stat .\tst\ts.stat \tmp\ts.mpg .\tst\ts.mpg
    -del /F \tmp\ts.stat \tmp\ts.mpg

testd:
    -del /F \tmp\tsd.stat 2>nul
    $(EXENAME) -stat \tmp\tsd.stat .\tst\tsd.param >nul
    .\tst\diffscript \tmp\tsd.stat .\tst\tsd.stat \tmp\tsd.mpg .\tst\tsd.mpg
    -del /F \tmp\tsd.stat \tmp\tsd.mpg
