1 # makefile for libpng using gcc (generic, static library)
2 # Copyright (C) 2002 Glenn Randers-Pehrson
3 # Copyright (C) 2000 Cosmin Truta
4 # Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc)
5 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
6 # For conditions of distribution and use, see copyright notice in png.h
8 # Location of the zlib library and include files
12 # Compiler, linker, lib and other tools
22 PNGVER = $(PNGMAJ).$(PNGMIN)
25 INCPATH=$(prefix)/include
28 # override DESTDIR= on the make install command line to easily support
29 # installing into a temporary location. Example:
31 # make install DESTDIR=/tmp/build/libpng
33 # If you're going to install into a temporary location
34 # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
35 # you execute make install.
38 DI=$(DESTDIR)/$(INCPATH)
39 DL=$(DESTDIR)/$(LIBPATH)
41 CDEBUG = -g -DPNG_DEBUG=5
46 CFLAGS = -I$(ZLIBINC) $(WARNMORE) $(CRELEASE)
47 LDFLAGS = -L. -L$(ZLIBLIB) -lpng -lz -lm $(LDRELEASE)
55 OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \
56 pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \
57 pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
60 all: libpng$(A) pngtest$(E)
62 $(LIBNAME)$(A): $(OBJS)
69 pngtest$(E): pngtest$(O) $(LIBNAME)$(A)
70 $(LD) -o $@ pngtest$(O) $(LDFLAGS)
72 install: $(LIBNAME)$(A)
73 -@if [ ! -d $(DI) ]; then mkdir $(DI); fi
74 -@if [ ! -d $(DI)/libpng ]; then mkdir $(DI)/libpng; fi
75 -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
78 cp png.h pngconf.h $(DI)/libpng
79 chmod 644 $(DI)/libpng/png.h \
80 cp $(LIBNAME)$(A) $(DL)
81 (cd $(DL); ln -f -s $(LIBNAME)$(A) libpng$(A))
82 $(DI)/libpng/pngconf.h
83 (cd $(DI); ln -f -s libpng/* .;)
86 /bin/rm -f *.o $(LIBNAME)$(A) pngtest pngout.png
88 png$(O): png.h pngconf.h
89 pngerror$(O): png.h pngconf.h
90 pngget$(O): png.h pngconf.h
91 pngmem$(O): png.h pngconf.h
92 pngpread$(O): png.h pngconf.h
93 pngread$(O): png.h pngconf.h
94 pngrio$(O): png.h pngconf.h
95 pngrtran$(O): png.h pngconf.h
96 pngrutil$(O): png.h pngconf.h
97 pngset$(O): png.h pngconf.h
98 pngtest$(O): png.h pngconf.h
99 pngtrans$(O): png.h pngconf.h
100 pngwio$(O): png.h pngconf.h
101 pngwrite$(O): png.h pngconf.h
102 pngwtran$(O): png.h pngconf.h
103 pngwutil$(O): png.h pngconf.h