makefile.dec 6.7 KB

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