2 # Copyright (C) 2002, 2014 Glenn Randers-Pehrson
3 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
5 # This code is released under the libpng license.
6 # For conditions of distribution and use, see the disclaimer
9 # Modified for LC56/ATARI assumes libz.lib is in same dir and uses default
10 # rules for library management
15 LDFLAGS = -L. -L..\zlib -lpng -lz -lm
17 # where make install puts libpng.a and png.h
19 INCPATH=$(prefix)/include
22 # override DESTDIR= on the make install command line to easily support
23 # installing into a temporary location. Example:
25 # make install DESTDIR=/tmp/build/libpng
27 # If you're going to install into a temporary location
28 # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
29 # you execute make install.
32 OBJS = $(LBR)(png.o) $(LBR)(pngset.o) $(LBR)(pngget.o) $(LBR)(pngrutil.o)\
33 $(LBR)(pngtrans.o) $(LBR)(pngwutil.o)\
34 $(LBR)(pngread.o) $(LBR)(pngerror.o) $(LBR)(pngwrite.o)\
35 $(LBR)(pngrtran.o) $(LBR)(pngwtran.o)\
36 $(LBR)(pngmem.o) $(LBR)(pngrio.o) $(LBR)(pngwio.o) $(LBR)(pngpread.o)
38 all: $(LBR) pngtest.ttp
41 $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
45 $(OBJS): pngpriv.h png.h pngconf.h pnglibconf.h pnginfo.h pngstruct.h pngdebug.h
47 pnglibconf.h: scripts/pnglibconf.h.prebuilt
48 cp scripts/pnglibconf.h.prebuilt pnglibconf.h
50 pngtest.ttp: pngtest.o $(LBR)
51 $(CC) $(CFLAGS) $(LDFLAGS) -o$@ pngtest.o
54 -@mkdir $(DESTDIR)$(INCPATH)
55 -@mkdir $(DESTDIR)$(INCPATH)/libpng
56 -@mkdir $(DESTDIR)$(LIBPATH)
57 -@rm -f $(DESTDIR)$(INCPATH)/png.h
58 -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
59 -@rm -f $(DESTDIR)$(INCPATH)/pnglibconf.h
60 cp png.h $(DESTDIR)$(INCPATH)/libpng
61 cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
62 cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
63 chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
64 chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
65 chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
66 (cd $(DESTDIR)$(INCPATH); ln -f -s $(LIBNAME) libpng; \
67 ln -f -s $(LIBNAME)/* .)