beta-0.89.2
[luatex.git] / source / libs / libpng / libpng-src / scripts / makefile.knr
blobd8de064c4df9838e5a5532206abf65e1f1b1b540
1 # makefile for libpng
2 # Copyright (C) 2002, 2006, 2009, 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
7 # and license in png.h
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
15 prefix=/usr/local
16 INCPATH=$(prefix)/include
17 LIBPATH=$(prefix)/lib
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.
27 DESTDIR=
29 CC = cc
30 CPPFLAGS = -I../zlib
31 CFLAGS = -O
32 LDFLAGS = -L. -L../zlib/ -lpng -lz -lm
33 # flags for ansi2knr
34 ANSI2KNRFLAGS=
36 RANLIB = ranlib
37 #RANLIB = echo
39 CP = cp
40 RM_F = rm -f
42 # Pre-built configuration
43 # See scripts/pnglibconf.mak for more options
44 PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
46 OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
47         pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
48         pngwtran.o pngmem.o pngerror.o pngpread.o
50 all: ansi2knr libpng.a pngtest
52 pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
53         $(CP) $(PNGLIBCONF_H_PREBUILT) $@
55 # general rule to allow ansi2knr to work
56 .c.o:
57         ./ansi2knr $*.c T$*.c
58         $(CC) $(CPPFLAGS) $(CFLAGS) -c T$*.c
59         rm -f T$*.c $*.o
60         mv T$*.o $*.o
62 ansi2knr: ansi2knr.c
63         $(CC) $(CPPFLAGS) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
65 libpng.a: ansi2knr $(OBJS)
66         ar rc $@  $(OBJS)
67         $(RANLIB) $@
69 pngtest: pngtest.o libpng.a
70         $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
72 test: pngtest
73         ./pngtest
75 install: libpng.a png.h pngconf.h pnglibconf.h
76         -@mkdir $(DESTDIR)$(INCPATH)
77         -@mkdir $(DESTDIR)$(INCPATH)/libpng
78         -@mkdir $(DESTDIR)$(LIBPATH)
79         -@rm -f $(DESTDIR)$(INCPATH)/png.h
80         -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
81         cp png.h $(DESTDIR)$(INCPATH)/libpng
82         cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
83         cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
84         chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
85         chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
86         chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
87         (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
88         cp libpng.a $(DESTDIR)$(LIBPATH)
89         chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
91 clean:
92         $(RM_F) *.o libpng.a pngtest pngout.png ansi2knr pnglibconf.h
94 DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
95 writelock:
96         chmod a-w *.[ch35] $(DOCS) scripts/*
98 # DO NOT DELETE THIS LINE -- make depend depends on it.
100 png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
101 pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
102 pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
103 pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
104 pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
105 pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
106 pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
107 pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
108 pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
109 pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
110 pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
111 pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
112 pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
113 pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
114 pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
116 pngtest.o: png.h pngconf.h pnglibconf.h