2 # Copyright (C) 2002, 2006, 2009 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 # This makefile requires the file ansi2knr.c, which you can get
10 # from the Ghostscript ftp site at ftp://ftp.cs.wisc.edu/ghost/
11 # If you have libjpeg, you probably already have ansi2knr.c in the jpeg
12 # source distribution.
14 # where make install puts libpng.a and png.h
16 INCPATH=$(prefix)/include
19 # override DESTDIR= on the make install command line to easily support
20 # installing into a temporary location. Example:
22 # make install DESTDIR=/tmp/build/libpng
24 # If you're going to install into a temporary location
25 # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
26 # you execute make install.
31 LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
38 OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
39 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
40 pngwtran.o pngmem.o pngerror.o pngpread.o
42 all: ansi2knr libpng.a pngtest
44 # general rule to allow ansi2knr to work
47 $(CC) $(CFLAGS) -c T$*.c
52 $(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
54 libpng.a: ansi2knr $(OBJS)
58 pngtest: pngtest.o libpng.a
59 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
64 install: libpng.a png.h pngconf.h
65 -@mkdir $(DESTDIR)$(INCPATH)
66 -@mkdir $(DESTDIR)$(INCPATH)/libpng
67 -@mkdir $(DESTDIR)$(LIBPATH)
68 -@rm -f $(DESTDIR)$(INCPATH)/png.h
69 -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
70 cp png.h $(DESTDIR)$(INCPATH)/libpng
71 cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
72 chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
73 chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
74 (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
75 cp libpng.a $(DESTDIR)$(LIBPATH)
76 chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
79 rm -f *.o libpng.a pngtest pngout.png ansi2knr
81 DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
83 chmod a-w *.[ch35] $(DOCS) scripts/*
85 # DO NOT DELETE THIS LINE -- make depend depends on it.
87 png.o: png.h pngconf.h pngpriv.h
88 pngerror.o: png.h pngconf.h pngpriv.h
89 pngrio.o: png.h pngconf.h pngpriv.h
90 pngwio.o: png.h pngconf.h pngpriv.h
91 pngmem.o: png.h pngconf.h pngpriv.h
92 pngset.o: png.h pngconf.h pngpriv.h
93 pngget.o: png.h pngconf.h pngpriv.h
94 pngread.o: png.h pngconf.h pngpriv.h
95 pngpread.o: png.h pngconf.h pngpriv.h
96 pngrtran.o: png.h pngconf.h pngpriv.h
97 pngrutil.o: png.h pngconf.h pngpriv.h
98 pngtrans.o: png.h pngconf.h pngpriv.h
99 pngwrite.o: png.h pngconf.h pngpriv.h
100 pngwtran.o: png.h pngconf.h pngpriv.h
101 pngwutil.o: png.h pngconf.h pngpriv.h
103 pngtest.o: png.h pngconf.h