makefile.hpux 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. # makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
  2. # Copyright (C) 1999-2002, 2006, 2010-2011 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 = libpng15
  20. PNGMAJ = 15
  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. RM_F=/bin/rm -f
  33. # where make install puts libpng.a, libpng15.sl, and png.h
  34. prefix=/opt/libpng
  35. exec_prefix=$(prefix)
  36. INCPATH=$(prefix)/include
  37. LIBPATH=$(exec_prefix)/lib
  38. MANPATH=$(prefix)/man
  39. BINPATH=$(exec_prefix)/bin
  40. CFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
  41. # Caution: be sure you have built zlib with the same CFLAGS.
  42. CCFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
  43. LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
  44. # override DESTDIR= on the make install command line to easily support
  45. # installing into a temporary location. Example:
  46. #
  47. # make install DESTDIR=/tmp/build/libpng
  48. #
  49. # If you're going to install into a temporary location
  50. # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
  51. # you execute make install.
  52. DESTDIR=
  53. DB=$(DESTDIR)$(BINPATH)
  54. DI=$(DESTDIR)$(INCPATH)
  55. DL=$(DESTDIR)$(LIBPATH)
  56. DM=$(DESTDIR)$(MANPATH)
  57. OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
  58. pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
  59. pngwtran.o pngmem.o pngerror.o pngpread.o
  60. OBJSDLL = $(OBJS:.o=.pic.o)
  61. .SUFFIXES: .c .o .pic.o
  62. .c.pic.o:
  63. $(CC) -c $(CFLAGS) +z -o $@ $*.c
  64. all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
  65. # see scripts/pnglibconf.mak for more options
  66. pnglibconf.h: scripts/pnglibconf.h.prebuilt
  67. cp scripts/pnglibconf.h.prebuilt $@
  68. libpng.a: $(OBJS)
  69. $(AR_RC) $@ $(OBJS)
  70. $(RANLIB) $@
  71. libpng.pc:
  72. cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
  73. -e s!@exec_prefix@!$(exec_prefix)! \
  74. -e s!@libdir@!$(LIBPATH)! \
  75. -e s!@includedir@!$(INCPATH)! \
  76. -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
  77. libpng-config:
  78. ( cat scripts/libpng-config-head.in; \
  79. echo prefix=\"$(prefix)\"; \
  80. echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
  81. echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \
  82. echo L_opts=\"-L$(LIBPATH)\"; \
  83. echo libs=\"-lpng15 -lz -lm\"; \
  84. cat scripts/libpng-config-body.in ) > libpng-config
  85. chmod +x libpng-config
  86. $(LIBSO): $(LIBSOMAJ)
  87. $(LN_SF) $(LIBSOMAJ) $(LIBSO)
  88. $(LIBSOMAJ): $(OBJSDLL)
  89. $(LD) -b +s \
  90. +h $(LIBSOMAJ) -o $(LIBSOMAJ) $(OBJSDLL)
  91. pngtest: pngtest.o libpng.a
  92. $(CC) -o pngtest $(CCFLAGS) pngtest.o $(LDFLAGS)
  93. test: pngtest
  94. ./pngtest
  95. install-headers: png.h pngconf.h pnglibconf.h
  96. -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
  97. -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
  98. cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
  99. chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
  100. -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
  101. -@$(RM_F) $(DI)/libpng
  102. (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
  103. install-static: install-headers libpng.a
  104. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  105. cp libpng.a $(DL)/$(LIBNAME).a
  106. chmod 644 $(DL)/$(LIBNAME).a
  107. -@$(RM_F) $(DL)/libpng.a
  108. (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
  109. install-shared: install-headers $(LIBSOMAJ) libpng.pc
  110. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  111. -@$(RM_F) $(DL)/$(LIBSO)
  112. -@$(RM_F) $(DL)/$(LIBSOREL)
  113. -@$(RM_F) $(DL)/$(OLDSO)
  114. cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
  115. chmod 755 $(DL)/$(LIBSOREL)
  116. (cd $(DL); \
  117. $(LN_SF) $(LIBSOREL) $(LIBSO); \
  118. $(LN_SF) $(LIBSO) $(OLDSO))
  119. -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
  120. -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
  121. -@$(RM_F) $(DL)/pkgconfig/libpng.pc
  122. cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
  123. chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
  124. (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
  125. install-man: libpng.3 libpngpf.3 png.5
  126. -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
  127. -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
  128. -@$(RM_F) $(DM)/man3/libpng.3
  129. -@$(RM_F) $(DM)/man3/libpngpf.3
  130. cp libpng.3 $(DM)/man3
  131. cp libpngpf.3 $(DM)/man3
  132. -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
  133. -@$(RM_F) $(DM)/man5/png.5
  134. cp png.5 $(DM)/man5
  135. install-config: libpng-config
  136. -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
  137. -@$(RM_F) $(DB)/libpng-config
  138. -@$(RM_F) $(DB)/$(LIBNAME)-config
  139. cp libpng-config $(DB)/$(LIBNAME)-config
  140. chmod 755 $(DB)/$(LIBNAME)-config
  141. (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
  142. install: install-static install-shared install-man install-config
  143. # If you installed in $(DESTDIR), test-installed won't work until you
  144. # move the library to its final location. Use test-dd to test it
  145. # before then.
  146. test-dd:
  147. echo
  148. echo Testing installed dynamic shared library in $(DL).
  149. $(CC) -I$(DI) -I$(ZLIBINC) $(CCFLAGS) \
  150. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  151. -L$(DL) -L$(ZLIBLIB) \
  152. -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
  153. ./pngtestd pngtest.png
  154. test-installed:
  155. echo
  156. echo Testing installed dynamic shared library.
  157. $(CC) $(CCFLAGS) \
  158. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  159. -L$(ZLIBLIB) \
  160. -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
  161. ./pngtesti pngtest.png
  162. clean:
  163. $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
  164. libpng-config $(LIBSO) $(LIBSOMAJ)* \
  165. libpng.pc pnglibconf.h
  166. DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
  167. writelock:
  168. chmod a-w *.[ch35] $(DOCS) scripts/*
  169. # DO NOT DELETE THIS LINE -- make depend depends on it.
  170. png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  171. pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  172. pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  173. pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  174. pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  175. pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  176. pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  177. pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  178. pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  179. pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  180. pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  181. pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  182. pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  183. pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  184. pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  185. pngtest.o: png.h pngconf.h pnglibconf.h