2 # Copyright (C) 2002 Glenn Randers-Pehrson
3 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
4 # For conditions of distribution and use, see copyright notice in png.h
6 # This makefile requires the file ansi2knr.c, which you can get
7 # from the Ghostscript ftp site at ftp://ftp.cs.wisc.edu/ghost/
8 # If you have libjpeg, you probably already have ansi2knr.c in the jpeg
11 # where make install puts libpng.a and png.h
13 INCPATH=$(prefix)/include
16 # override DESTDIR= on the make install command line to easily support
17 # installing into a temporary location. Example:
19 # make install DESTDIR=/tmp/build/libpng
21 # If you're going to install into a temporary location
22 # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
23 # you execute make install.
28 LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
35 OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
36 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
37 pngwtran.o pngmem.o pngerror.o pngpread.o
39 all: ansi2knr libpng.a pngtest
41 # general rule to allow ansi2knr to work
44 $(CC) $(CFLAGS) -c T$*.c
49 $(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
51 libpng.a: ansi2knr $(OBJS)
55 pngtest: pngtest.o libpng.a
56 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
62 -@mkdir $(DESTDIR)$(INCPATH)
63 -@mkdir $(DESTDIR)$(INCPATH)/libpng
64 -@mkdir $(DESTDIR)$(LIBPATH)
65 -@rm -f $(DESTDIR)$(INCPATH)/png.h
66 -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
67 cp png.h $(DESTDIR)$(INCPATH)/libpng
68 cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
69 chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
70 chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
71 (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
72 cp libpng.a $(DESTDIR)$(LIBPATH)
73 chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
76 rm -f *.o libpng.a pngtest pngout.png ansi2knr
78 DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
80 chmod a-w *.[ch35] $(DOCS) scripts/*
82 # DO NOT DELETE THIS LINE -- make depend depends on it.
84 png.o: png.h pngconf.h
85 pngerror.o: png.h pngconf.h
86 pngrio.o: png.h pngconf.h
87 pngwio.o: png.h pngconf.h
88 pngmem.o: png.h pngconf.h
89 pngset.o: png.h pngconf.h
90 pngget.o: png.h pngconf.h
91 pngread.o: png.h pngconf.h
92 pngpread.o: png.h pngconf.h
93 pngrtran.o: png.h pngconf.h
94 pngrutil.o: png.h pngconf.h
95 pngtest.o: png.h pngconf.h
96 pngtrans.o: png.h pngconf.h
97 pngwrite.o: png.h pngconf.h
98 pngwtran.o: png.h pngconf.h
99 pngwutil.o: png.h pngconf.h