Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

219 lines
7.2 KiB

  1. # makefile for libpng on Darwin / Mac OS X
  2. # Copyright (C) 2002, 2004, 2006, 2008, 2010-2011 Glenn Randers-Pehrson
  3. # Copyright (C) 2001 Christoph Pfisterer
  4. # derived from makefile.linux:
  5. # Copyright (C) 1998, 1999 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. # where "make install" puts libpng.a, libpng15.dylib, png.h, pngconf.h,
  12. # and pnglibconf.h
  13. prefix=/usr/local
  14. exec_prefix=$(prefix)
  15. # Where the zlib library and include files are located
  16. #ZLIBLIB=/usr/local/lib
  17. #ZLIBINC=/usr/local/include
  18. ZLIBLIB=../zlib
  19. ZLIBINC=../zlib
  20. # Library name:
  21. LIBNAME = libpng15
  22. PNGMAJ = 15
  23. # Shared library names:
  24. LIBSO=$(LIBNAME).dylib
  25. LIBSOMAJ=$(LIBNAME).$(PNGMAJ).dylib
  26. LIBSOREL=$(LIBNAME).$(PNGMAJ).$(RELEASE).dylib
  27. OLDSO=libpng.dylib
  28. # Utilities:
  29. CC=cc
  30. AR_RC=ar rc
  31. MKDIR_P=mkdir -p
  32. LN_SF=ln -sf
  33. RANLIB=ranlib
  34. RM_F=/bin/rm -f
  35. # CFLAGS=-I$(ZLIBINC) -W -Wall -O3 -funroll-loops
  36. CFLAGS=-I$(ZLIBINC) -W -Wall -O -funroll-loops
  37. LDFLAGS=-L. -L$(ZLIBLIB) -lpng15 -lz
  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. OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
  56. pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
  57. pngwtran.o pngmem.o pngerror.o pngpread.o
  58. OBJSDLL = $(OBJS:.o=.pic.o)
  59. .SUFFIXES: .c .o .pic.o
  60. .c.pic.o:
  61. $(CC) -c $(CFLAGS) -fno-common -o $@ $*.c
  62. all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
  63. # see scripts/pnglibconf.mak for more options
  64. pnglibconf.h: scripts/pnglibconf.h.prebuilt
  65. cp scripts/pnglibconf.h.prebuilt $@
  66. libpng.a: $(OBJS)
  67. $(AR_RC) $@ $(OBJS)
  68. $(RANLIB) $@
  69. libpng.pc:
  70. cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
  71. -e s!@exec_prefix@!$(exec_prefix)! \
  72. -e s!@libdir@!$(LIBPATH)! \
  73. -e s!@includedir@!$(INCPATH)! \
  74. -e s!-lpng15!-lpng15\ -lz! > libpng.pc
  75. libpng-config:
  76. ( cat scripts/libpng-config-head.in; \
  77. echo prefix=\"$(prefix)\"; \
  78. echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
  79. echo L_opts=\"-L$(LIBPATH)\"; \
  80. echo libs=\"-lpng15 -lz\"; \
  81. cat scripts/libpng-config-body.in ) > libpng-config
  82. chmod +x libpng-config
  83. $(LIBSO): $(LIBSOMAJ)
  84. $(LN_SF) $(LIBSOMAJ) $(LIBSO)
  85. $(LIBSOMAJ): $(OBJSDLL)
  86. $(CC) -dynamiclib \
  87. -install_name $(LIBPATH)/$(LIBSOMAJ) \
  88. -current_version 15 -compatibility_version 15 \
  89. -o $(LIBSOMAJ) \
  90. $(OBJSDLL) -L$(ZLIBLIB) -lz
  91. pngtest: pngtest.o $(LIBSO)
  92. $(CC) -o pngtest $(CFLAGS) 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. $(RANLIB) $(DL)/$(LIBNAME).a
  108. -@$(RM_F) $(DL)/libpng.a
  109. (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
  110. install-shared: install-headers $(LIBSOMAJ) libpng.pc
  111. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  112. -@$(RM_F) $(DL)/$(LIBSO)
  113. -@$(RM_F) $(DL)/$(LIBSOREL)
  114. -@$(RM_F) $(DL)/$(OLDSO)
  115. cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
  116. chmod 755 $(DL)/$(LIBSOREL)
  117. (cd $(DL); \
  118. $(LN_SF) $(LIBSOREL) $(LIBSO); \
  119. $(LN_SF) $(LIBSO) $(OLDSO))
  120. -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
  121. -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
  122. -@$(RM_F) $(DL)/pkgconfig/libpng.pc
  123. cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
  124. chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
  125. (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
  126. install-man: libpng.3 libpngpf.3 png.5
  127. -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
  128. -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
  129. -@$(RM_F) $(DM)/man3/libpng.3
  130. -@$(RM_F) $(DM)/man3/libpngpf.3
  131. cp libpng.3 $(DM)/man3
  132. cp libpngpf.3 $(DM)/man3
  133. -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
  134. -@$(RM_F) $(DM)/man5/png.5
  135. cp png.5 $(DM)/man5
  136. install-config: libpng-config
  137. -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
  138. -@$(RM_F) $(DB)/libpng-config
  139. -@$(RM_F) $(DB)/$(LIBNAME)-config
  140. cp libpng-config $(DB)/$(LIBNAME)-config
  141. chmod 755 $(DB)/$(LIBNAME)-config
  142. (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
  143. install: install-static install-shared install-man install-config
  144. # If you installed in $(DESTDIR), test-installed won't work until you
  145. # move the library to its final location. Use test-dd to test it
  146. # before then.
  147. test-dd:
  148. echo
  149. echo Testing installed dynamic shared library in $(DL).
  150. $(CC) -I$(DI) -I$(ZLIBINC) \
  151. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  152. -L$(DL) -L$(ZLIBLIB) \
  153. -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
  154. ./pngtestd pngtest.png
  155. test-installed:
  156. $(CC) $(CFLAGS) \
  157. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  158. -L$(ZLIBLIB) \
  159. -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
  160. ./pngtesti pngtest.png
  161. clean:
  162. $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
  163. libpng.pc $(LIBNAME).*dylib pngtesti pnglibconf.h
  164. DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
  165. writelock:
  166. chmod a-w *.[ch35] $(DOCS) scripts/*
  167. # DO NOT DELETE THIS LINE -- make depend depends on it.
  168. png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  169. pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  170. pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  171. pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  172. pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  173. pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  174. pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  175. pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  176. pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  177. pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  178. pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  179. pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  180. pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  181. pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  182. pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  183. pngtest.o: png.h pngconf.h pnglibconf.h