makefile.sgi 7.5 KB

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