makefile.dec 6.6 KB

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