makefile.gcc 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # makefile for libpng using gcc (generic, static library)
  2. # Copyright (C) 2008, 2014 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. CP = cp
  18. RM_F = rm -f
  19. WARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \
  20. -Wmissing-declarations -Wtraditional -Wcast-align \
  21. -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
  22. CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
  23. CFLAGS = -W -Wall -O2 # $(WARNMORE) -g
  24. LDFLAGS =
  25. LIBS = -lz -lm
  26. # File extensions
  27. EXEEXT =
  28. # Pre-built configuration
  29. # See scripts/pnglibconf.mak for more options
  30. PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
  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. pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
  38. $(CP) $(PNGLIBCONF_H_PREBUILT) $@
  39. .c.o:
  40. $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
  41. static: libpng.a pngtest$(EXEEXT)
  42. shared:
  43. @echo This is a generic makefile that cannot create shared libraries.
  44. @echo Please use a configuration that is specific to your platform.
  45. @false
  46. libpng.a: $(OBJS)
  47. $(AR_RC) $@ $(OBJS)
  48. $(RANLIB) $@
  49. test: pngtest$(EXEEXT)
  50. ./pngtest$(EXEEXT)
  51. pngtest$(EXEEXT): pngtest.o libpng.a
  52. $(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest.o libpng.a $(LIBS)
  53. clean:
  54. $(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h
  55. png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  56. pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  57. pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  58. pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  59. pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  60. pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  61. pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  62. pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  63. pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  64. pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  65. pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  66. pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  67. pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  68. pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  69. pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  70. pngtest.o: png.h pngconf.h pnglibconf.h