Glenn Randers-Pehrson | 7455cbf | 2011-11-24 14:40:36 -0600 | [diff] [blame] | 1 | # makefile for libpng.a and libpng16.so on Linux ELF with gcc |
Glenn Randers-Pehrson | 5af0307 | 2014-01-20 12:36:30 -0600 | [diff] [blame] | 2 | # Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2014 Greg Roelofs and |
Glenn Randers-Pehrson glennrp@comcast.net | 7ecf7bd | 2009-05-02 15:36:08 -0500 | [diff] [blame] | 3 | # Glenn Randers-Pehrson |
Glenn Randers-Pehrson | d436672 | 2000-06-04 14:29:29 -0500 | [diff] [blame] | 4 | # Copyright (C) 1996, 1997 Andreas Dilger |
Glenn Randers-Pehrson | 3e61d79 | 2009-06-24 09:31:28 -0500 | [diff] [blame] | 5 | # |
Glenn Randers-Pehrson | bfbf865 | 2009-06-26 21:46:52 -0500 | [diff] [blame] | 6 | # This code is released under the libpng license. |
Glenn Randers-Pehrson | c332bbc | 2009-06-25 13:43:50 -0500 | [diff] [blame] | 7 | # For conditions of distribution and use, see the disclaimer |
Glenn Randers-Pehrson | 037023b | 2009-06-24 10:27:36 -0500 | [diff] [blame] | 8 | # and license in png.h |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 9 | |
Glenn Randers-Pehrson | 4deeb79 | 2006-03-22 16:21:59 -0600 | [diff] [blame] | 10 | # Library name: |
Glenn Randers-Pehrson | 7455cbf | 2011-11-24 14:40:36 -0600 | [diff] [blame] | 11 | LIBNAME = libpng16 |
| 12 | PNGMAJ = 16 |
Glenn Randers-Pehrson | 56e9307 | 2014-10-22 19:59:42 -0500 | [diff] [blame^] | 13 | RELEASE = 15 |
Glenn Randers-Pehrson | 9c0f094 | 2002-02-21 23:14:23 -0600 | [diff] [blame] | 14 | |
Glenn Randers-Pehrson | 4deeb79 | 2006-03-22 16:21:59 -0600 | [diff] [blame] | 15 | # Shared library names: |
| 16 | LIBSO=$(LIBNAME).so |
| 17 | LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 18 | LIBSOREL=$(LIBSOMAJ).$(RELEASE) |
Glenn Randers-Pehrson | 4deeb79 | 2006-03-22 16:21:59 -0600 | [diff] [blame] | 19 | OLDSO=libpng.so |
Glenn Randers-Pehrson | 4deeb79 | 2006-03-22 16:21:59 -0600 | [diff] [blame] | 20 | |
| 21 | # Utilities: |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 22 | AR_RC=ar rc |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 23 | CC=gcc |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 24 | MKDIR_P=mkdir -p |
| 25 | LN_SF=ln -sf |
| 26 | RANLIB=ranlib |
Cosmin Truta | 82200da | 2014-03-22 09:29:59 -0500 | [diff] [blame] | 27 | CP=cp |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 28 | RM_F=/bin/rm -f |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 29 | |
Glenn Randers-Pehrson | 7455cbf | 2011-11-24 14:40:36 -0600 | [diff] [blame] | 30 | # where "make install" puts libpng16.a, libpng16.so*, |
Glenn Randers-Pehrson | 0b3634b | 2011-12-17 09:57:00 -0600 | [diff] [blame] | 31 | # libpng16/png.h, libpng16/pngconf.h, and libpng16/pnglibconf.h |
Glenn Randers-Pehrson | d1e8c86 | 2002-06-20 06:54:34 -0500 | [diff] [blame] | 32 | # Prefix must be a full pathname. |
Glenn Randers-Pehrson | 5c6aeb2 | 1998-12-29 11:47:59 -0600 | [diff] [blame] | 33 | prefix=/usr/local |
Glenn Randers-Pehrson | ad31054 | 2006-04-18 05:31:20 -0500 | [diff] [blame] | 34 | exec_prefix=$(prefix) |
Glenn Randers-Pehrson | 5c6aeb2 | 1998-12-29 11:47:59 -0600 | [diff] [blame] | 35 | |
Glenn Randers-Pehrson | d1e8c86 | 2002-06-20 06:54:34 -0500 | [diff] [blame] | 36 | # Where the zlib library and include files are located. |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 37 | #ZLIBLIB=/usr/local/lib |
| 38 | #ZLIBINC=/usr/local/include |
| 39 | ZLIBLIB=../zlib |
| 40 | ZLIBINC=../zlib |
| 41 | |
Glenn Randers-Pehrson | 896239b | 1998-04-21 15:03:57 -0500 | [diff] [blame] | 42 | ALIGN= |
Glenn Randers-Pehrson | f8b008c | 1999-09-18 10:54:36 -0500 | [diff] [blame] | 43 | # for i386: |
Glenn Randers-Pehrson | 896239b | 1998-04-21 15:03:57 -0500 | [diff] [blame] | 44 | #ALIGN=-malign-loops=2 -malign-functions=2 |
| 45 | |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 46 | WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 47 | -Wmissing-declarations -Wtraditional -Wcast-align \ |
| 48 | -Wstrict-prototypes -Wmissing-prototypes #-Wconversion |
Glenn Randers-Pehrson | 896239b | 1998-04-21 15:03:57 -0500 | [diff] [blame] | 49 | |
Glenn Randers-Pehrson | 6d8f3b0 | 1999-10-23 08:39:18 -0500 | [diff] [blame] | 50 | # for pgcc version 2.95.1, -O3 is buggy; don't use it. |
Glenn Randers-Pehrson | bcfd15d | 1999-10-01 14:22:25 -0500 | [diff] [blame] | 51 | |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 52 | CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5 |
| 53 | CFLAGS= -W -Wall -O3 -funroll-loops \ |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 54 | $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5 |
Glenn Randers-Pehrson | 9c0f094 | 2002-02-21 23:14:23 -0600 | [diff] [blame] | 55 | |
Glenn Randers-Pehrson | 7455cbf | 2011-11-24 14:40:36 -0600 | [diff] [blame] | 56 | LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm |
Glenn Randers-Pehrson | 9c0f094 | 2002-02-21 23:14:23 -0600 | [diff] [blame] | 57 | LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 58 | |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 59 | INCPATH=$(prefix)/include |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 60 | LIBPATH=$(exec_prefix)/lib |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 61 | MANPATH=$(prefix)/man |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 62 | BINPATH=$(exec_prefix)/bin |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 63 | |
| 64 | # override DESTDIR= on the make install command line to easily support |
| 65 | # installing into a temporary location. Example: |
| 66 | # |
| 67 | # make install DESTDIR=/tmp/build/libpng |
| 68 | # |
| 69 | # If you're going to install into a temporary location |
Glenn Randers-Pehrson | 07748d1 | 2002-05-25 11:12:10 -0500 | [diff] [blame] | 70 | # via DESTDIR, $(DESTDIR)$(prefix) must already exist before |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 71 | # you execute make install. |
| 72 | DESTDIR= |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 73 | |
Glenn Randers-Pehrson | 07748d1 | 2002-05-25 11:12:10 -0500 | [diff] [blame] | 74 | DB=$(DESTDIR)$(BINPATH) |
| 75 | DI=$(DESTDIR)$(INCPATH) |
| 76 | DL=$(DESTDIR)$(LIBPATH) |
| 77 | DM=$(DESTDIR)$(MANPATH) |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 78 | |
Cosmin Truta | 9ab7b4c | 2014-03-22 13:13:11 -0500 | [diff] [blame] | 79 | # Pre-built configuration |
| 80 | # See scripts/pnglibconf.mak for more options |
| 81 | PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt |
| 82 | |
Glenn Randers-Pehrson glennrp@comcast.net | 7ecf7bd | 2009-05-02 15:36:08 -0500 | [diff] [blame] | 83 | OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 84 | pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ |
| 85 | pngwtran.o pngmem.o pngerror.o pngpread.o |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 86 | |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 87 | OBJSDLL = $(OBJS:.o=.pic.o) |
| 88 | |
| 89 | .SUFFIXES: .c .o .pic.o |
| 90 | |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 91 | .c.o: |
| 92 | $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< |
| 93 | |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 94 | .c.pic.o: |
| 95 | $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c |
| 96 | |
Glenn Randers-Pehrson glennrp@comcast.net | 7ecf7bd | 2009-05-02 15:36:08 -0500 | [diff] [blame] | 97 | all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 98 | |
Cosmin Truta | 9ab7b4c | 2014-03-22 13:13:11 -0500 | [diff] [blame] | 99 | pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) |
Glenn Randers-Pehrson | ff649a0 | 2014-08-07 19:51:35 -0500 | [diff] [blame] | 100 | $(CP) $(PNGLIBCONF_H_PREBUILT) $@ |
Glenn Randers-Pehrson | 7253144 | 2010-04-17 08:17:51 -0500 | [diff] [blame] | 101 | |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 102 | libpng.a: $(OBJS) |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 103 | $(AR_RC) $@ $(OBJS) |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 104 | $(RANLIB) $@ |
| 105 | |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 106 | libpng.pc: |
Glenn Randers-Pehrson glennrp@comcast.net | 7ecf7bd | 2009-05-02 15:36:08 -0500 | [diff] [blame] | 107 | cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \ |
| 108 | -e s!@exec_prefix@!$(exec_prefix)! \ |
| 109 | -e s!@libdir@!$(LIBPATH)! \ |
| 110 | -e s!@includedir@!$(INCPATH)! \ |
Glenn Randers-Pehrson | 7455cbf | 2011-11-24 14:40:36 -0600 | [diff] [blame] | 111 | -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 112 | |
Glenn Randers-Pehrson | 837a3d1 | 2002-05-10 20:19:58 -0500 | [diff] [blame] | 113 | libpng-config: |
| 114 | ( cat scripts/libpng-config-head.in; \ |
| 115 | echo prefix=\"$(prefix)\"; \ |
Glenn Randers-Pehrson | 5ff38d3 | 2002-09-17 23:38:46 -0500 | [diff] [blame] | 116 | echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ |
| 117 | echo L_opts=\"-L$(LIBPATH)\"; \ |
| 118 | echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \ |
Glenn Randers-Pehrson | 7455cbf | 2011-11-24 14:40:36 -0600 | [diff] [blame] | 119 | echo libs=\"-lpng16 -lz -lm\"; \ |
Glenn Randers-Pehrson | 837a3d1 | 2002-05-10 20:19:58 -0500 | [diff] [blame] | 120 | cat scripts/libpng-config-body.in ) > libpng-config |
| 121 | chmod +x libpng-config |
| 122 | |
Glenn Randers-Pehrson | 4deeb79 | 2006-03-22 16:21:59 -0600 | [diff] [blame] | 123 | $(LIBSO): $(LIBSOMAJ) |
| 124 | $(LN_SF) $(LIBSOMAJ) $(LIBSO) |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 125 | |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 126 | $(LIBSOMAJ): $(OBJSDLL) |
| 127 | $(CC) -shared -Wl,-soname,$(LIBSOMAJ) -o $(LIBSOMAJ) $(OBJSDLL) |
Glenn Randers-Pehrson glennrp@comcast.net | 7ecf7bd | 2009-05-02 15:36:08 -0500 | [diff] [blame] | 128 | |
Glenn Randers-Pehrson | 4deeb79 | 2006-03-22 16:21:59 -0600 | [diff] [blame] | 129 | pngtest: pngtest.o $(LIBSO) |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 130 | $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 131 | |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 132 | pngtest-static: pngtest.o libpng.a |
Glenn Randers-Pehrson | 9c0f094 | 2002-02-21 23:14:23 -0600 | [diff] [blame] | 133 | $(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A) |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 134 | |
Glenn Randers-Pehrson | 9c0f094 | 2002-02-21 23:14:23 -0600 | [diff] [blame] | 135 | test: pngtest pngtest-static |
| 136 | @echo "" |
Glenn Randers-Pehrson | 4deeb79 | 2006-03-22 16:21:59 -0600 | [diff] [blame] | 137 | @echo " Running pngtest dynamically linked with $(LIBSO):" |
Glenn Randers-Pehrson | 9c0f094 | 2002-02-21 23:14:23 -0600 | [diff] [blame] | 138 | @echo "" |
| 139 | ./pngtest |
| 140 | @echo "" |
| 141 | @echo " Running pngtest statically linked with libpng.a:" |
| 142 | @echo "" |
| 143 | ./pngtest-static |
| 144 | |
Glenn Randers-Pehrson | 0b3634b | 2011-12-17 09:57:00 -0600 | [diff] [blame] | 145 | install-headers: png.h pngconf.h pnglibconf.h |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 146 | -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi |
| 147 | -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi |
Glenn Randers-Pehrson | 0b3634b | 2011-12-17 09:57:00 -0600 | [diff] [blame] | 148 | cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) |
| 149 | chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h |
| 150 | -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 151 | -@$(RM_F) $(DI)/libpng |
| 152 | (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 153 | |
| 154 | install-static: install-headers libpng.a |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 155 | -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 156 | cp libpng.a $(DL)/$(LIBNAME).a |
| 157 | chmod 644 $(DL)/$(LIBNAME).a |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 158 | -@$(RM_F) $(DL)/libpng.a |
| 159 | (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a) |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 160 | |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 161 | install-shared: install-headers $(LIBSOMAJ) libpng.pc |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 162 | -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 163 | -@$(RM_F) $(DL)/$(LIBSO) |
| 164 | -@$(RM_F) $(DL)/$(LIBSOREL) |
Glenn Randers-Pehrson | 4deeb79 | 2006-03-22 16:21:59 -0600 | [diff] [blame] | 165 | -@$(RM_F) $(DL)/$(OLDSO) |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 166 | cp $(LIBSOMAJ) $(DL)/$(LIBSOREL) |
| 167 | chmod 755 $(DL)/$(LIBSOREL) |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 168 | (cd $(DL); \ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 169 | $(LN_SF) $(LIBSOREL) $(LIBSO); \ |
| 170 | $(LN_SF) $(LIBSO) $(OLDSO)) |
| 171 | |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 172 | -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi |
| 173 | -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc |
| 174 | -@$(RM_F) $(DL)/pkgconfig/libpng.pc |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 175 | cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc |
| 176 | chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 177 | (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc) |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 178 | |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 179 | install-man: libpng.3 libpngpf.3 png.5 |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 180 | -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi |
| 181 | -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi |
| 182 | -@$(RM_F) $(DM)/man3/libpng.3 |
| 183 | -@$(RM_F) $(DM)/man3/libpngpf.3 |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 184 | cp libpng.3 $(DM)/man3 |
| 185 | cp libpngpf.3 $(DM)/man3 |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 186 | -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi |
| 187 | -@$(RM_F) $(DM)/man5/png.5 |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 188 | cp png.5 $(DM)/man5 |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 189 | |
Glenn Randers-Pehrson | 837a3d1 | 2002-05-10 20:19:58 -0500 | [diff] [blame] | 190 | install-config: libpng-config |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 191 | -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi |
| 192 | -@$(RM_F) $(DB)/libpng-config |
| 193 | -@$(RM_F) $(DB)/$(LIBNAME)-config |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 194 | cp libpng-config $(DB)/$(LIBNAME)-config |
| 195 | chmod 755 $(DB)/$(LIBNAME)-config |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 196 | (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config) |
Glenn Randers-Pehrson | 704228f | 2002-05-02 20:49:40 -0500 | [diff] [blame] | 197 | |
| 198 | install: install-static install-shared install-man install-config |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 199 | |
Glenn Randers-Pehrson | d020e9d | 2002-06-28 09:34:00 -0500 | [diff] [blame] | 200 | # If you installed in $(DESTDIR), test-installed won't work until you |
Glenn Randers-Pehrson | a4981d4 | 2004-08-25 22:00:45 -0500 | [diff] [blame] | 201 | # move the library to its final location. Use test-dd to test it |
| 202 | # before then. |
| 203 | |
| 204 | test-dd: |
| 205 | echo |
| 206 | echo Testing installed dynamic shared library in $(DL). |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 207 | $(CC) -I$(DI) $(CPPFLAGS) \ |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 208 | `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \ |
Glenn Randers-Pehrson | 6bc53be | 2006-06-16 07:52:03 -0500 | [diff] [blame] | 209 | -L$(DL) -L$(ZLIBLIB) -Wl, -rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \ |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 210 | -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags` |
Glenn Randers-Pehrson | a4981d4 | 2004-08-25 22:00:45 -0500 | [diff] [blame] | 211 | ./pngtestd pngtest.png |
Glenn Randers-Pehrson | d020e9d | 2002-06-28 09:34:00 -0500 | [diff] [blame] | 212 | |
Glenn Randers-Pehrson | d1e8c86 | 2002-06-20 06:54:34 -0500 | [diff] [blame] | 213 | test-installed: |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 214 | $(CC) $(CPPFLAGS) \ |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 215 | `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \ |
Glenn Randers-Pehrson | d020e9d | 2002-06-28 09:34:00 -0500 | [diff] [blame] | 216 | -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \ |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 217 | -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` |
Glenn Randers-Pehrson | 2ae022d | 2002-07-01 22:23:46 -0500 | [diff] [blame] | 218 | ./pngtesti pngtest.png |
Glenn Randers-Pehrson | d1e8c86 | 2002-06-20 06:54:34 -0500 | [diff] [blame] | 219 | |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 220 | clean: |
Glenn Randers-Pehrson glennrp@comcast.net | 7ecf7bd | 2009-05-02 15:36:08 -0500 | [diff] [blame] | 221 | $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \ |
Glenn Randers-Pehrson | 4deeb79 | 2006-03-22 16:21:59 -0600 | [diff] [blame] | 222 | $(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \ |
Glenn Randers-Pehrson | 7253144 | 2010-04-17 08:17:51 -0500 | [diff] [blame] | 223 | libpng.pc pnglibconf.h |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 224 | |
Glenn Randers-Pehrson | 166c5a3 | 1999-12-10 09:43:02 -0600 | [diff] [blame] | 225 | DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO |
| 226 | writelock: |
| 227 | chmod a-w *.[ch35] $(DOCS) scripts/* |
| 228 | |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 229 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
| 230 | |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 231 | png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 232 | pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 233 | pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 234 | pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 235 | pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 236 | pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 237 | pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 238 | pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 239 | pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 240 | pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 241 | pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 242 | pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 243 | pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 244 | pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 245 | pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 246 | |
Glenn Randers-Pehrson | 871b1d0 | 2013-03-02 14:58:22 -0600 | [diff] [blame] | 247 | pngtest.o: png.h pngconf.h pnglibconf.h |