makefile.dec 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. # makefile for libpng on DEC Alpha Unix
  2. # Copyright (C) 2000-2002, 2006, 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. PNGMAJ = 16
  10. LIBNAME = libpng16
  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
  20. LN_SF=ln -f -s
  21. RANLIB=ranlib
  22. RM_F=/bin/rm -f
  23. # where make install puts libpng.a and png.h
  24. prefix=/usr/local
  25. exec_prefix=$(prefix)
  26. INCPATH=$(prefix)/include
  27. LIBPATH=$(exec_prefix)/lib
  28. MANPATH=$(prefix)/man
  29. BINPATH=$(exec_prefix)/bin
  30. # override DESTDIR= on the make install command line to easily support
  31. # installing into a temporary location. Example:
  32. #
  33. # make install DESTDIR=/tmp/build/libpng
  34. #
  35. # If you're going to install into a temporary location
  36. # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
  37. # you execute make install.
  38. DESTDIR=
  39. DB=$(DESTDIR)$(BINPATH)
  40. DI=$(DESTDIR)$(INCPATH)
  41. DL=$(DESTDIR)$(LIBPATH)
  42. DM=$(DESTDIR)$(MANPATH)
  43. # Where the zlib library and include files are located
  44. #ZLIBLIB=/usr/local/lib
  45. #ZLIBINC=/usr/local/include
  46. ZLIBLIB=../zlib
  47. ZLIBINC=../zlib
  48. CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
  49. CFLAGS=-std -w1 -O # -g
  50. LDFLAGS=-L$(ZLIBLIB) -rpath $(ZLIBLIB) libpng.a -lz -lm
  51. OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
  52. pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
  53. pngwtran.o pngmem.o pngerror.o pngpread.o
  54. .c.o:
  55. $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
  56. all: $(LIBSO) libpng.a pngtest libpng.pc libpng-config
  57. # see scripts/pnglibconf.mak for more options
  58. pnglibconf.h: scripts/pnglibconf.h.prebuilt
  59. cp scripts/pnglibconf.h.prebuilt $@
  60. libpng.a: $(OBJS)
  61. $(AR_RC) $@ $(OBJS)
  62. $(RANLIB) $@
  63. libpng.pc:
  64. cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
  65. -e s!@exec_prefix@!$(exec_prefix)! \
  66. -e s!@libdir@!$(LIBPATH)! \
  67. -e s!@includedir@!$(INCPATH)! \
  68. -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
  69. libpng-config:
  70. ( cat scripts/libpng-config-head.in; \
  71. echo prefix=\"$(prefix)\"; \
  72. echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
  73. echo ccopts=\"-std\"; \
  74. echo L_opts=\"-L$(LIBPATH)\"; \
  75. echo libs=\"-lpng16 -lz -lm\"; \
  76. cat scripts/libpng-config-body.in ) > libpng-config
  77. chmod +x libpng-config
  78. $(LIBSO): $(LIBSOMAJ)
  79. $(LN_SF) $(LIBSOMAJ) $(LIBSO)
  80. $(LIBSOMAJ): $(OBJS)
  81. $(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) \
  82. -soname $(LIBSOMAJ)
  83. pngtest: pngtest.o libpng.a
  84. $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
  85. test: pngtest
  86. ./pngtest
  87. install-headers: png.h pngconf.h pnglibconf.h
  88. -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
  89. -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
  90. cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
  91. chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
  92. -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
  93. -@/bin/rm -f $(DI)/libpng
  94. (cd $(DI); $(LN_SF)(LIBNAME) libpng; $(LN_SF)(LIBNAME)/* .)
  95. install-static: install-headers libpng.a
  96. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  97. cp libpng.a $(DL)/$(LIBNAME).a
  98. chmod 644 $(DL)/$(LIBNAME).a
  99. -@/bin/rm -f $(DL)/libpng.a
  100. (cd $(DL); $(LN_SF)(LIBNAME).a libpng.a)
  101. install-shared: install-headers $(LIBSOMAJ) libpng.pc
  102. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  103. -@$(RM_F) $(DL)/$(LIBSO)
  104. -@$(RM_F) $(DL)/$(LIBSOREL)
  105. -@$(RM_F) $(DL)/$(OLDSO)
  106. cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
  107. chmod 755 $(DL)/$(LIBSOREL)
  108. (cd $(DL); \
  109. $(LN_SF) $(LIBSOREL) $(LIBSO); \
  110. $(LN_SF) $(LIBSO) $(OLDSO))
  111. -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
  112. -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
  113. -@$(RM_F) $(DL)/pkgconfig/libpng.pc
  114. cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
  115. chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
  116. (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
  117. install-man: libpng.3 libpngpf.3 png.5
  118. -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
  119. -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
  120. -@/bin/rm -f $(DM)/man3/libpng.3
  121. -@/bin/rm -f $(DM)/man3/libpngpf.3
  122. cp libpng.3 $(DM)/man3
  123. cp libpngpf.3 $(DM)/man3
  124. -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
  125. -@/bin/rm -f $(DM)/man5/png.5
  126. cp png.5 $(DM)/man5
  127. install-config: libpng-config
  128. -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
  129. -@/bin/rm -f $(DB)/libpng-config
  130. -@/bin/rm -f $(DB)/$(LIBNAME)-config
  131. cp libpng-config $(DB)/$(LIBNAME)-config
  132. chmod 755 $(DB)/$(LIBNAME)-config
  133. (cd $(DB); $(LN_SF)(LIBNAME)-config libpng-config)
  134. install: install-static install-shared install-man install-config
  135. # If you installed in $(DESTDIR), test-installed won't work until you
  136. # move the library to its final location. Use test-dd to test it
  137. # before then.
  138. test-dd:
  139. echo
  140. echo Testing installed dynamic shared library in $(DL).
  141. $(CC) -w1 -I$(DI) $(CPPFLAGS) \
  142. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  143. -L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL) \
  144. -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
  145. ./pngtestd pngtest.png
  146. test-installed:
  147. echo
  148. echo Testing installed dynamic shared library.
  149. $(CC) -w1 $(CPPFLAGS) \
  150. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  151. -L$(ZLIBLIB) -R$(ZLIBLIB) \
  152. -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
  153. ./pngtesti pngtest.png
  154. clean:
  155. /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \
  156. libpng-config $(LIBSO) $(LIBSOMAJ)* \
  157. libpng.pc pnglibconf.h
  158. # DO NOT DELETE THIS LINE -- make depend depends on it.
  159. png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  160. pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  161. pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  162. pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  163. pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  164. pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  165. pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  166. pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  167. pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  168. pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  169. pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  170. pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  171. pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  172. pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  173. pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  174. pngtest.o: png.h pngconf.h pnglibconf.h