makefile.hpux 7.4 KB

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