# makefile for libpng
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# For conditions of distribution and use, see copyright notice in png.h

# Modified for Atari TOS and GNU gcc 2.5.8 by Chris Herborth (chrish@qnx.com)

CC=gcc
CFLAGS=-I../zlib -O -Wall
#CFLAGS=-I../zlib -O2 -Wall
LDFLAGS=-L. -L../zlib -lpng -lgz -lpml

# where make install puts png.olb and png.h
prefix=/usr/local

OBJS = png.o pngrcb.o pngrutil.o pngtrans.o pngwutil.o \
	pngread.o pngstub.o pngwrite.o pngrtran.o pngwtran.o

all: png.olb pngtest.ttp

png.olb: $(OBJS)
	-rm -f $@
	ar qs $@  $(OBJS)

pngtest.ttp: pngtest.o png.olb
	$(CC) -o pngtest.ttp $(CFLAGS) pngtest.o $(LDFLAGS)

install: png.olb
	-@mkdir $(prefix)/include
	-@mkdir $(prefix)/lib
	cp png.h $(prefix)/include
	chmod 644 $(prefix)/include/png.h
	cp png.olb $(prefix)/lib
	chmod 644 $(prefix)/lib/png.olb

clean:
	rm -f *.o png.olb pngtest pngout.png

# DO NOT DELETE THIS LINE -- make depend depends on it.

example.o: png.h
pngrcb.o: png.h
pngread.o: png.h
pngrtran.o: png.h
pngrutil.o: png.h
pngstub.o: png.h
pngtest.o: png.h
pngtrans.o: png.h
pngwrite.o: png.h
pngwtran.o: png.h
pngwutil.o: png.h
