fukasawa e60969
# makefile for libpng
fukasawa e60969
# Copyright (C) 2002, 2014 Glenn Randers-Pehrson
fukasawa e60969
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
fukasawa e60969
#
fukasawa e60969
# This code is released under the libpng license.
fukasawa e60969
# For conditions of distribution and use, see the disclaimer
fukasawa e60969
# and license in png.h
fukasawa e60969
#
fukasawa e60969
# Modified for LC56/ATARI assumes libz.lib is in same dir and uses default
fukasawa e60969
# rules for library management
fukasawa e60969
#
fukasawa e60969
CPPFLAGS = -I..\zlib
fukasawa e60969
CFLAGS = -O
fukasawa e60969
LBR = png.lib
fukasawa e60969
LDFLAGS = -L. -L..\zlib -lpng -lz -lm
fukasawa e60969
fukasawa e60969
# where make install puts libpng.a and png.h
fukasawa e60969
prefix=/usr/local
fukasawa e60969
INCPATH=$(prefix)/include
fukasawa e60969
LIBPATH=$(prefix)/lib
fukasawa e60969
fukasawa e60969
# override DESTDIR= on the make install command line to easily support
fukasawa e60969
# installing into a temporary location.  Example:
fukasawa e60969
#
fukasawa e60969
#    make install DESTDIR=/tmp/build/libpng
fukasawa e60969
#
fukasawa e60969
# If you're going to install into a temporary location
fukasawa e60969
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
fukasawa e60969
# you execute make install.
fukasawa e60969
DESTDIR=
fukasawa e60969
fukasawa e60969
# Pre-built configuration
fukasawa e60969
# See scripts/pnglibconf.mak for more options
fukasawa e60969
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
fukasawa e60969
fukasawa e60969
OBJS = $(LBR)(png.o) $(LBR)(pngset.o) $(LBR)(pngget.o) $(LBR)(pngrutil.o)\
fukasawa e60969
	$(LBR)(pngtrans.o) $(LBR)(pngwutil.o)\
fukasawa e60969
	$(LBR)(pngread.o) $(LBR)(pngerror.o) $(LBR)(pngwrite.o)\
fukasawa e60969
	$(LBR)(pngrtran.o) $(LBR)(pngwtran.o)\
fukasawa e60969
	$(LBR)(pngmem.o) $(LBR)(pngrio.o) $(LBR)(pngwio.o) $(LBR)(pngpread.o)
fukasawa e60969
fukasawa e60969
all: $(LBR) pngtest.ttp
fukasawa e60969
fukasawa e60969
.c.o:
fukasawa e60969
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
fukasawa e60969
fukasawa e60969
$(LBR): $(OBJS)
fukasawa e60969
fukasawa e60969
$(OBJS): pngpriv.h png.h pngconf.h pnglibconf.h pnginfo.h pngstruct.h pngdebug.h
fukasawa e60969
fukasawa e60969
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
fukasawa e60969
	cp $(PNGLIBCONF_H_PREBUILT) $@
fukasawa e60969
fukasawa e60969
pngtest.ttp: pngtest.o $(LBR)
fukasawa e60969
	$(CC) $(CFLAGS) $(LDFLAGS) -o$@ pngtest.o
fukasawa e60969
fukasawa e60969
install: libpng.a
fukasawa e60969
	-@mkdir $(DESTDIR)$(INCPATH)
fukasawa e60969
	-@mkdir $(DESTDIR)$(INCPATH)/libpng
fukasawa e60969
	-@mkdir $(DESTDIR)$(LIBPATH)
fukasawa e60969
	-@rm -f $(DESTDIR)$(INCPATH)/png.h
fukasawa e60969
	-@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
fukasawa e60969
	-@rm -f $(DESTDIR)$(INCPATH)/pnglibconf.h
fukasawa e60969
	cp png.h $(DESTDIR)$(INCPATH)/libpng
fukasawa e60969
	cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
fukasawa e60969
	cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
fukasawa e60969
	chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
fukasawa e60969
	chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
fukasawa e60969
	chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
fukasawa e60969
	(cd $(DESTDIR)$(INCPATH); ln -f -s $(LIBNAME) libpng; \
fukasawa e60969
	ln -f -s $(LIBNAME)/* .)