makefile.gcc 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # makefile for libpng using gcc (generic, static library)
  2. # Copyright (C) 2008 Glenn Randers-Pehrson
  3. # Copyright (C) 2000 Cosmin Truta
  4. # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
  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. # Location of the zlib library and include files
  10. ZLIBINC = ../zlib
  11. ZLIBLIB = ../zlib
  12. # Compiler, linker, lib and other tools
  13. CC = gcc
  14. LD = $(CC)
  15. AR_RC = ar rcs
  16. RANLIB = ranlib
  17. RM_F = rm -f
  18. CDEBUG = -g -DPNG_DEBUG=5
  19. LDDEBUG =
  20. CRELEASE = -O2
  21. LDRELEASE = -s
  22. #CFLAGS = -W -Wall $(CDEBUG)
  23. CFLAGS = -W -Wall $(CRELEASE)
  24. #LDFLAGS = $(LDDEBUG)
  25. LDFLAGS = $(LDRELEASE)
  26. LIBS = -lz -lm
  27. # File extensions
  28. O=.o
  29. A=.a
  30. EXE=
  31. # Variables
  32. OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \
  33. pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \
  34. pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
  35. # Targets
  36. all: static
  37. # see scripts/pnglibconf.mak for more options
  38. pnglibconf.h: scripts/pnglibconf.h.prebuilt
  39. cp scripts/pnglibconf.h.prebuilt $@
  40. .c$(O):
  41. $(CC) -c $(CFLAGS) -I$(ZLIBINC) $<
  42. static: libpng$(A) pngtest$(EXE)
  43. shared:
  44. @echo This is a generic makefile that cannot create shared libraries.
  45. @echo Please use a configuration that is specific to your platform.
  46. @false
  47. libpng$(A): $(OBJS)
  48. $(AR_RC) $@ $(OBJS)
  49. $(RANLIB) $@
  50. test: pngtest$(EXE)
  51. ./pngtest$(EXE)
  52. pngtest$(EXE): pngtest$(O) libpng$(A)
  53. $(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest$(O) libpng$(A) $(LIBS)
  54. clean:
  55. $(RM_F) *$(O) libpng$(A) pngtest$(EXE) pngout.png pnglibconf.h
  56. png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  57. pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  58. pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  59. pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  60. pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  61. pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  62. pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  63. pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  64. pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  65. pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  66. pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  67. pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  68. pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  69. pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  70. pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  71. pngtest$(O): png.h pngconf.h pnglibconf.h