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.

165 lines
4.0 KiB

  1. # Makefile for PngMinus (rpng2)
  2. # Linux / Unix
  3. #CC=cc
  4. CC=gcc
  5. LD=$(CC)
  6. # If awk fails try
  7. # make AWK=nawk
  8. # If cpp fails try
  9. # make CPP=/lib/cpp
  10. RM=rm -f
  11. COPY=cp
  12. #XINC = -I/usr/include # old-style, stock X distributions
  13. #XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX)
  14. #XINC = -I/usr/openwin/include # Sun workstations (OpenWindows)
  15. #XLIB = -L/usr/openwin/lib -lX11
  16. XINC = -I/usr/X11R6/include # new X distributions (X.org, etc.)
  17. XLIB = -L/usr/X11R6/lib -lX11
  18. #XLIB = -L/usr/X11R6/lib64 -lX11 # e.g., Red Hat on AMD64
  19. #XINC = -I/usr/local/include # FreeBSD
  20. #XLIB = -L/usr/local/lib -lX11
  21. #LIBS = $(XLIB)
  22. LIBS = $(XLIB) -lm #platforms that need libm
  23. CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP -I. $(XINC) -O1
  24. C=.c
  25. O=.o
  26. L=.a
  27. E=
  28. # Where to find the source code:
  29. PNGSRC =../../..
  30. ZLIBSRC=$(PNGSRC)/../zlib
  31. PROGSRC=$(PNGSRC)/contrib/gregbook
  32. # Zlib (minimal inflate requirements - crc32 is used by libpng)
  33. # zutil can be eliminated if you provide your own zcalloc and zcfree
  34. ZSRCS = adler32$(C) crc32$(C) \
  35. inffast$(C) inflate$(C) inftrees$(C) \
  36. zutil$(C)
  37. # Standard headers
  38. ZH = zlib.h crc32.h inffast.h inffixed.h \
  39. inflate.h inftrees.h zutil.h
  40. # Machine generated headers
  41. ZCONF = zconf.h
  42. # Headers callers use
  43. ZINC = zlib.h $(ZCONF)
  44. # Headers the Zlib source uses
  45. ZHDRS = $(ZH) $(ZCONF)
  46. ZOBJS = adler32$(O) crc32$(O) \
  47. inffast$(O) inflate$(O) inftrees$(O) \
  48. zutil$(O)
  49. # libpng
  50. PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \
  51. pngpread$(C) pngread$(C) pngrio$(C) pngrtran$(C) pngrutil$(C) \
  52. pngset$(C) pngtrans$(C)
  53. # Standard headers
  54. PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
  55. # Machine generated headers
  56. PNGCONF=pnglibconf.h
  57. # Headers callers use
  58. PNGINC= png.h pngconf.h pngusr.h $(PNGCONF)
  59. # Headers the PNG library uses
  60. PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h
  61. PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
  62. pngpread$(O) pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \
  63. pngset$(O) pngtrans$(O)
  64. PROGSRCS= rpng2-x$(C) readpng2$(C)
  65. PROGHDRS= readpng2.h
  66. PROGDOCS= COPYING LICENSE
  67. PROGOBJS= rpng2-x$(O) readpng2$(O)
  68. OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
  69. # implicit make rules -------------------------------------------------------
  70. .c$(O):
  71. $(CC) -c $(CFLAGS) $<
  72. # dependencies
  73. all: $(PROGDOCS) rpng2-x$(E)
  74. rpng2-x$(E): $(OBJS)
  75. $(LD) -o rpng2-x$(E) $(OBJS) $(LIBS)
  76. # The DFA_XTRA setting turns all libpng options off then
  77. # turns on those required for this minimal build.
  78. # The CPP_FLAGS setting causes pngusr.h to be included in
  79. # both the build of pnglibconf.h and, subsequently, when
  80. # building libpng itself.
  81. $(PNGCONF): $(PNGSRC)/scripts/pnglibconf.mak\
  82. $(PNGSRC)/scripts/pnglibconf.dfa \
  83. $(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa
  84. $(RM) pnglibconf.h pnglibconf.dfn
  85. $(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
  86. srcdir=$(PNGSRC) CPPFLAGS="-DPNG_USER_CONFIG"\
  87. DFA_XTRA="pngusr.dfa" $@
  88. clean:
  89. $(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
  90. srcdir=$(PNGSRC) clean
  91. $(RM) rpng2-x$(O)
  92. $(RM) rpng2-x$(E)
  93. $(RM) $(OBJS)
  94. # distclean also removes the copied source and headers
  95. distclean: clean
  96. $(RM) -r scripts # historical reasons
  97. $(RM) $(PNGSRCS) $(PNGH)
  98. $(RM) $(ZSRCS) $(ZH) $(ZCONF)
  99. $(RM) $(PROGSRCS) $(PROGHDRS) $(PROGDOCS)
  100. # Header file dependencies:
  101. $(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC)
  102. $(PNGOBJS): $(PNGHDRS) $(ZINC)
  103. $(ZOBJS): $(ZHDRS)
  104. # Gather the source code from the respective directories
  105. $(PNGSRCS) $(PNGH): $(PNGSRC)/$@
  106. $(RM) $@
  107. $(COPY) $(PNGSRC)/$@ $@
  108. # No dependency on the ZLIBSRC target so that it only needs
  109. # to be specified once.
  110. $(ZSRCS) $(ZH):
  111. $(RM) $@
  112. $(COPY) $(ZLIBSRC)/$@ $@
  113. # The unconfigured zconf.h varies in name according to the
  114. # zlib release
  115. $(ZCONF):
  116. $(RM) $@
  117. @for f in zconf.h.in zconf.in.h zconf.h; do\
  118. test -r $(ZLIBSRC)/$$f &&\
  119. echo $(COPY) $(ZLIBSRC)/$$f $@ &&\
  120. $(COPY) $(ZLIBSRC)/$$f $@ && exit 0;\
  121. done; echo copy: $(ZLIBSRC)/zconf.h not found; exit 1
  122. $(PROGSRCS) $(PROGHDRS) $(PROGDOCS): $(PROGSRC)/$@
  123. $(RM) $@
  124. $(COPY) $(PROGSRC)/$@ $@
  125. # End of makefile for rpng2-x