Glenn Randers-Pehrson | 9c0f094 | 2002-02-21 23:14:23 -0600 | [diff] [blame] | 1 | # makefile for libpng.a and libpng12.so, SGI IRIX with 'cc' |
| 2 | # Copyright (C) 2001-2002 Glenn Randers-Pehrson |
Glenn Randers-Pehrson | c4a2ae6 | 1998-01-16 22:06:18 -0600 | [diff] [blame] | 3 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
| 4 | # For conditions of distribution and use, see copyright notice in png.h |
| 5 | |
Glenn Randers-Pehrson | 9c0f094 | 2002-02-21 23:14:23 -0600 | [diff] [blame] | 6 | # where make install puts libpng.a, libpng12.so and libpng12/png.h |
Glenn Randers-Pehrson | 5c6aeb2 | 1998-12-29 11:47:59 -0600 | [diff] [blame] | 7 | prefix=/usr/local |
| 8 | |
Glenn Randers-Pehrson | c4a2ae6 | 1998-01-16 22:06:18 -0600 | [diff] [blame] | 9 | # Where the zlib library and include files are located |
Glenn Randers-Pehrson | be9de0f | 2001-01-22 08:52:16 -0600 | [diff] [blame] | 10 | #ZLIBLIB=/usr/local/lib32 |
| 11 | #ZLIBINC=/usr/local/include |
Glenn Randers-Pehrson | c4a2ae6 | 1998-01-16 22:06:18 -0600 | [diff] [blame] | 12 | #ZLIBLIB=/usr/local/lib |
| 13 | #ZLIBINC=/usr/local/include |
| 14 | ZLIBLIB=../zlib |
| 15 | ZLIBINC=../zlib |
| 16 | |
| 17 | CC=cc |
| 18 | |
Glenn Randers-Pehrson | b182893 | 2001-06-23 08:03:17 -0500 | [diff] [blame] | 19 | # ABI can be blank to use default for your system, -32, -o32, -n32, or -64 |
| 20 | # See "man abi". zlib must be built with the same ABI. |
| 21 | ABI= |
Glenn Randers-Pehrson | be9de0f | 2001-01-22 08:52:16 -0600 | [diff] [blame] | 22 | |
Glenn Randers-Pehrson | b182893 | 2001-06-23 08:03:17 -0500 | [diff] [blame] | 23 | WARNMORE=-fullwarn |
| 24 | # Note: -KPIC is the default anyhow |
| 25 | #CFLAGS= $(ABI) -I$(ZLIBINC) -O $(WARNMORE) -KPIC -DPNG_USE_PNGGCCRD # -g -DPNG_DEBUG=5 |
| 26 | CFLAGS=$(ABI) -I$(ZLIBINC) -O $(WARNMORE) -DPNG_USE_PNGGCCRD -DPNG_NO_ASSEMBLER_CODE |
Glenn Randers-Pehrson | 9c0f094 | 2002-02-21 23:14:23 -0600 | [diff] [blame] | 27 | LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng12 -lz -lm |
Glenn Randers-Pehrson | b182893 | 2001-06-23 08:03:17 -0500 | [diff] [blame] | 28 | LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm |
| 29 | LDSHARED=cc $(ABI) -shared |
| 30 | |
Glenn Randers-Pehrson | b182893 | 2001-06-23 08:03:17 -0500 | [diff] [blame] | 31 | # See "man dso" for info about shared objects |
Glenn Randers-Pehrson | c6de22d | 2002-02-23 18:55:25 -0600 | [diff] [blame] | 32 | LIBNAME=libpng12 |
| 33 | PNGMAJ = 0 |
Glenn Randers-Pehrson | 704228f | 2002-05-02 20:49:40 -0500 | [diff] [blame^] | 34 | PNGMIN = 1.2.3rc4 |
Glenn Randers-Pehrson | c6de22d | 2002-02-23 18:55:25 -0600 | [diff] [blame] | 35 | PNGVER = $(PNGMAJ).$(PNGMIN) |
Glenn Randers-Pehrson | c4a2ae6 | 1998-01-16 22:06:18 -0600 | [diff] [blame] | 36 | |
| 37 | RANLIB=echo |
| 38 | #RANLIB=ranlib |
| 39 | |
Glenn Randers-Pehrson | ae498dc | 2001-11-24 14:53:31 -0600 | [diff] [blame] | 40 | INCPATH=$(prefix)/include |
| 41 | LIBPATH=$(prefix)/lib |
| 42 | #LIBPATH=$(prefix)/lib32 |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 43 | MANPATH=$(prefix)/man |
Glenn Randers-Pehrson | 704228f | 2002-05-02 20:49:40 -0500 | [diff] [blame^] | 44 | BINPATH=$(prefix)/bin |
| 45 | BINPATH=$(prefix)/bin |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 46 | |
| 47 | # override DESTDIR= on the make install command line to easily support |
| 48 | # installing into a temporary location. Example: |
| 49 | # |
| 50 | # make install DESTDIR=/tmp/build/libpng |
| 51 | # |
| 52 | # If you're going to install into a temporary location |
| 53 | # via DESTDIR, that location must already exist before |
| 54 | # you execute make install. |
| 55 | DESTDIR= |
Glenn Randers-Pehrson | ae498dc | 2001-11-24 14:53:31 -0600 | [diff] [blame] | 56 | |
Glenn Randers-Pehrson | 1909560 | 2001-03-14 07:08:39 -0600 | [diff] [blame] | 57 | OBJS = pnggccrd.o png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ |
Glenn Randers-Pehrson | c4a2ae6 | 1998-01-16 22:06:18 -0600 | [diff] [blame] | 58 | pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ |
| 59 | pngwtran.o pngmem.o pngerror.o pngpread.o |
| 60 | |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 61 | all: libpng.a pngtest shared libpng.pc |
Glenn Randers-Pehrson | be9de0f | 2001-01-22 08:52:16 -0600 | [diff] [blame] | 62 | |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 63 | shared: $(LIBNAME).so.$(PNGVER) |
| 64 | |
| 65 | libpng.pc: |
| 66 | cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc |
Glenn Randers-Pehrson | c4a2ae6 | 1998-01-16 22:06:18 -0600 | [diff] [blame] | 67 | |
| 68 | libpng.a: $(OBJS) |
| 69 | ar rc $@ $(OBJS) |
| 70 | $(RANLIB) $@ |
| 71 | |
Glenn Randers-Pehrson | c6de22d | 2002-02-23 18:55:25 -0600 | [diff] [blame] | 72 | $(LIBNAME).so.$(PNGVER): $(OBJS) |
Glenn Randers-Pehrson | be9de0f | 2001-01-22 08:52:16 -0600 | [diff] [blame] | 73 | $(LDSHARED) -o $@ $(OBJS) |
Glenn Randers-Pehrson | c6de22d | 2002-02-23 18:55:25 -0600 | [diff] [blame] | 74 | rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ) |
Glenn Randers-Pehrson | 299d735 | 2002-05-01 16:55:46 -0500 | [diff] [blame] | 75 | ln -s -f $@ $(LIBNAME).so |
| 76 | ln -s -f $@ $(LIBNAME).so.$(PNGMAJ) |
Glenn Randers-Pehrson | be9de0f | 2001-01-22 08:52:16 -0600 | [diff] [blame] | 77 | |
Glenn Randers-Pehrson | c4a2ae6 | 1998-01-16 22:06:18 -0600 | [diff] [blame] | 78 | pngtest: pngtest.o libpng.a |
Glenn Randers-Pehrson | ea3bcd7 | 1998-03-07 14:33:00 -0600 | [diff] [blame] | 79 | $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
Glenn Randers-Pehrson | c4a2ae6 | 1998-01-16 22:06:18 -0600 | [diff] [blame] | 80 | |
| 81 | test: pngtest |
| 82 | ./pngtest |
| 83 | |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 84 | install-headers: png.h pngconf.h |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 85 | -@if [ ! -d $(DESTDIR)$(INCPATH) ]; then mkdir $(DESTDIR)$(INCPATH); fi |
| 86 | -@if [ ! -d $(DESTDIR)$(INCPATH)/$(LIBNAME) ]; then \ |
| 87 | mkdir $(DESTDIR)$(INCPATH)/$(LIBNAME); fi |
| 88 | cp png.h pngconf.h $(DESTDIR)$(INCPATH)/$(LIBNAME) |
| 89 | chmod 644 $(DESTDIR)$(INCPATH)/$(LIBNAME)/png.h \ |
| 90 | $(DESTDIR)$(INCPATH)/$(LIBNAME)/pngconf.h |
| 91 | -@/bin/rm -f $(DESTDIR)$(INCPATH)/png.h $(DESTDIR)$(INCPATH)/pngconf.h |
| 92 | -@/bin/rm -f $(DESTDIR)$(INCPATH)/libpng |
Glenn Randers-Pehrson | 299d735 | 2002-05-01 16:55:46 -0500 | [diff] [blame] | 93 | (cd $(DESTDIR)$(INCPATH); ln -sf $(LIBNAME) libpng; \ |
| 94 | ln -sf $(LIBNAME)/* .) |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 95 | |
| 96 | install-static: install-headers libpng.a |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 97 | -@if [ ! -d $(DESTDIR)$(LIBPATH) ]; then mkdir $(DESTDIR)$(LIBPATH); fi |
| 98 | cp libpng.a $(DESTDIR)$(LIBPATH)/$(LIBNAME).a |
| 99 | chmod 644 $(DESTDIR)$(LIBPATH)/$(LIBNAME).a |
| 100 | -@/bin/rm -f $(DESTDIR)$(LIBPATH)/libpng.a |
Glenn Randers-Pehrson | 299d735 | 2002-05-01 16:55:46 -0500 | [diff] [blame] | 101 | (cd $(DESTDIR)$(LIBPATH); ln -sf $(LIBNAME).a libpng.a) |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 102 | |
Glenn Randers-Pehrson | 25d8224 | 2002-05-01 11:51:26 -0500 | [diff] [blame] | 103 | install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 104 | -@if [ ! -d $(DESTDIR)$(LIBPATH) ]; then mkdir $(DESTDIR)$(LIBPATH); fi |
| 105 | -@/bin/rm -f $(DESTDIR)$(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* \ |
| 106 | $(DESTDIR)$(LIBPATH)/$(LIBNAME).so |
| 107 | -@/bin/rm -f $(DESTDIR)$(LIBPATH)/libpng.so |
| 108 | -@/bin/rm -f $(DESTDIR)$(LIBPATH)/libpng.so.3 |
| 109 | -@/bin/rm -f $(DESTDIR)$(LIBPATH)/libpng.so.3.* |
| 110 | cp $(LIBNAME).so.$(PNGVER) $(DESTDIR)$(LIBPATH) |
| 111 | chmod 755 $(DESTDIR)$(LIBPATH)/$(LIBNAME).so.$(PNGVER) |
| 112 | (cd $(DESTDIR)$(LIBPATH); \ |
Glenn Randers-Pehrson | 299d735 | 2002-05-01 16:55:46 -0500 | [diff] [blame] | 113 | ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \ |
| 114 | ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3; \ |
| 115 | ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \ |
| 116 | ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ |
| 117 | ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 118 | -@if [ ! -d $(DESTDIR)$(LIBPATH)/pkgconfig ]; then \ |
| 119 | mkdir $(DESTDIR)$(LIBPATH)/pkgconfig; fi |
Glenn Randers-Pehrson | 704228f | 2002-05-02 20:49:40 -0500 | [diff] [blame^] | 120 | -@/bin/rm -f $(DESTDIR)$(LIBPATH)/pkgconfig/libpng12.pc |
Glenn Randers-Pehrson | 299d735 | 2002-05-01 16:55:46 -0500 | [diff] [blame] | 121 | -@/bin/rm -f $(DESTDIR)$(LIBPATH)/pkgconfig/libpng.pc |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 122 | cp libpng.pc $(DESTDIR)$(LIBPATH)/pkgconfig/libpng12.pc |
| 123 | chmod 644 $(DESTDIR)$(LIBPATH)/pkgconfig/libpng12.pc |
Glenn Randers-Pehrson | 299d735 | 2002-05-01 16:55:46 -0500 | [diff] [blame] | 124 | (cd $(DESTDIR)$(LIBPATH)/pkgconfig; ln -sf libpng12.pc libpng.pc) |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 125 | |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 126 | install-man: libpng.3 libpngpf.3 png.5 |
Glenn Randers-Pehrson | 704228f | 2002-05-02 20:49:40 -0500 | [diff] [blame^] | 127 | -@if [ ! -d $(DESTDIR)$(MANPATH) ]; then mkdir $(DESTDIR)$(MANPATH); fi |
| 128 | -@if [ ! -d $(DESTDIR)$(MANPATH)/man3 ]; then \ |
| 129 | mkdir $(DESTDIR)$(MANPATH)/man3; fi |
| 130 | -@/bin/rm -f $(DESTDIR)$(MANPATH)/man3/libpng.3 |
| 131 | -@/bin/rm -f $(DESTDIR)$(MANPATH)/man3/libpngpf.3 |
| 132 | cp libpng.3 $(DESTDIR)$(MANPATH)/man3 |
| 133 | cp libpngpf.3 $(DESTDIR)$(MANPATH)/man3 |
| 134 | -@if [ ! -d $(DESTDIR)$(MANPATH)/man5 ]; then \ |
| 135 | mkdir $(DESTDIR)$(MANPATH)/man5; fi |
| 136 | -@/bin/rm -f $(DESTDIR)$(MANPATH)/man5/png.5 |
| 137 | cp png.5 $(DESTDIR)$(MANPATH)/man5 |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 138 | |
Glenn Randers-Pehrson | 704228f | 2002-05-02 20:49:40 -0500 | [diff] [blame^] | 139 | install-config: scripts/libpng-config |
| 140 | -@if [ ! -d $(DESTDIR)$(BINPATH) ]; then \ |
| 141 | mkdir $(DESTDIR)$(BINPATH); fi |
| 142 | -@/bin/rm -f $(DESTDIR)$(BINPATH)/libpng-config |
| 143 | -@/bin/rm -f $(DESTDIR)$(BINPATH)/libpng12-config |
| 144 | cp scripts/libpng-config $(DESTDIR)$(BINPATH)/libpng12-config |
| 145 | chmod 755 $(DESTDIR)$(BINPATH)/libpng12-config |
| 146 | (cd $(DESTDIR)$(BINPATH); ln -sf libpng12-config libpng-config) |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 147 | |
Glenn Randers-Pehrson | 704228f | 2002-05-02 20:49:40 -0500 | [diff] [blame^] | 148 | install: install-static install-shared install-man install-config |
Glenn Randers-Pehrson | be9de0f | 2001-01-22 08:52:16 -0600 | [diff] [blame] | 149 | |
Glenn Randers-Pehrson | c4a2ae6 | 1998-01-16 22:06:18 -0600 | [diff] [blame] | 150 | clean: |
Glenn Randers-Pehrson | c6de22d | 2002-02-23 18:55:25 -0600 | [diff] [blame] | 151 | rm -f *.o libpng.a pngtest pngout.png $(LIBNAME).so \ |
| 152 | $(LIBNAME).so.$(PNGMAJ)* |
Glenn Randers-Pehrson | c4a2ae6 | 1998-01-16 22:06:18 -0600 | [diff] [blame] | 153 | |
Glenn Randers-Pehrson | 166c5a3 | 1999-12-10 09:43:02 -0600 | [diff] [blame] | 154 | DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO |
| 155 | writelock: |
| 156 | chmod a-w *.[ch35] $(DOCS) scripts/* |
| 157 | |
Glenn Randers-Pehrson | c4a2ae6 | 1998-01-16 22:06:18 -0600 | [diff] [blame] | 158 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
| 159 | |
| 160 | png.o: png.h pngconf.h |
| 161 | pngerror.o: png.h pngconf.h |
| 162 | pngrio.o: png.h pngconf.h |
| 163 | pngwio.o: png.h pngconf.h |
| 164 | pngmem.o: png.h pngconf.h |
| 165 | pngset.o: png.h pngconf.h |
| 166 | pngget.o: png.h pngconf.h |
| 167 | pngread.o: png.h pngconf.h |
| 168 | pngrtran.o: png.h pngconf.h |
| 169 | pngrutil.o: png.h pngconf.h |
| 170 | pngtest.o: png.h pngconf.h |
| 171 | pngtrans.o: png.h pngconf.h |
| 172 | pngwrite.o: png.h pngconf.h |
| 173 | pngwtran.o: png.h pngconf.h |
| 174 | pngwutil.o: png.h pngconf.h |
| 175 | pngpread.o: png.h pngconf.h |
Glenn Randers-Pehrson | 1909560 | 2001-03-14 07:08:39 -0600 | [diff] [blame] | 176 | pnggccrd.o: png.h pngconf.h |
Glenn Randers-Pehrson | c4a2ae6 | 1998-01-16 22:06:18 -0600 | [diff] [blame] | 177 | |