makefile.32sunu 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. # makefile for libpng on Solaris 2.x with cc
  2. # Contributed by William L. Sebok, based on makefile.linux
  3. # Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
  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=libpng16
  11. PNGMAJ = 16
  12. # Shared library names:
  13. LIBSO=$(LIBNAME).so
  14. LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
  15. LIBSOREL=$(LIBSOMAJ).$(RELEASE)
  16. OLDSO=libpng.so
  17. # Utilities:
  18. CC=cc
  19. AR_RC=ar rc
  20. MKDIR_P=mkdir -p
  21. LN_SF=ln -f -s
  22. RANLIB=echo
  23. RM_F=/bin/rm -f
  24. SUN_CC_FLAGS=-fast -xtarget=ultra
  25. SUN_LD_FLAGS=-fast -xtarget=ultra
  26. # where make install puts libpng.a, libpng16.so and libpng16/png.h
  27. prefix=/a
  28. exec_prefix=$(prefix)
  29. # Where the zlib library and include files are located
  30. # Changing these to ../zlib poses a security risk. If you want
  31. # to have zlib in an adjacent directory, specify the full path instead of "..".
  32. #ZLIBLIB=../zlib
  33. #ZLIBINC=../zlib
  34. ZLIBLIB=/usr/lib
  35. ZLIBINC=/usr/include
  36. WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
  37. -Wmissing-declarations -Wtraditional -Wcast-align \
  38. -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
  39. CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
  40. CFLAGS=$(SUN_CC_FLAGS) # $(WARNMORE) -g
  41. LDFLAGS=$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) libpng.a -lz -lm
  42. INCPATH=$(prefix)/include
  43. LIBPATH=$(exec_prefix)/lib
  44. MANPATH=$(prefix)/man
  45. BINPATH=$(exec_prefix)/bin
  46. # override DESTDIR= on the make install command line to easily support
  47. # installing into a temporary location. Example:
  48. #
  49. # make install DESTDIR=/tmp/build/libpng
  50. #
  51. # If you're going to install into a temporary location
  52. # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
  53. # you execute make install.
  54. DESTDIR=
  55. DB=$(DESTDIR)$(BINPATH)
  56. DI=$(DESTDIR)$(INCPATH)
  57. DL=$(DESTDIR)$(LIBPATH)
  58. DM=$(DESTDIR)$(MANPATH)
  59. OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
  60. pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
  61. pngwtran.o pngmem.o pngerror.o pngpread.o
  62. OBJSDLL = $(OBJS:.o=.pic.o)
  63. .SUFFIXES: .c .o .pic.o
  64. .c.o:
  65. $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
  66. .c.pic.o:
  67. $(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
  68. all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
  69. include scripts/pnglibconf.mak
  70. DELETE = $(RM_F)
  71. DFNFLAGS = $(DEFS) $(CPPFLAGS)
  72. libpng.a: $(OBJS)
  73. $(AR_RC) $@ $(OBJS)
  74. $(RANLIB) $@
  75. libpng.pc:
  76. cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
  77. -e s!@exec_prefix@!$(exec_prefix)! \
  78. -e s!@libdir@!$(LIBPATH)! \
  79. -e s!@includedir@!$(INCPATH)! \
  80. -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
  81. libpng-config:
  82. ( cat scripts/libpng-config-head.in; \
  83. echo prefix=\"$(prefix)\"; \
  84. echo libdir=\"$(LIBPATH)\"; \
  85. echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
  86. echo L_opts=\"-L$(LIBPATH)\"; \
  87. echo R_opts=\"-R$(LIBPATH)\"; \
  88. echo ccopts=\"-fast -xtarget=ultra\"; \
  89. echo ldopts=\"-fast -xtarget=ultra\"; \
  90. echo libs=\"-lpng16 -lz -lm\"; \
  91. cat scripts/libpng-config-body.in ) > libpng-config
  92. chmod +x libpng-config
  93. $(LIBSO): $(LIBSOMAJ)
  94. $(LN_SF) $(LIBSOMAJ) $(LIBSO)
  95. $(LIBSOMAJ): $(OBJSDLL)
  96. @case "`type ld`" in *ucb*) \
  97. echo; \
  98. echo '## WARNING:'; \
  99. echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \
  100. echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \
  101. echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \
  102. echo '## The environment variable LD_LIBRARY_PATH should not be set'; \
  103. echo '## at all. If it is, things are likely to break because of'; \
  104. echo '## the libucb dependency that is created.'; \
  105. echo; \
  106. ;; \
  107. esac
  108. $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h $(LIBSOMAJ) \
  109. -o $(LIBSOMAJ) $(OBJSDLL)
  110. pngtest: pngtest.o $(LIBSO)
  111. $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
  112. test: pngtest
  113. ./pngtest
  114. install-headers: png.h pngconf.h pnglibconf.h
  115. -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
  116. -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
  117. cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
  118. chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
  119. -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
  120. -@$(RM_F) $(DI)/libpng
  121. (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
  122. install-static: install-headers libpng.a
  123. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  124. cp libpng.a $(DL)/$(LIBNAME).a
  125. chmod 644 $(DL)/$(LIBNAME).a
  126. -@$(RM_F) $(DL)/libpng.a
  127. (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
  128. install-shared: install-headers $(LIBSOMAJ) libpng.pc
  129. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  130. -@$(RM_F) $(DL)/$(LIBSO)
  131. -@$(RM_F) $(DL)/$(LIBSOREL)
  132. -@$(RM_F) $(DL)/$(OLDSO)
  133. cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
  134. chmod 755 $(DL)/$(LIBSOREL)
  135. (cd $(DL); \
  136. $(LN_SF) $(LIBSOREL) $(LIBSO); \
  137. $(LN_SF) $(LIBSO) $(OLDSO))
  138. -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
  139. -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
  140. -@$(RM_F) $(DL)/pkgconfig/libpng.pc
  141. cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
  142. chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
  143. (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
  144. install-man: libpng.3 libpngpf.3 png.5
  145. -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
  146. -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
  147. -@$(RM_F) $(DM)/man3/libpng.3
  148. -@$(RM_F) $(DM)/man3/libpngpf.3
  149. cp libpng.3 $(DM)/man3
  150. cp libpngpf.3 $(DM)/man3
  151. -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
  152. -@$(RM_F) $(DM)/man5/png.5
  153. cp png.5 $(DM)/man5
  154. install-config: libpng-config
  155. -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
  156. -@$(RM_F) $(DB)/libpng-config
  157. -@$(RM_F) $(DB)/$(LIBNAME)-config
  158. cp libpng-config $(DB)/$(LIBNAME)-config
  159. chmod 755 $(DB)/$(LIBNAME)-config
  160. (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
  161. install: install-static install-shared install-man install-config
  162. # If you installed in $(DESTDIR), test-installed won't work until you
  163. # move the library to its final location. Use test-dd to test it
  164. # before then.
  165. test-dd:
  166. echo
  167. echo Testing installed dynamic shared library in $(DL).
  168. $(CC) $(SUN_CC_FLAGS) -I$(DI) $(CPPFLAGS) \
  169. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  170. -o pngtestd -L$(DL) -R$(DL) `$(BINPATH)/$(LIBNAME)-config --ldflags` \
  171. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
  172. ./pngtestd pngtest.png
  173. test-installed:
  174. echo
  175. echo Testing installed dynamic shared library.
  176. $(CC) $(SUN_CC_FLAGS) $(CPPFLAGS) \
  177. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  178. -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
  179. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
  180. ./pngtesti pngtest.png
  181. clean:
  182. $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
  183. libpng-config $(LIBSO) $(LIBSOMAJ)* \
  184. libpng.pc
  185. DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
  186. writelock:
  187. chmod a-w *.[ch35] $(DOCS) scripts/*
  188. # DO NOT DELETE THIS LINE -- make depend depends on it.
  189. png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  190. pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  191. pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  192. pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  193. pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  194. pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  195. pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  196. pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  197. pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  198. pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  199. pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  200. pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  201. pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  202. pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  203. pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  204. pngtest.o: png.h pngconf.h pnglibconf.h