makefile.hp64 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. # makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
  2. # Copyright (C) 1999-2002, 2006, 2009, 2010-2014 Glenn Randers-Pehrson
  3. # Copyright (C) 1995 Guy Eric Schalnat, Group 42
  4. # contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
  5. #
  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. # Where the zlib library and include files are located
  10. ZLIBLIB=/opt/zlib/lib
  11. ZLIBINC=/opt/zlib/include
  12. # Note that if you plan to build a libpng shared library, zlib must also
  13. # be a shared library, which zlib's configure does not do. After running
  14. # zlib's configure, edit the appropriate lines of makefile to read:
  15. # CFLAGS=-O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \
  16. # LDSHARED=ld -b
  17. # SHAREDLIB=libz.sl
  18. # Library name:
  19. LIBNAME = libpng16
  20. PNGMAJ = 16
  21. # Shared library names:
  22. LIBSO=$(LIBNAME).sl
  23. LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
  24. LIBSOREL=$(LIBSOMAJ).$(RELEASE)
  25. OLDSO=libpng.sl
  26. # Utilities:
  27. AR_RC=ar rc
  28. CC=cc
  29. MKDIR_P=mkdir -p
  30. LN_SF=ln -sf
  31. RANLIB=ranlib
  32. CP=cp
  33. RM_F=/bin/rm -f
  34. CPPFLAGS=-I$(ZLIBINC) \
  35. -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_UNISTD_H -DUSE_MMAP
  36. CFLAGS=-O -Ae -Wl,+vnocompatwarnings +DD64 +Z
  37. # Caution: be sure you have built zlib with the same CFLAGS.
  38. CCFLAGS=-O -Ae -Wl,+vnocompatwarnings +DD64 +Z
  39. LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
  40. # where make install puts libpng.a, libpng16.sl, and png.h
  41. prefix=/opt/libpng
  42. exec_prefix=$(prefix)
  43. INCPATH=$(prefix)/include
  44. LIBPATH=$(exec_prefix)/lib
  45. MANPATH=$(prefix)/man
  46. BINPATH=$(exec_prefix)/bin
  47. # override DESTDIR= on the make install command line to easily support
  48. # installing into a temporary location. Example:
  49. #
  50. # make install DESTDIR=/tmp/build/libpng
  51. #
  52. # If you're going to install into a temporary location
  53. # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
  54. # you execute make install.
  55. DESTDIR=
  56. DB=$(DESTDIR)$(BINPATH)
  57. DI=$(DESTDIR)$(INCPATH)
  58. DL=$(DESTDIR)$(LIBPATH)
  59. DM=$(DESTDIR)$(MANPATH)
  60. # Pre-built configuration
  61. # See scripts/pnglibconf.mak for more options
  62. PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
  63. OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
  64. pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
  65. pngwtran.o pngmem.o pngerror.o pngpread.o
  66. OBJSDLL = $(OBJS:.o=.pic.o)
  67. .SUFFIXES: .c .o .pic.o
  68. .c.o:
  69. $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
  70. .c.pic.o:
  71. $(CC) -c $(CPPFLAGS) $(CFLAGS) +z -o $@ $*.c
  72. all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
  73. pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
  74. $(CP) $(PNGLIBCONF_H_PREBUILT) $@
  75. libpng.a: $(OBJS)
  76. $(AR_RC) $@ $(OBJS)
  77. $(RANLIB) $@
  78. libpng.pc:
  79. cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
  80. -e s!@exec_prefix@!$(exec_prefix)! \
  81. -e s!@libdir@!$(LIBPATH)! \
  82. -e s!@includedir@!$(INCPATH)! \
  83. -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
  84. libpng-config:
  85. ( cat scripts/libpng-config-head.in; \
  86. echo prefix=\"$(prefix)\"; \
  87. echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
  88. echo ccopts=\"-O -Ae -Wl,+vnocompatwarnings +DD64 +Z\"; \
  89. echo L_opts=\"-L$(LIBPATH)\"; \
  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. $(LD) -b +s \
  97. +h $(LIBSOMAJ) -o $(LIBSOMAJ) $(OBJSDLL)
  98. pngtest: pngtest.o libpng.a
  99. $(CC) -o pngtest $(CCFLAGS) pngtest.o $(LDFLAGS)
  100. test: pngtest
  101. ./pngtest
  102. install-headers: png.h pngconf.h pnglibconf.h
  103. -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
  104. -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
  105. cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
  106. chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
  107. -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
  108. -@$(RM_F) $(DI)/libpng
  109. (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
  110. install-static: install-headers libpng.a
  111. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  112. cp libpng.a $(DL)/$(LIBNAME).a
  113. chmod 644 $(DL)/$(LIBNAME).a
  114. -@$(RM_F) $(DL)/libpng.a
  115. (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
  116. install-shared: install-headers $(LIBSOMAJ) libpng.pc
  117. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  118. -@$(RM_F) $(DL)/$(LIBSO)
  119. -@$(RM_F) $(DL)/$(LIBSOREL)
  120. -@$(RM_F) $(DL)/$(OLDSO)
  121. cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
  122. chmod 755 $(DL)/$(LIBSOREL)
  123. (cd $(DL); \
  124. $(LN_SF) $(LIBSOREL) $(LIBSO); \
  125. $(LN_SF) $(LIBSO) $(OLDSO))
  126. -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
  127. -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
  128. -@$(RM_F) $(DL)/pkgconfig/libpng.pc
  129. cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
  130. chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
  131. (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
  132. install-man: libpng.3 libpngpf.3 png.5
  133. -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
  134. -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
  135. -@$(RM_F) $(DM)/man3/libpng.3
  136. -@$(RM_F) $(DM)/man3/libpngpf.3
  137. cp libpng.3 $(DM)/man3
  138. cp libpngpf.3 $(DM)/man3
  139. -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
  140. -@$(RM_F) $(DM)/man5/png.5
  141. cp png.5 $(DM)/man5
  142. install-config: libpng-config
  143. -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
  144. -@$(RM_F) $(DB)/libpng-config
  145. -@$(RM_F) $(DB)/$(LIBNAME)-config
  146. cp libpng-config $(DB)/$(LIBNAME)-config
  147. chmod 755 $(DB)/$(LIBNAME)-config
  148. (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
  149. install: install-static install-shared install-man install-config
  150. # If you installed in $(DESTDIR), test-installed won't work until you
  151. # move the library to its final location. Use test-dd to test it
  152. # before then.
  153. test-dd:
  154. echo
  155. echo Testing installed dynamic shared library in $(DL).
  156. $(CC) -I$(DI) $(CPPFLAGS) $(CCFLAGS) \
  157. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  158. -L$(DL) -L$(ZLIBLIB) \
  159. -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
  160. ./pngtestd pngtest.png
  161. test-installed:
  162. echo
  163. echo Testing installed dynamic shared library.
  164. $(CC) $(CPPFLAGS) $(CCFLAGS) \
  165. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  166. -L$(ZLIBLIB) \
  167. -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
  168. ./pngtesti pngtest.png
  169. clean:
  170. $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
  171. libpng-config $(LIBSO) $(LIBSOMAJ)* \
  172. libpng.pc pnglibconf.h
  173. DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
  174. writelock:
  175. chmod a-w *.[ch35] $(DOCS) scripts/*
  176. # DO NOT DELETE THIS LINE -- make depend depends on it.
  177. png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  178. pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  179. pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  180. pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  181. pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  182. pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  183. pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  184. pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  185. pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  186. pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  187. pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  188. pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  189. pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  190. pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  191. pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  192. pngtest.o: png.h pngconf.h pnglibconf.h