makefile.sco 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. # makefile for SCO OSr5 ELF and Unixware 7 with Native cc
  2. # Contributed by Mike Hopkirk (hops@sco.com) modified from Makefile.lnx
  3. # force ELF build dynamic linking, SONAME setting in lib and RPATH in app
  4. # Copyright (C) 2002, 2006, 2010-2011 Glenn Randers-Pehrson
  5. # Copyright (C) 1998 Greg Roelofs
  6. # Copyright (C) 1996, 1997 Andreas Dilger
  7. #
  8. # This code is released under the libpng license.
  9. # For conditions of distribution and use, see the disclaimer
  10. # and license in png.h
  11. # Library name:
  12. LIBNAME = libpng15
  13. PNGMAJ = 15
  14. # Shared library names:
  15. LIBSO=$(LIBNAME).so
  16. LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
  17. LIBSOREL=$(LIBSOMAJ).$(RELEASE)
  18. OLDSO=libpng.so
  19. # Utilities:
  20. CC=cc
  21. AR_RC=ar rc
  22. MKDIR_P=mkdir
  23. LN_SF=ln -f -s
  24. RANLIB=echo
  25. RM_F=/bin/rm -f
  26. # where make install puts libpng.a, $(OLDSO)*, and png.h
  27. prefix=/usr/local
  28. exec_prefix=$(prefix)
  29. # Where the zlib library and include files are located
  30. #ZLIBLIB=/usr/local/lib
  31. #ZLIBINC=/usr/local/include
  32. ZLIBLIB=../zlib
  33. ZLIBINC=../zlib
  34. CFLAGS= -dy -belf -I$(ZLIBINC) -O3
  35. LDFLAGS=-L. -L$(ZLIBLIB) -lpng15 -lz -lm
  36. INCPATH=$(prefix)/include
  37. LIBPATH=$(exec_prefix)/lib
  38. MANPATH=$(prefix)/man
  39. BINPATH=$(exec_prefix)/bin
  40. # override DESTDIR= on the make install command line to easily support
  41. # installing into a temporary location. Example:
  42. #
  43. # make install DESTDIR=/tmp/build/libpng
  44. #
  45. # If you're going to install into a temporary location
  46. # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
  47. # you execute make install.
  48. DESTDIR=
  49. DB=$(DESTDIR)$(BINPATH)
  50. DI=$(DESTDIR)$(INCPATH)
  51. DL=$(DESTDIR)$(LIBPATH)
  52. DM=$(DESTDIR)$(MANPATH)
  53. OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
  54. pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
  55. pngwtran.o pngmem.o pngerror.o pngpread.o
  56. OBJSDLL = $(OBJS:.o=.pic.o)
  57. .SUFFIXES: .c .o .pic.o
  58. .c.pic.o:
  59. $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
  60. all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
  61. # see scripts/pnglibconf.mak for more options
  62. pnglibconf.h: scripts/pnglibconf.h.prebuilt
  63. cp scripts/pnglibconf.h.prebuilt $@
  64. libpng.a: $(OBJS)
  65. $(AR_RC) $@ $(OBJS)
  66. $(RANLIB) $@
  67. libpng.pc:
  68. cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
  69. -e s!@exec_prefix@!$(exec_prefix)! \
  70. -e s!@libdir@!$(LIBPATH)! \
  71. -e s!@includedir@!$(INCPATH)! \
  72. -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
  73. libpng-config:
  74. ( cat scripts/libpng-config-head.in; \
  75. echo prefix=\"$(prefix)\"; \
  76. echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
  77. echo ccopts=\"-belf\"; \
  78. echo L_opts=\"-L$(LIBPATH)\"; \
  79. echo libs=\"-lpng15 -lz -lm\"; \
  80. cat scripts/libpng-config-body.in ) > libpng-config
  81. chmod +x libpng-config
  82. $(LIBSO): $(LIBSOMAJ)
  83. $(LN_SF) $(LIBSOMAJ) $(LIBSO)
  84. $(LIBSOMAJ): $(OBJSDLL)
  85. $(CC) -G -Wl,-h,$(LIBSOMAJ) -o $(LIBSOMAJ) \
  86. $(OBJSDLL)
  87. pngtest: pngtest.o $(LIBSO)
  88. LD_RUN_PATH=.:$(ZLIBLIB) $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
  89. test: pngtest
  90. ./pngtest
  91. install-headers: png.h pngconf.h pnglibconf.h
  92. -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
  93. -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
  94. -@$(RM_F) $(DI)/png.h
  95. -@$(RM_F) $(DI)/pngconf.h
  96. -@$(RM_F) $(DI)/pnglibconf.h
  97. cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
  98. chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
  99. -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
  100. -@$(RM_F) $(DI)/libpng
  101. (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
  102. install-static: install-headers libpng.a
  103. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  104. cp libpng.a $(DL)/$(LIBNAME).a
  105. chmod 644 $(DL)/$(LIBNAME).a
  106. -@$(RM_F) $(DL)/libpng.a
  107. (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
  108. install-shared: install-headers $(LIBSOMAJ) libpng.pc
  109. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  110. -@$(RM_F) $(DL)/$(LIBSO)
  111. -@$(RM_F) $(DL)/$(LIBSOREL)
  112. -@$(RM_F) $(DL)/$(OLDSO)
  113. cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
  114. chmod 755 $(DL)/$(LIBSOREL)
  115. (cd $(DL); \
  116. $(LN_SF) $(LIBSOREL) $(LIBSO); \
  117. $(LN_SF) $(LIBSO) $(OLDSO))
  118. -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
  119. -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
  120. -@$(RM_F) $(DL)/pkgconfig/libpng.pc
  121. cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
  122. chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
  123. (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
  124. install-man: libpng.3 libpngpf.3 png.5
  125. -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
  126. -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
  127. -@$(RM_F) $(DM)/man3/libpng.3
  128. -@$(RM_F) $(DM)/man3/libpngpf.3
  129. cp libpng.3 $(DM)/man3
  130. cp libpngpf.3 $(DM)/man3
  131. -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
  132. -@$(RM_F) $(DM)/man5/png.5
  133. cp png.5 $(DM)/man5
  134. install-config: libpng-config
  135. -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
  136. -@$(RM_F) $(DB)/libpng-config
  137. -@$(RM_F) $(DB)/$(LIBNAME)-config
  138. cp libpng-config $(DB)/$(LIBNAME)-config
  139. chmod 755 $(DB)/$(LIBNAME)-config
  140. (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
  141. install: install-static install-shared install-man install-config
  142. # If you installed in $(DESTDIR), test-installed won't work until you
  143. # move the library to its final location. Use test-dd to test it
  144. # before then.
  145. test-dd:
  146. echo
  147. echo Testing installed dynamic shared library in $(DL).
  148. $(CC) -I$(DI) $(CFLAGS) \
  149. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  150. -L$(DL) -L$(ZLIBLIB) \
  151. -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
  152. ./pngtestd pngtest.png
  153. test-installed:
  154. $(CC) $(CFLAGS) \
  155. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  156. -L$(ZLIBLIB) \
  157. -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
  158. ./pngtesti pngtest.png
  159. clean:
  160. $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
  161. $(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \
  162. pnglibconf.h libpng.pc
  163. DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
  164. writelock:
  165. chmod a-w *.[ch35] $(DOCS) scripts/*
  166. # DO NOT DELETE THIS LINE -- make depend depends on it.
  167. png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  168. pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  169. pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  170. pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  171. pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  172. pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  173. pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  174. pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  175. pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  176. pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  177. pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  178. pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  179. pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  180. pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  181. pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  182. pngtest.o: png.h pngconf.h pnglibconf.h