1 # makefile for libpng, HPUX (10.20 and 11.00)
2 # Copyright (C) 1999-2002 Glenn Randers-Pehrson
3 # Copyright (C) 1995 Guy Eric Schalnat, Group 42
4 # contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
5 # For conditions of distribution and use, see copyright notice in png.h
7 # Where the zlib library and include files are located
9 ZLIBINC=/opt/zlib/include
12 CFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
13 # Caution: be sure you have built zlib with the same CFLAGS.
14 CCFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
15 LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
21 PNGVER = $(PNGMAJ).$(PNGMIN)
24 # where make install puts libpng.a, libpng12.sl, and png.h
26 INCPATH=$(prefix)/include
31 # override DESTDIR= on the make install command line to easily support
32 # installing into a temporary location. Example:
34 # make install DESTDIR=/tmp/build/libpng
36 # If you're going to install into a temporary location
37 # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
38 # you execute make install.
41 DB=$(DESTDIR)$(BINPATH)
42 DI=$(DESTDIR)$(INCPATH)
43 DL=$(DESTDIR)$(LIBPATH)
44 DM=$(DESTDIR)$(MANPATH)
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 OBJSDLL = $(OBJS:.o=.pic.o)
52 .SUFFIXES: .c .o .pic.o
55 $(CC) -c $(CFLAGS) +z -o $@ $*.c
57 all: libpng.a $(LIBNAME).sl pngtest libpng.pc libpng-config
64 cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
67 ( cat scripts/libpng-config-head.in; \
68 echo prefix=\"$(prefix)\"; \
69 echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
70 echo cflags=\"-Ae +DA1.1 +DS2.0"; \
71 echo ldflags=\"-L$(LIBPATH)\"; \
72 echo libs=\"-lpng12 -lz -lm\"; \
73 cat scripts/libpng-config-body.in ) > libpng-config
74 chmod +x libpng-config
76 $(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ)
77 ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl
79 $(LIBNAME).sl.$(PNGMAJ): $(LIBNAME).sl.$(PNGVER)
80 ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ)
82 $(LIBNAME).sl.$(PNGVER): $(OBJSDLL)
83 $(LD) -b -L$(ZLIBLIB) +s +b $(ZLIBLIB) \
84 +h $(LIBNAME).sl.$(PNGMAJ) -o $(LIBNAME).sl.$(PNGVER) \
87 pngtest: pngtest.o libpng.a
88 $(CC) -o pngtest $(CCFLAGS) pngtest.o $(LDFLAGS)
93 install-headers: png.h pngconf.h
94 -@if [ ! -d $(DI) ]; then mkdir $(DI); fi
95 -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
96 cp png.h pngconf.h $(DI)/$(LIBNAME)
97 chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
98 -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
99 -@/bin/rm -f $(DI)/libpng
100 (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
102 install-static: install-headers libpng.a
103 -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
104 cp libpng.a $(DL)/$(LIBNAME).a
105 chmod 644 $(DL)/$(LIBNAME).a
106 -@/bin/rm -f $(DL)/libpng.a
107 (cd $(DL); ln -sf $(LIBNAME).a libpng.a)
109 install-shared: install-headers $(LIBNAME).sl.$(PNGVER) libpng.pc
110 -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
111 -@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGMAJ)* $(DL)/$(LIBNAME).sl
112 -@/bin/rm -f $(DL)/libpng.sl
113 -@/bin/rm -f $(DL)/libpng.sl.3
114 -@/bin/rm -f $(DL)/libpng.sl.3.*
115 cp $(LIBNAME).sl.$(PNGVER) $(DL)
116 chmod 755 $(DL)/$(LIBNAME).sl.$(PNGVER)
118 ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl; \
119 ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3; \
120 ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3.$(PNGMIN); \
121 ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
122 ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
123 -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
124 -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
125 -@/bin/rm -f $(DL)/pkgconfig/libpng.pc
126 cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
127 chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
128 (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
130 install-man: libpng.3 libpngpf.3 png.5
131 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi
132 -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
133 -@/bin/rm -f $(DM)/man3/libpng.3
134 -@/bin/rm -f $(DM)/man3/libpngpf.3
135 cp libpng.3 $(DM)/man3
136 cp libpngpf.3 $(DM)/man3
137 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
138 -@/bin/rm -f $(DM)/man5/png.5
141 install-config: libpng-config
142 -@if [ ! -d $(DB) ]; then mkdir $(DB); fi
143 -@/bin/rm -f $(DB)/libpng-config
144 -@/bin/rm -f $(DB)/$(LIBNAME)-config
145 cp libpng-config $(DB)/$(LIBNAME)-config
146 chmod 755 $(DB)/$(LIBNAME)-config
147 (cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
149 install: install-static install-shared install-man install-config
151 # If you installed in $(DESTDIR), test-installed won't work until you
152 # move the library to its final location.
156 echo Testing installed dynamic shared library.
158 `$(BINPATH)/libpng12-config --cppflags --cflags` pngtest.c \
160 -o pngtesti `$(BINPATH)/libpng12-config --ldflags --libs`
161 ./pngtesti pngtest.png
164 /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png libpng.pc \
165 libpng-config $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)*
167 DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
169 chmod a-w *.[ch35] $(DOCS) scripts/*
171 # DO NOT DELETE THIS LINE -- make depend depends on it.
173 png.o: png.h pngconf.h
174 pngerror.o: png.h pngconf.h
175 pngrio.o: png.h pngconf.h
176 pngwio.o: png.h pngconf.h
177 pngmem.o: png.h pngconf.h
178 pngset.o: png.h pngconf.h
179 pngget.o: png.h pngconf.h
180 pngread.o: png.h pngconf.h
181 pngrtran.o: png.h pngconf.h
182 pngrutil.o: png.h pngconf.h
183 pngtest.o: png.h pngconf.h
184 pngtrans.o: png.h pngconf.h
185 pngwrite.o: png.h pngconf.h
186 pngwtran.o: png.h pngconf.h
187 pngwutil.o: png.h pngconf.h
188 pngpread.o: png.h pngconf.h