makefile.knr 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. # makefile for libpng
  2. # Copyright (C) 2002, 2006, 2009 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. CFLAGS=-I../zlib -O
  28. LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
  29. # flags for ansi2knr
  30. ANSI2KNRFLAGS=
  31. RANLIB=ranlib
  32. #RANLIB=echo
  33. OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
  34. pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
  35. pngwtran.o pngmem.o pngerror.o pngpread.o
  36. all: ansi2knr libpng.a pngtest
  37. # see scripts/pnglibconf.mak for more options
  38. pnglibconf.h: scripts/pnglibconf.h.prebuilt
  39. cp scripts/pnglibconf.h.prebuilt $@
  40. # general rule to allow ansi2knr to work
  41. .c.o:
  42. ./ansi2knr $*.c T$*.c
  43. $(CC) $(CFLAGS) -c T$*.c
  44. rm -f T$*.c $*.o
  45. mv T$*.o $*.o
  46. ansi2knr: ansi2knr.c
  47. $(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
  48. libpng.a: ansi2knr $(OBJS)
  49. ar rc $@ $(OBJS)
  50. $(RANLIB) $@
  51. pngtest: pngtest.o libpng.a
  52. $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
  53. test: pngtest
  54. ./pngtest
  55. install: libpng.a png.h pngconf.h pnglibconf.h
  56. -@mkdir $(DESTDIR)$(INCPATH)
  57. -@mkdir $(DESTDIR)$(INCPATH)/libpng
  58. -@mkdir $(DESTDIR)$(LIBPATH)
  59. -@rm -f $(DESTDIR)$(INCPATH)/png.h
  60. -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
  61. cp png.h $(DESTDIR)$(INCPATH)/libpng
  62. cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
  63. cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
  64. chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
  65. chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
  66. chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
  67. (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
  68. cp libpng.a $(DESTDIR)$(LIBPATH)
  69. chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
  70. clean:
  71. rm -f *.o libpng.a pngtest pngout.png ansi2knr pnglibconf.h
  72. DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
  73. writelock:
  74. chmod a-w *.[ch35] $(DOCS) scripts/*
  75. # DO NOT DELETE THIS LINE -- make depend depends on it.
  76. png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  77. pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  78. pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  79. pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  80. pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  81. pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  82. pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  83. pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  84. pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  85. pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  86. pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  87. pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  88. pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  89. pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  90. pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  91. pngtest.o: png.h pngconf.h pnglibconf.h