1# makefile for libpng
2# Copyright (C) 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
5
6# where make install puts libpng.a and png.h
7prefix=/usr/local
8INCPATH=$(prefix)/include
9LIBPATH=$(prefix)/lib
10
11# override DESTDIR= on the make install command line to easily support
12# installing into a temporary location.  Example:
13#
14#    make install DESTDIR=/tmp/build/libpng
15#
16# If you're going to install into a temporary location
17# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
18# you execute make install.
19DESTDIR=
20
21CC=cc
22CFLAGS=-I../zlib -O -systype sysv -DSYSV -w -Dmips
23#CFLAGS=-O
24LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
25
26#RANLIB=ranlib
27RANLIB=echo
28
29OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
30	pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
31	pngwtran.o pngmem.o pngerror.o pngpread.o
32
33all: libpng.a pngtest
34
35libpng.a: $(OBJS)
36	ar rc $@  $(OBJS)
37	$(RANLIB) $@
38
39pngtest: pngtest.o libpng.a
40	$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
41
42test: pngtest
43	./pngtest
44
45install: libpng.a
46	-@mkdir $(DESTDIR)$(INCPATH)
47	-@mkdir $(DESTDIR)$(INCPATH)/libpng
48	-@mkdir $(DESTDIR)$(LIBPATH)
49	-@rm -f $(DESTDIR)$(INCPATH)/png.h
50	-@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
51	cp png.h $(DESTDIR)$(INCPATH)/libpng
52	cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
53	chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
54	chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
55	(cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
56	cp libpng.a $(DESTDIR)$(LIBPATH)
57	chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
58
59clean:
60	rm -f *.o libpng.a pngtest pngout.png
61
62DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
63writelock:
64	chmod a-w *.[ch35] $(DOCS) scripts/*
65
66# DO NOT DELETE THIS LINE -- make depend depends on it.
67
68png.o: png.h pngconf.h
69pngerror.o: png.h pngconf.h
70pngrio.o: png.h pngconf.h
71pngwio.o: png.h pngconf.h
72pngmem.o: png.h pngconf.h
73pngset.o: png.h pngconf.h
74pngget.o: png.h pngconf.h
75pngread.o: png.h pngconf.h
76pngpread.o: png.h pngconf.h
77pngrtran.o: png.h pngconf.h
78pngrutil.o: png.h pngconf.h
79pngtest.o: png.h pngconf.h
80pngtrans.o: png.h pngconf.h
81pngwrite.o: png.h pngconf.h
82pngwtran.o: png.h pngconf.h
83pngwutil.o: png.h pngconf.h
84