makefile.knr 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. CP = cp
  35. RM_F = rm -f
  36. # Pre-built configuration
  37. # See scripts/pnglibconf.mak for more options
  38. PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
  39. OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
  40. pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
  41. pngwtran.o pngmem.o pngerror.o pngpread.o
  42. all: ansi2knr libpng.a pngtest
  43. pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
  44. $(CP) $(PNGLIBCONF_H_PREBUILT) $@
  45. # general rule to allow ansi2knr to work
  46. .c.o:
  47. ./ansi2knr $*.c T$*.c
  48. $(CC) $(CPPFLAGS) $(CFLAGS) -c T$*.c
  49. rm -f T$*.c $*.o
  50. mv T$*.o $*.o
  51. ansi2knr: ansi2knr.c
  52. $(CC) $(CPPFLAGS) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
  53. libpng.a: ansi2knr $(OBJS)
  54. ar rc $@ $(OBJS)
  55. $(RANLIB) $@
  56. pngtest: pngtest.o libpng.a
  57. $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
  58. test: pngtest
  59. ./pngtest
  60. install: libpng.a png.h pngconf.h pnglibconf.h
  61. -@mkdir $(DESTDIR)$(INCPATH)
  62. -@mkdir $(DESTDIR)$(INCPATH)/libpng
  63. -@mkdir $(DESTDIR)$(LIBPATH)
  64. -@rm -f $(DESTDIR)$(INCPATH)/png.h
  65. -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
  66. cp png.h $(DESTDIR)$(INCPATH)/libpng
  67. cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
  68. cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
  69. chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
  70. chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
  71. chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
  72. (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
  73. cp libpng.a $(DESTDIR)$(LIBPATH)
  74. chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
  75. clean:
  76. $(RM_F) *.o libpng.a pngtest pngout.png ansi2knr pnglibconf.h
  77. DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
  78. writelock:
  79. chmod a-w *.[ch35] $(DOCS) scripts/*
  80. # DO NOT DELETE THIS LINE -- make depend depends on it.
  81. png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  82. pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  83. pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  84. pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  85. pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  86. pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  87. pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  88. pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  89. pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  90. pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  91. pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  92. pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  93. pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  94. pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  95. pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  96. pngtest.o: png.h pngconf.h pnglibconf.h