makefile.solaris-x86 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. # makefile for libpng on Solaris 2.x with gcc
  2. # Copyright (C) 2004, 2006-2008, 2010-2011 Glenn Randers-Pehrson
  3. # Contributed by William L. Sebok, based on makefile.linux
  4. # Copyright (C) 1998 Greg Roelofs
  5. # Copyright (C) 1996, 1997 Andreas Dilger
  6. # This code is released under the libpng license.
  7. # For conditions of distribution and use, see the disclaimer
  8. # and license in png.h
  9. # Library name:
  10. LIBNAME = libpng15
  11. PNGMAJ = 15
  12. # Shared library names:
  13. LIBSO=$(LIBNAME).so
  14. LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
  15. LIBSOREL=$(LIBSOMAJ).$(RELEASE)
  16. OLDSO=libpng.so
  17. # Utilities:
  18. AR_RC=ar rc
  19. CC=gcc
  20. MKDIR_P=mkdir -p
  21. LN_SF=ln -f -s
  22. RANLIB=echo
  23. RM_F=/bin/rm -f
  24. # Where make install puts libpng.a, libpng15.so*, and png.h
  25. prefix=/usr/local
  26. exec_prefix=$(prefix)
  27. # Where the zlib library and include files are located
  28. # Changing these to ../zlib poses a security risk. If you want
  29. # to have zlib in an adjacent directory, specify the full path instead of "..".
  30. #ZLIBLIB=../zlib
  31. #ZLIBINC=../zlib
  32. ZLIBLIB=/usr/local/lib
  33. ZLIBINC=/usr/local/include
  34. WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
  35. -Wmissing-declarations -Wtraditional -Wcast-align \
  36. -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
  37. CFLAGS=-I$(ZLIBINC) -W -Wall -O \
  38. # $(WARNMORE) -g -DPNG_DEBUG=5
  39. LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng15 -lz -lm
  40. INCPATH=$(prefix)/include
  41. LIBPATH=$(exec_prefix)/lib
  42. MANPATH=$(prefix)/man
  43. BINPATH=$(exec_prefix)/bin
  44. # override DESTDIR= on the make install command line to easily support
  45. # installing into a temporary location. Example:
  46. #
  47. # make install DESTDIR=/tmp/build/libpng
  48. #
  49. # If you're going to install into a temporary location
  50. # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
  51. # you execute make install.
  52. DESTDIR=
  53. DB=$(DESTDIR)$(BINPATH)
  54. DI=$(DESTDIR)$(INCPATH)
  55. DL=$(DESTDIR)$(LIBPATH)
  56. DM=$(DESTDIR)$(MANPATH)
  57. OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
  58. pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
  59. pngwtran.o pngmem.o pngerror.o pngpread.o
  60. OBJSDLL = $(OBJS:.o=.pic.o)
  61. .SUFFIXES: .c .o .pic.o
  62. .c.pic.o:
  63. $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
  64. all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
  65. # see scripts/pnglibconf.mak for more options
  66. pnglibconf.h: scripts/pnglibconf.h.prebuilt
  67. cp scripts/pnglibconf.h.prebuilt $@
  68. libpng.a: $(OBJS)
  69. $(AR_RC) $@ $(OBJS)
  70. $(RANLIB) $@
  71. libpng.pc:
  72. cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
  73. -e s!@exec_prefix@!$(exec_prefix)! \
  74. -e s!@libdir@!$(LIBPATH)! \
  75. -e s!@includedir@!$(INCPATH)! \
  76. -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
  77. libpng-config:
  78. ( cat scripts/libpng-config-head.in; \
  79. echo prefix=\"$(prefix)\"; \
  80. echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
  81. echo cppflags=\""; \
  82. echo L_opts=\"-L$(LIBPATH)\"; \
  83. echo R_opts=\"-R$(LIBPATH)\"; \
  84. echo libs=\"-lpng15 -lz -lm\"; \
  85. cat scripts/libpng-config-body.in ) > libpng-config
  86. chmod +x libpng-config
  87. $(LIBSO): $(LIBSOMAJ)
  88. $(LN_SF) $(LIBSOMAJ) $(LIBSO)
  89. $(LIBSOMAJ): $(OBJSDLL)
  90. @case "`type ld`" in *ucb*) \
  91. echo; \
  92. echo '## WARNING:'; \
  93. echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \
  94. echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \
  95. echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \
  96. echo '## The environment variable LD_LIBRARY_PATH should not be set'; \
  97. echo '## at all. If it is, things are likely to break because of'; \
  98. echo '## the libucb dependency that is created.'; \
  99. echo; \
  100. ;; \
  101. esac
  102. $(LD) -G -h $(LIBSOMAJ) \
  103. -o $(LIBSOMAJ) $(OBJSDLL)
  104. pngtest: pngtest.o $(LIBSO)
  105. $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
  106. test: pngtest
  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) -I$(ZLIBINC) \
  163. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  164. -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags` \
  165. -L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL)
  166. ./pngtestd pngtest.png
  167. test-installed:
  168. echo
  169. echo Testing installed dynamic shared library.
  170. $(CC) -I$(ZLIBINC) \
  171. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  172. -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
  173. -L$(ZLIBLIB) -R$(ZLIBLIB)
  174. ./pngtesti pngtest.png
  175. clean:
  176. $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
  177. libpng-config $(LIBSO) $(LIBSOMAJ)* \
  178. libpng.pc pnglibconf.h
  179. DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
  180. writelock:
  181. chmod a-w *.[ch35] $(DOCS) scripts/*
  182. # DO NOT DELETE THIS LINE -- make depend depends on it.
  183. png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  184. pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  185. pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  186. pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  187. pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  188. pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  189. pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  190. pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  191. pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  192. pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  193. pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  194. pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  195. pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  196. pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  197. pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  198. pngtest.o: png.h pngconf.h pnglibconf.h