# Makefile for libpng
# Borland C++   

# This version of the libpng makefile was adapted by Chris Young for use
# with Borland C 4.5x with the Dos Power Pack for a 32-bit protected mode
# flat memory model.  It was created for use with POV-Ray ray tracer and
# you may choose to edit the CFLAGS to suit your needs but the
# switches -WX and -DMSDOS are required.
# -- Chris Young 76702.1655@compuserve.com

# To use, do "make -fmakefile.b32"

# ------------- Borland C++ -------------
MODEL=-WX 
CFLAGS= $(MODEL) -c -P-C -K -N- -k- -d -3 -r- -v- -f -DMSDOS -I..\zlib
CC=bcc32
LD=bcc32
LIB=tlib
LDFLAGS=$(MODEL)
O=obj

# variables
OBJS = \
 png.$(O) \
 pngerror.$(O) \
 pngmem.$(O) \
 pngpread.$(O) \
 pngset.$(O) \
 pngget.$(O) \
 pngread.$(O) \
 pngrio.$(O) \
 pngrtran.$(O) \
 pngrutil.$(O) \
 pngtrans.$(O) \
 pngwrite.$(O) \
 pngwtran.$(O) \
 pngwio.$(O) \
 pngwutil.$(O)

LIBOBJ1 = \
 +png.$(O) \
 +pngerror.$(O) \
 +pngmem.$(O) \
 +pngpread.$(O) \
 +pngread.$(O) \
 +pngset.$(O) \
 +pngget.$(O) \
 +pngrio.$(O) \
 +pngrtran.$(O) 

LIBOBJ2 = \
 +pngrutil.$(O) \
 +pngtrans.$(O) \
 +pngwrite.$(O) \
 +pngwtran.$(O) \
 +pngwio.$(O) \
 +pngwutil.$(O)


all: libpng.lib pngtest.exe test

png$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngerror$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngmem$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngpread$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngget$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngset$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngread$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngrio$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngrtran$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngrutil$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngtrans$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngwrite$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngwtran$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngwio$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngwutil$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

pngtest$(O): png.h pngconf.h
        $(CC) -c $(CFLAGS) $*.c

libpng.lib: $(OBJS)
        $(LIB) libpng +$(LIBOBJ1)
        $(LIB) libpng +$(LIBOBJ2)

pngtest.exe: pngtest.obj libpng.lib 
        $(LD) $(LDFLAGS) pngtest.obj libpng.lib ..\zlib\zlib.lib

test: pngtest.exe
        .\pngtest

# End of makefile for libpng
