makefile.std 2.3 KB
Newer Older
G
Guy Schalnat 已提交
1
# makefile for libpng
2
# Copyright (C) 2002 Glenn Randers-Pehrson
G
Guy Schalnat 已提交
3 4 5
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# For conditions of distribution and use, see copyright notice in png.h

6 7
# where make install puts libpng.a and png.h
prefix=/usr/local
8 9 10 11 12 13 14 15 16 17 18 19
INCPATH=$(prefix)/include
LIBPATH=$(prefix)/lib

# override DESTDIR= on the make install command line to easily support
# installing into a temporary location.  Example:
#
#    make install DESTDIR=/tmp/build/libpng
#
# If you're going to install into a temporary location
# via DESTDIR, that location must already exist before
# you execute make install.
DESTDIR=
20

A
Andreas Dilger 已提交
21 22 23 24 25 26
# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include
ZLIBLIB=../zlib
ZLIBINC=../zlib

G
Guy Schalnat 已提交
27
CC=cc
28
CFLAGS=-I$(ZLIBINC) -O # -g -DPNG_DEBUG=5
A
Andreas Dilger 已提交
29
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
G
Guy Schalnat 已提交
30

A
Andreas Dilger 已提交
31 32
#RANLIB=echo
RANLIB=ranlib
G
Guy Schalnat 已提交
33

A
Andreas Dilger 已提交
34
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
G
Guy Schalnat 已提交
35 36
	pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
	pngwtran.o pngmem.o pngerror.o pngpread.o
G
Guy Schalnat 已提交
37 38 39 40 41 42 43 44

all: libpng.a pngtest

libpng.a: $(OBJS)
	ar rc $@  $(OBJS)
	$(RANLIB) $@

pngtest: pngtest.o libpng.a
45
	$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
G
Guy Schalnat 已提交
46 47 48

test: pngtest
	./pngtest
G
Guy Schalnat 已提交
49 50

install: libpng.a
51 52 53 54 55 56 57 58 59 60 61 62
	-@mkdir $(DESTDIR)$(INCPATH)
	-@mkdir $(DESTDIR)$(INCPATH)/libpng
	-@mkdir $(DESTDIR)$(LIBPATH)
	-@rm -f $(DESTDIR)$(INCPATH)/png.h
	-@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
	cp png.h $(DESTDIR)$(INCPATH)/libpng
	cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
	chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
	chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
	(cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
	cp libpng.a $(DESTDIR)$(LIBPATH)
	chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
G
Guy Schalnat 已提交
63 64 65 66

clean:
	rm -f *.o libpng.a pngtest pngout.png

67 68 69 70
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
writelock:
	chmod a-w *.[ch35] $(DOCS) scripts/*

G
Guy Schalnat 已提交
71 72
# DO NOT DELETE THIS LINE -- make depend depends on it.

G
Guy Schalnat 已提交
73
png.o: png.h pngconf.h
G
Guy Schalnat 已提交
74
pngerror.o: png.h pngconf.h
G
Guy Schalnat 已提交
75 76
pngrio.o: png.h pngconf.h
pngwio.o: png.h pngconf.h
G
Guy Schalnat 已提交
77
pngmem.o: png.h pngconf.h
A
Andreas Dilger 已提交
78 79
pngset.o: png.h pngconf.h
pngget.o: png.h pngconf.h
G
Guy Schalnat 已提交
80 81 82 83 84 85 86 87
pngread.o: png.h pngconf.h
pngrtran.o: png.h pngconf.h
pngrutil.o: png.h pngconf.h
pngtest.o: png.h pngconf.h
pngtrans.o: png.h pngconf.h
pngwrite.o: png.h pngconf.h
pngwtran.o: png.h pngconf.h
pngwutil.o: png.h pngconf.h
G
Guy Schalnat 已提交
88
pngpread.o: png.h pngconf.h
G
Guy Schalnat 已提交
89