# This product contains certain software code or other information
# ("AT&T Software") proprietary to AT&T Corp. ("AT&T").  The AT&T
# Software is provided to you "AS IS".  YOU ASSUME TOTAL RESPONSIBILITY
# AND RISK FOR USE OF THE AT&T SOFTWARE.  AT&T DOES NOT MAKE, AND
# EXPRESSLY DISCLAIMS, ANY EXPRESS OR IMPLIED WARRANTIES OF ANY KIND
# WHATSOEVER, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, WARRANTIES OF
# TITLE OR NON-INFRINGEMENT OF ANY INTELLECTUAL PROPERTY RIGHTS, ANY
# WARRANTIES ARISING BY USAGE OF TRADE, COURSE OF DEALING OR COURSE OF
# PERFORMANCE, OR ANY WARRANTY THAT THE AT&T SOFTWARE IS "ERROR FREE" OR
# WILL MEET YOUR REQUIREMENTS.

# Unless you accept a license to use the AT&T Software, you shall not
# reverse compile, disassemble or otherwise reverse engineer this
# product to ascertain the source code for any AT&T Software.

# (c) AT&T Corp. All rights reserved.  AT&T is a registered trademark of AT&T Corp.

# **************************************************************************

# History:
#
#      12/02/2003- 0.8-beta by Hedzer Westra, hhwestra@cs.uu.nl
#      24/11/99  - initial release by Hartmut Liefke, liefke@seas.upenn.edu
#                                     Dan Suciu,      suciu@research.att.com

BIN = ./unix

TARGETS = $(BIN)/xcmill $(BIN)/xdemill $(BIN)/xmilltest \
	  $(BIN)/xmillexample $(BIN)/xmillinspect \
	  $(BIN)/ppmzip

all :	$(TARGETS)

clean:
	rm -r -f $(TMP)/* $(TARGETS)

TMP = ./tmp
SRC = ./XMill
TESTSRC = ./xmilltest
EXAMPLESRC = ./xmillexample
INSPECTSRC = ./xmillinspect
PPMZIPSRC = ./ppmzip
PPMSRC = ./ppmdi

CPP = g++
CC = gcc
LINK = g++

CFLAGS = -c

# To use MSXML.  Does not work with GCC on Windows (mingw)
#CFLAGS = -c -DHAVE_MSXML

# To use builtin libz.
#CPPFLAGS_ZLIB = -Izlib
#ZLIB_LDFLAGS =
#ZLIB_OBJS = $(TMP)/adler32.o $(TMP)/crc32.o $(TMP)/deflate.o $(TMP)/trees.o \
#		$(TMP)/uncompr.o $(TMP)/inffast.o $(TMP)/inflate.o \
#		$(TMP)/inftrees.o $(TMP)/infutil.o $(TMP)/infblock.o \
#		$(TMP)/infcodes.o $(TMP)/zutil.o

# To use system libz.
CPPFLAGS_ZLIB =
ZLIB_LDFLAGS = -lz
ZLIB_OBJS =

# To use builtin libbz.
#CPPFLAGS_BZLIB = -Ibzlib
#BZLIB_LDFLAGS =
#BZLIB_OBJS = $(TMP)/blocksort.o $(TMP)/bzlib.o $(TMP)/compress_b.o \
#	$(TMP)/crctable.o $(TMP)/decompress.o $(TMP)/huffman.o \
#	$(TMP)/randtable.o

# To use system libbz2.
CPPFLAGS_BZLIB = -DHAVE_BZIP2
BZLIB_LDFLAGS = -lbz2
BZLIB_OBJS =

CPPFLAGS_XMILL = $(CFLAGS) -DXMILL ${CPPFLAGS_ZLIB} ${CPPFLAGS_BZLIB} \
			-IXMill -Ippmdi
CPPFLAGS_XDEMILL = $(CFLAGS) ${CPPFLAGS_ZLIB} ${CPPFLAGS_BZLIB} \
			-DXDEMILL -Ippmdi
CPPFLAGS_XMILLTEST = $(CFLAGS) -IXMill
CPPFLAGS_PPMZIP = $(CFLAGS) -Ippmdi

LDLIBS=${ZLIB_LDFLAGS} ${BZLIB_LDFLAGS}
# LINK_FLAGS = -L.

XMILLLIB_MISC  =  \
		   $(TMP)/CompressMan.o $(TMP)/ContMan.o $(TMP)/PathDict.o \
		   $(TMP)/UnCompCont.o \
		   $(TMP)/PathTree.o \
		   $(TMP)/SAXClient.o \
		   $(TMP)/VPathExprMan.o $(TMP)/MemMan.o \
		   $(TMP)/MemStreamer.o \
		   $(TMP)/Error.o $(TMP)/FSM.o \
	           $(TMP)/XMillData.o \
	           $(TMP)/XMillAPI.o \
	           $(TMP)/File.o \
	           $(TMP)/Decode.o \
	           $(TMP)/LabelDict.o \
	           $(TMP)/CurPath.o \
	           $(TMP)/XMLOutput.o \
	           $(TMP)/XMLParse.o \
	           $(TMP)/FileParser.o \
	           $(TMP)/MainFileActions.o \
	           $(TMP)/Load.o $(TMP)/Input.o $(TMP)/Output.o

XMILLLIB_GPC  =  \
		   $(TMP)/ZLib.o \
		   $(TMP)/BZ_lib.o \
		   $(TMP)/NoZip.o \
		   $(TMP)/GZLib.o \
		   $(TMP)/ppmdi.o \
		   $(TMP)/Zipper.o

XMILLLIB_COMP  =  \
		   $(TMP)/SmallUncompress.o \
		   $(TMP)/UserCompress.o \
		   $(TMP)/UnCompress.o \
		   $(TMP)/Compress.o \
                   $(TMP)/RepeatCompress.o $(TMP)/RunLenCompress.o \
		   $(TMP)/StdCompress.o \
                   $(TMP)/OrCompress.o \
                   $(TMP)/DivCombineCompress.o $(TMP)/EnumCompress.o \
		   $(TMP)/DivSepCompress.o \
		   $(TMP)/UInt8Compressor.o \
		   $(TMP)/UIntCompressor.o \
		   $(TMP)/SIntCompressor.o \
		   $(TMP)/BaseXNumCompressor.o \
		   $(TMP)/PlainTextCompressor.o \
		   $(TMP)/PrintCompressor.o \
		   $(TMP)/DeltaCompressor.o \
		   $(TMP)/ConstantCompressor.o

PPMDI_OBJS = $(TMP)/Coder.o \
		$(TMP)/Data.o \
		$(TMP)/Model.o

PPMZIPOBJS = $(TMP)/ppmzip.o $(PPMDI_OBJS)

XMILLLIB_OBJSPART  = $(XMILLLIB_MISC) $(XMILLLIB_GPC) $(XMILLLIB_COMP)
XMILL_OBJSPART = $(TMP)/realmain.o $(TMP)/Options.o
XDEMILL_OBJSPART = $(TMP)/realmain_u.o $(TMP)/Options_u.o
XMILLTEST_OBJSPART = $(TMP)/testset.o $(TMP)/xmilltest.o

XMILLOBJS    = $(XMILL_OBJSPART) $(XMILLLIB_OBJSPART) $(PPMDI_OBJS) ${ZLIB_OBJS} ${BZLIB_OBJS}
XDEMILLOBJS  = $(XDEMILL_OBJSPART) $(XMILLLIB_OBJSPART) $(PPMDI_OBJS) ${ZLIB_OBJS} ${BZLIB_OBJS}
XMILLTESTOBJS  = $(XMILLTEST_OBJSPART) $(XMILLLIB_OBJSPART) $(PPMDI_OBJS) ${ZLIB_OBJS} ${BZLIB_OBJS}

XMILLINSPECTOBJS = $(TMP)/containers.o $(TMP)/exprinfo.o \
			$(TMP)/globals.o \
			$(TMP)/headers.o \
			$(TMP)/inspectfile.o \
			$(TMP)/lists.o \
			$(TMP)/main.o \
			$(TMP)/xmillinspect.o \
			$(ZLIB_OBJS) $(XMILLLIB_OBJSPART) $(BZLIB_OBJS) \
			$(PPMDI_OBJS)

XMILLEXAMPLEOBJS = $(TMP)/xmillexample.o \
			$(ZLIB_OBJS) $(XMILLLIB_OBJSPART) $(BZLIB_OBJS) \
			$(PPMDI_OBJS)

$(BIN)/xcmill : $(XMILLOBJS)
	$(LINK) -o $(BIN)/xcmill $(LINK_FLAGS) $(XMILLOBJS) $(LDLIBS)

$(BIN)/xdemill : $(XDEMILLOBJS)
	$(LINK) -o $(BIN)/xdemill $(LINK_FLAGS) $(XDEMILLOBJS) $(LDLIBS)

$(BIN)/xmilltest : $(XMILLTESTOBJS)
	$(LINK) -o $(BIN)/xmilltest $(LINK_FLAGS) $(XMILLTESTOBJS) $(LDLIBS)

$(BIN)/xmillexample : $(XMILLEXAMPLEOBJS)
	$(LINK) -o $(BIN)/xmillexample $(LINK_FLAGS) $(XMILLEXAMPLEOBJS) \
		$(LDLIBS)

$(BIN)/xmillinspect : $(XMILLINSPECTOBJS)
	$(LINK) -o $(BIN)/xmillinspect $(LINK_FLAGS) $(XMILLINSPECTOBJS) \
		$(LDLIBS)

$(BIN)/ppmzip : $(PPMZIPOBJS)
	$(LINK) -o $(BIN)/ppmzip $(LINK_FLAGS) $(PPMZIPOBJS) $(LDLIBS)

#minigzip: $(ZLIB_OBJS) minigzip.o gzio.o
# 	$(LINK) -o minigzip $(LINK_FLAGS) $(ZLIB_OBJS) minigzip.o gzio.o
#
#bzip: $(BZLIB_OBJS) bzip2.o
#	$(LINK) -o xmlbunzip $(LINK_FLAGS) $(ZLIB_OBJS) bzip2.o

#********************************************************************

#$(TMP)/.o    : $(SRC)/.cpp
#	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/.cpp

$(TMP)/SmallUncompress.o    : $(SRC)/SmallUncompress.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/SmallUncompress.cpp

$(TMP)/XMLOutput.o    : $(SRC)/XMLOutput.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/XMLOutput.cpp

$(TMP)/XMLParse.o    : $(SRC)/XMLParse.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/XMLParse.cpp

$(TMP)/FileParser.o    : $(SRC)/FileParser.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/FileParser.cpp

$(TMP)/MainFileActions.o    : $(SRC)/MainFileActions.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/MainFileActions.cpp

$(TMP)/LabelDict.o    : $(SRC)/LabelDict.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/LabelDict.cpp

$(TMP)/CurPath.o    : $(SRC)/CurPath.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/CurPath.cpp

$(TMP)/File.o    : $(SRC)/File.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/File.cpp

$(TMP)/Decode.o    : $(SRC)/Decode.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/Decode.cpp

$(TMP)/Input.o    : $(SRC)/Input.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/Input.cpp

$(TMP)/Output.o    : $(SRC)/Output.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/Output.cpp

$(TMP)/Load.o    : $(SRC)/Load.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/Load.cpp

$(TMP)/XMillAPI.o    : $(SRC)/xmillapi.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/xmillapi.cpp

$(TMP)/XMillData.o    : $(SRC)/XMillData.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/XMillData.cpp

$(TMP)/CompressMan.o    : $(SRC)/CompressMan.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/CompressMan.cpp

$(TMP)/ContMan.o        : $(SRC)/ContMan.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/ContMan.cpp

$(TMP)/UserCompress.o    : $(SRC)/UserCompress.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/UserCompress.cpp

$(TMP)/Compress.o    : $(SRC)/Compress.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/Compress.cpp

$(TMP)/UnCompress.o    : $(SRC)/Uncompress.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/Uncompress.cpp

$(TMP)/UnCompCont.o    : $(SRC)/UnCompCont.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/UnCompCont.cpp

$(TMP)/DivCombineCompress.o    : $(SRC)/DivCombineCompress.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/DivCombineCompress.cpp

$(TMP)/DivSepCompress.o    : $(SRC)/DivSepCompress.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/DivSepCompress.cpp

$(TMP)/EnumCompress.o   : $(SRC)/EnumCompress.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/EnumCompress.cpp

$(TMP)/UInt8Compressor.o   : $(SRC)/UInt8Compressor.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/UInt8Compressor.cpp

$(TMP)/UIntCompressor.o   : $(SRC)/UIntCompressor.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/UIntCompressor.cpp

$(TMP)/SIntCompressor.o   : $(SRC)/SIntCompressor.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/SIntCompressor.cpp

$(TMP)/PlainTextCompressor.o   : $(SRC)/PlainTextCompressor.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/PlainTextCompressor.cpp

$(TMP)/PrintCompressor.o   : $(SRC)/PrintCompressor.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/PrintCompressor.cpp

$(TMP)/DeltaCompressor.o   : $(SRC)/DeltaCompressor.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/DeltaCompressor.cpp

$(TMP)/ConstantCompressor.o   : $(SRC)/ConstantCompressor.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/ConstantCompressor.cpp

$(TMP)/BaseXNumCompressor.o   : $(SRC)/BaseXNumCompressor.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/BaseXNumCompressor.cpp

$(TMP)/Error.o          : $(SRC)/Error.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/Error.cpp

$(TMP)/FSM.o            : $(SRC)/FSM.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/FSM.cpp

$(TMP)/MemMan.o         : $(SRC)/MemMan.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/MemMan.cpp

$(TMP)/MemStreamer.o    : $(SRC)/MemStreamer.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/MemStreamer.cpp

$(TMP)/OrCompress.o     : $(SRC)/OrCompress.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/OrCompress.cpp

$(TMP)/PathDict.o       : $(SRC)/PathDict.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/PathDict.cpp

$(TMP)/PathTree.o       : $(SRC)/PathTree.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/PathTree.cpp

$(TMP)/RepeatCompress.o : $(SRC)/RepeatCompress.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/RepeatCompress.cpp

$(TMP)/RunLenCompress.o : $(SRC)/RunLenCompress.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/RunLenCompress.cpp

$(TMP)/SAXClient.o      : $(SRC)/SAXClient.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/SAXClient.cpp

$(TMP)/StdCompress.o    : $(SRC)/StdCompress.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/StdCompress.cpp

$(TMP)/VPathExprMan.o   : $(SRC)/VPathExprMan.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/VPathExprMan.cpp

#$(TMP)/VRegExpr.o       : $(SRC)/VRegExpr.cpp
#	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/VRegExpr.cpp

$(TMP)/ZLib.o           : $(SRC)/ZLib.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/ZLib.cpp

$(TMP)/GZLib.o           : $(SRC)/GZLib.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/GZLib.cpp

$(TMP)/BZ_lib.o           : $(SRC)/BZlib.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/BZlib.cpp

$(TMP)/NoZip.o           : $(SRC)/NoZip.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/NoZip.cpp

$(TMP)/ppmdi.o           : $(SRC)/PPMDI.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/PPMDI.cpp

$(TMP)/Zipper.o           : $(SRC)/Zipper.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/Zipper.cpp

#********************************************************************

$(TMP)/realmain.o           : $(SRC)/realmain.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/realmain.cpp

$(TMP)/Options.o        : $(SRC)/Options.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(SRC)/Options.cpp

#********************************************************************

$(TMP)/realmain_u.o           : $(SRC)/realmain.cpp
	$(CPP) -o $@ $(CPPFLAGS_XDEMILL) $(SRC)/realmain.cpp

$(TMP)/Options_u.o        : $(SRC)/Options.cpp
	$(CPP) -o $@ $(CPPFLAGS_XDEMILL) $(SRC)/Options.cpp

#********************************************************************

$(TMP)/testset.o:	$(TESTSRC)/testset.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILLTEST) $(TESTSRC)/testset.cpp

$(TMP)/xmilltest.o:	$(TESTSRC)/xmilltest.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILLTEST) $(TESTSRC)/xmilltest.cpp

#********************************************************************

$(TMP)/xmillexample.o:	$(EXAMPLESRC)/xmillexample.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILLTEST) $(EXAMPLESRC)/xmillexample.cpp

#********************************************************************

$(TMP)/xmillinspect.o:	$(INSPECTSRC)/xmillinspect.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(INSPECTSRC)/xmillinspect.cpp

$(TMP)/containers.o:	$(INSPECTSRC)/containers.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(INSPECTSRC)/containers.cpp

$(TMP)/exprinfo.o:	$(INSPECTSRC)/exprinfo.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(INSPECTSRC)/exprinfo.cpp

$(TMP)/globals.o:	$(INSPECTSRC)/globals.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(INSPECTSRC)/globals.cpp

$(TMP)/headers.o:	$(INSPECTSRC)/headers.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(INSPECTSRC)/headers.cpp

$(TMP)/inspectfile.o:	$(INSPECTSRC)/inspectfile.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(INSPECTSRC)/inspectfile.cpp

$(TMP)/lists.o:	$(INSPECTSRC)/lists.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(INSPECTSRC)/lists.cpp

$(TMP)/main.o:	$(INSPECTSRC)/main.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(INSPECTSRC)/main.cpp

#********************************************************************

$(TMP)/Coder.o:	$(PPMSRC)/Coder.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(PPMSRC)/Coder.cpp

$(TMP)/Model.o:	$(PPMSRC)/Model.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(PPMSRC)/Model.cpp

$(TMP)/Data.o:	$(PPMSRC)/Data.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(PPMSRC)/Data.cpp

#********************************************************************

$(TMP)/ppmzip.o:	$(PPMZIPSRC)/ppmzip.cpp
	$(CPP) -o $@ $(CPPFLAGS_XMILL) $(PPMZIPSRC)/ppmzip.cpp

#********************************************************************

$(TMP)/adler32.o : ./zlib/adler32.c
	$(CC) -o $@ $(CFLAGS) ./zlib/adler32.c

$(TMP)/crc32.o : ./zlib/crc32.c
	$(CC) -o $@ $(CFLAGS) ./zlib/crc32.c

$(TMP)/compress.o : ./zlib/compress.c
	$(CC) -o $@ $(CFLAGS) ./zlib/compress.c

$(TMP)/deflate.o : ./zlib/deflate.c
	$(CC) -o $@ $(CFLAGS) ./zlib/deflate.c

$(TMP)/gzio.o : ./zlib/gzio.c
	$(CC) -o $@ $(CFLAGS) ./zlib/gzio.c

$(TMP)/infblock.o : ./zlib/infblock.c
	$(CC) -o $@ $(CFLAGS) ./zlib/infblock.c

$(TMP)/infcodes.o : ./zlib/infcodes.c
	$(CC) -o $@ $(CFLAGS) ./zlib/infcodes.c

$(TMP)/inffast.o : ./zlib/inffast.c
	$(CC) -o $@ $(CFLAGS) ./zlib/inffast.c

$(TMP)/inflate.o : ./zlib/inflate.c
	$(CC) -o $@ $(CFLAGS) ./zlib/inflate.c

$(TMP)/inftrees.o : ./zlib/inftrees.c
	$(CC) -o $@ $(CFLAGS) ./zlib/inftrees.c

$(TMP)/infutil.o : ./zlib/infutil.c
	$(CC) -o $@ $(CFLAGS) ./zlib/infutil.c

$(TMP)/trees.o : ./zlib/trees.c
	$(CC) -o $@ $(CFLAGS) ./zlib/trees.c

$(TMP)/uncompr.o : ./zlib/uncompr.c
	$(CC) -o $@ $(CFLAGS) ./zlib/uncompr.c

$(TMP)/zutil.o : ./zlib/zutil.c
	$(CC) -o $@ $(CFLAGS) ./zlib/zutil.c

#$(TMP)/minigzip.o : ./zlib/minigzip.c
#	$(CC) -o $@ $(CFLAGS) ./zlib/minigzip.c

#********************************************************************

$(TMP)/blocksort.o : ./bzlib/blocksort.c
	$(CC) -o $@ $(CFLAGS) ./bzlib/blocksort.c

$(TMP)/compress_b.o : ./bzlib/compress.c
	$(CC) -o $@ $(CFLAGS) ./bzlib/compress.c

$(TMP)/crctable.o : ./bzlib/crctable.c
	$(CC) -o $@ $(CFLAGS) ./bzlib/crctable.c

$(TMP)/decompress.o : ./bzlib/decompress.c
	$(CC) -o $@ $(CFLAGS) ./bzlib/decompress.c

$(TMP)/huffman.o : ./bzlib/huffman.c
	$(CC) -o $@ $(CFLAGS) ./bzlib/huffman.c

$(TMP)/randtable.o : ./bzlib/randtable.c
	$(CC) -o $@ $(CFLAGS) ./bzlib/randtable.c

$(TMP)/bzlib.o : ./bzlib/bzlib.c
	$(CC) -o $@ $(CFLAGS) ./bzlib/bzlib.c

#$(TMP)/bzip2.o : ./bzlib/bzip2.c
#	$(CC) -o $@ $(CFLAGS) ./bzlib/bzip2.c

#********************************************************************

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



