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) -lpng12 -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: $(LIBNAME)$(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)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
75 -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
76 -@rm -f $(DI)/$(LIBNAME)/png.h
77 -@rm -f $(DI)/$(LIBNAME)/pngconf.h
79 -@rm -f $(DI)/pngconf.h
80 cp png.h pngconf.h $(DI)/$(LIBNAME)
81 chmod 644 $(DI)/$(LIBNAME)/png.h \
82 $(DI)/$(LIBNAME)/pngconf.h
84 (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .)
85 -@rm -f $(DL)/$(LIBNAME)$(A)
86 -@rm -f $(DL)/libpng$(A)
87 cp $(LIBNAME)$(A) $(DL)/$(LIBNAME)$(A)
88 chmod 644 $(DL)/$(LIBNAME)$(A)
89 (cd $(DL); ln -f -s $(LIBNAME)$(A) libpng$(A))
90 (cd $(DI); ln -f -s libpng/* .;)
93 /bin/rm -f *.o $(LIBNAME)$(A) pngtest pngout.png
95 png$(O): png.h pngconf.h
96 pngerror$(O): png.h pngconf.h
97 pngget$(O): png.h pngconf.h
98 pngmem$(O): png.h pngconf.h
99 pngpread$(O): png.h pngconf.h
100 pngread$(O): png.h pngconf.h
101 pngrio$(O): png.h pngconf.h
102 pngrtran$(O): png.h pngconf.h
103 pngrutil$(O): png.h pngconf.h
104 pngset$(O): png.h pngconf.h
105 pngtest$(O): png.h pngconf.h
106 pngtrans$(O): png.h pngconf.h
107 pngwio$(O): png.h pngconf.h
108 pngwrite$(O): png.h pngconf.h
109 pngwtran$(O): png.h pngconf.h
110 pngwutil$(O): png.h pngconf.h