makefile.sgi 7.6 KB

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