makefile.knr 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # makefile for libpng
  2. # Copyright (C) 2002, 2006, 2009, 2014 Glenn Randers-Pehrson
  3. # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
  4. #
  5. # This code is released under the libpng license.
  6. # For conditions of distribution and use, see the disclaimer
  7. # and license in png.h
  8. #
  9. # This makefile requires the file ansi2knr.c, which you can get
  10. # from the Ghostscript ftp site at ftp://ftp.cs.wisc.edu/ghost/
  11. # If you have libjpeg, you probably already have ansi2knr.c in the jpeg
  12. # source distribution.
  13. # where make install puts libpng.a and png.h
  14. prefix=/usr/local
  15. INCPATH=$(prefix)/include
  16. LIBPATH=$(prefix)/lib
  17. # override DESTDIR= on the make install command line to easily support
  18. # installing into a temporary location. Example:
  19. #
  20. # make install DESTDIR=/tmp/build/libpng
  21. #
  22. # If you're going to install into a temporary location
  23. # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
  24. # you execute make install.
  25. DESTDIR=
  26. CC = cc
  27. CPPFLAGS = -I../zlib
  28. CFLAGS = -O
  29. LDFLAGS = -L. -L../zlib/ -lpng -lz -lm
  30. # flags for ansi2knr
  31. ANSI2KNRFLAGS=
  32. RANLIB = ranlib
  33. #RANLIB = echo
  34. OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
  35. pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
  36. pngwtran.o pngmem.o pngerror.o pngpread.o
  37. all: ansi2knr libpng.a pngtest
  38. # see scripts/pnglibconf.mak for more options
  39. pnglibconf.h: scripts/pnglibconf.h.prebuilt
  40. cp scripts/pnglibconf.h.prebuilt $@
  41. # general rule to allow ansi2knr to work
  42. .c.o:
  43. ./ansi2knr $*.c T$*.c
  44. $(CC) $(CPPFLAGS) $(CFLAGS) -c T$*.c
  45. rm -f T$*.c $*.o
  46. mv T$*.o $*.o
  47. ansi2knr: ansi2knr.c
  48. $(CC) $(CPPFLAGS) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
  49. libpng.a: ansi2knr $(OBJS)
  50. ar rc $@ $(OBJS)
  51. $(RANLIB) $@
  52. pngtest: pngtest.o libpng.a
  53. $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
  54. test: pngtest
  55. ./pngtest
  56. install: libpng.a png.h pngconf.h pnglibconf.h
  57. -@mkdir $(DESTDIR)$(INCPATH)
  58. -@mkdir $(DESTDIR)$(INCPATH)/libpng
  59. -@mkdir $(DESTDIR)$(LIBPATH)
  60. -@rm -f $(DESTDIR)$(INCPATH)/png.h
  61. -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
  62. cp png.h $(DESTDIR)$(INCPATH)/libpng
  63. cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
  64. cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
  65. chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
  66. chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
  67. chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
  68. (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
  69. cp libpng.a $(DESTDIR)$(LIBPATH)
  70. chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
  71. clean:
  72. rm -f *.o libpng.a pngtest pngout.png ansi2knr pnglibconf.h
  73. DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
  74. writelock:
  75. chmod a-w *.[ch35] $(DOCS) scripts/*
  76. # DO NOT DELETE THIS LINE -- make depend depends on it.
  77. png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  78. pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  79. pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  80. pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  81. pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  82. pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  83. pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  84. pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  85. pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  86. pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  87. pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  88. pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  89. pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  90. pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  91. pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  92. pngtest.o: png.h pngconf.h pnglibconf.h