makefile.sco 7.4 KB

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