# This is a simple makefile to compile the source code of libpng.
# Written by Pawel Pilarczyk on February 13, 2008.

files = png pngerror pnggccrd pngget pngmem pngpread pngread pngrio \
	pngrtran pngrutil pngset pngtrans pngvcrd pngwio pngwrite \
	pngwtran pngwutil
libname = libpng

libdir = ../lib
incdirs = ../include
objects = $(files:%=%.o)
compile = g++ -ansi -pedantic -Wall -frounding-math -O2 -c $(incdirs:%=-I%)

$(libdir)/$(libname).a: $(objects)
	ar cru $(libdir)/$(libname).a $(objects)
	ranlib $(libdir)/$(libname).a

$(objects): %.o: %.c
	$(compile) $< -o $@

