makefile.sgi 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. # makefile for libpng.a and libpng15.so, SGI IRIX with 'cc'
  2. # Copyright (C) 2001-2002, 2006, 2007, 2010-2011 Glenn Randers-Pehrson
  3. # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
  4. #
  5. # This code is released under the libpng license.
  6. # For conditions of distribution and use, see the disclaimer
  7. # and license in png.h
  8. # Library name:
  9. LIBNAME=libpng15
  10. PNGMAJ = 15
  11. # Shared library names:
  12. LIBSO=$(LIBNAME).so
  13. LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
  14. LIBSOREL=$(LIBSOMAJ).$(RELEASE)
  15. OLDSO=libpng.so
  16. # Utilities:
  17. AR_RC=ar rc
  18. CC=cc
  19. MKDIR_P=mkdir -p
  20. LN_SF=ln -sf
  21. RANLIB=echo
  22. RM_F=/bin/rm -f
  23. # Where make install puts libpng.a, libpng15.so, and libpng15/png.h
  24. # Prefix must be a full pathname.
  25. prefix=/usr/local
  26. exec_prefix=$(prefix)
  27. # Where the zlib library and include files are located
  28. #ZLIBLIB=/usr/local/lib32
  29. #ZLIBINC=/usr/local/include
  30. #ZLIBLIB=/usr/local/lib
  31. #ZLIBINC=/usr/local/include
  32. ZLIBLIB=../zlib
  33. ZLIBINC=../zlib
  34. # ABI can be blank to use default for your system, -32, -o32, -n32, or -64
  35. # See "man abi". zlib must be built with the same ABI.
  36. ABI=
  37. WARNMORE=-fullwarn
  38. # Note: -KPIC is the default anyhow
  39. #CFLAGS= $(ABI) -I$(ZLIBINC) -O $(WARNMORE) -KPIC # -g -DPNG_DEBUG=5
  40. CFLAGS=$(ABI) -I$(ZLIBINC) -O $(WARNMORE)
  41. LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng15 -lz -lm
  42. LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
  43. LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
  44. -set_version sgi$(PNGMAJ).0
  45. # See "man dso" for info about shared objects
  46. INCPATH=$(prefix)/include
  47. LIBPATH=$(exec_prefix)/lib
  48. #LIBPATH=$(exec_prefix)/lib32
  49. MANPATH=$(prefix)/man
  50. BINPATH=$(exec_prefix)/bin
  51. # override DESTDIR= on the make install command line to easily support
  52. # installing into a temporary location. Example:
  53. #
  54. # make install DESTDIR=/tmp/build/libpng
  55. #
  56. # If you're going to install into a temporary location
  57. # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
  58. # you execute make install.
  59. DESTDIR=
  60. DB=$(DESTDIR)$(BINPATH)
  61. DI=$(DESTDIR)$(INCPATH)
  62. DL=$(DESTDIR)$(LIBPATH)
  63. DM=$(DESTDIR)$(MANPATH)
  64. OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
  65. pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
  66. pngwtran.o pngmem.o pngerror.o pngpread.o
  67. all: libpng.a pngtest shared libpng.pc libpng-config
  68. # see scripts/pnglibconf.mak for more options
  69. pnglibconf.h: scripts/pnglibconf.h.prebuilt
  70. cp scripts/pnglibconf.h.prebuilt $@
  71. libpng.a: $(OBJS)
  72. $(AR_RC) $@ $(OBJS)
  73. $(RANLIB) $@
  74. libpng.pc:
  75. cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
  76. -e s!@exec_prefix@!$(exec_prefix)! \
  77. -e s!@libdir@!$(LIBPATH)! \
  78. -e s!@includedir@!$(INCPATH)! \
  79. -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
  80. libpng-config:
  81. ( cat scripts/libpng-config-head.in; \
  82. echo prefix=\"$(prefix)\"; \
  83. echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
  84. echo ccopts=\"$(ABI)\"; \
  85. echo ldopts=\"$(ABI)\"; \
  86. echo L_opts=\"-L$(LIBPATH)\"; \
  87. echo libdir=\"$(LIBPATH)\"; \
  88. echo libs=\"-lpng15 -lz -lm\"; \
  89. cat scripts/libpng-config-body.in ) > libpng-config
  90. chmod +x libpng-config
  91. $(LIBSO): $(LIBSOMAJ)
  92. $(LN_SF) $(LIBSOMAJ) $(LIBSO)
  93. $(LIBSOMAJ): $(OBJS)
  94. $(LDSHARED) -o $@ $(OBJS)
  95. $(RM_F) $(LIBSO) $(LIBSOMAJ)
  96. pngtest: pngtest.o libpng.a
  97. $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
  98. test: pngtest
  99. echo
  100. echo Testing local static library.
  101. ./pngtest
  102. install-headers: png.h pngconf.h pnglibconf.h
  103. -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
  104. -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
  105. cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
  106. chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
  107. -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
  108. -@$(RM_F) $(DI)/libpng
  109. (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
  110. install-static: install-headers libpng.a
  111. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  112. cp libpng.a $(DL)/$(LIBNAME).a
  113. chmod 644 $(DL)/$(LIBNAME).a
  114. -@$(RM_F) $(DL)/libpng.a
  115. (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
  116. install-shared: install-headers $(LIBSOMAJ) libpng.pc
  117. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  118. -@$(RM_F) $(DL)/$(LIBSO)
  119. -@$(RM_F) $(DL)/$(LIBSOREL)
  120. -@$(RM_F) $(DL)/$(OLDSO)
  121. cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
  122. chmod 755 $(DL)/$(LIBSOREL)
  123. (cd $(DL); \
  124. $(LN_SF) $(LIBSOREL) $(LIBSO); \
  125. $(LN_SF) $(LIBSO) $(OLDSO))
  126. -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
  127. -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
  128. -@$(RM_F) $(DL)/pkgconfig/libpng.pc
  129. cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
  130. chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
  131. (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
  132. install-man: libpng.3 libpngpf.3 png.5
  133. -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
  134. -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
  135. -@$(RM_F) $(DM)/man3/libpng.3
  136. -@$(RM_F) $(DM)/man3/libpngpf.3
  137. cp libpng.3 $(DM)/man3
  138. cp libpngpf.3 $(DM)/man3
  139. -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
  140. -@$(RM_F) $(DM)/man5/png.5
  141. cp png.5 $(DM)/man5
  142. install-config: libpng-config
  143. -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
  144. -@$(RM_F) $(DB)/libpng-config
  145. -@$(RM_F) $(DB)/$(LIBNAME)-config
  146. cp libpng-config $(DB)/$(LIBNAME)-config
  147. chmod 755 $(DB)/$(LIBNAME)-config
  148. (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
  149. install: install-static install-shared install-man install-config
  150. # If you installed in $(DESTDIR), test-installed won't work until you
  151. # move the library to its final location. Use test-dd to test it
  152. # before then.
  153. test-dd:
  154. echo
  155. echo Testing installed dynamic shared library in $(DL).
  156. $(CC) -I$(DI) -I$(ZLIBINC) \
  157. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  158. -L$(DL) -L$(ZLIBLIB) \
  159. -rpath $(ZLIBLIB):$(DL) \
  160. -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
  161. ./pngtestd pngtest.png
  162. test-installed:
  163. echo
  164. echo Testing installed dynamic shared library.
  165. $(CC) -I$(ZLIBINC) \
  166. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  167. -L$(ZLIBLIB) \
  168. -rpath $(ZLIBLIB):`$(BINPATH)/$(LIBNAME)-config --libdir` \
  169. -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
  170. ./pngtesti pngtest.png
  171. clean:
  172. $(RM_F) *.o libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \
  173. $(LIBSO) $(LIBSOMAJ)* \
  174. so_locations pnglibconf.h
  175. DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
  176. writelock:
  177. chmod a-w *.[ch35] $(DOCS) scripts/*
  178. # DO NOT DELETE THIS LINE -- make depend depends on it.
  179. png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  180. pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  181. pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  182. pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  183. pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  184. pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  185. pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  186. pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  187. pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  188. pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  189. pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  190. pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  191. pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  192. pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  193. pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  194. pngtest.o: png.h pngconf.h pnglibconf.h