makefile.openbsd 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # makefile for libpng
  2. # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
  3. # Copyright (C) 2007-2009 Glenn Randers-Pehrson
  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. PREFIX?= /usr/local
  9. LIBDIR= ${PREFIX}/lib
  10. MANDIR= ${PREFIX}/man/cat
  11. SHLIB_MAJOR= 15
  12. SHLIB_MINOR= 1.5.9
  13. LIB= png
  14. SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
  15. pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \
  16. pngwio.c pngwrite.c pngwtran.c pngwutil.c
  17. HDRS= png.h pngconf.h pnglibconf.h
  18. CFLAGS+= -W -Wall
  19. CPPFLAGS+= -I${.CURDIR}
  20. NOPROFILE= Yes
  21. CLEANFILES+= pngtest.o pngtest pnglibconf.h
  22. MAN= libpng.3 libpngpf.3 png.5
  23. DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
  24. libpng-manual.txt
  25. # see scripts/pnglibconf.mak for more options
  26. pnglibconf.h: scripts/pnglibconf.h.prebuilt
  27. cp scripts/pnglibconf.h.prebuilt $@
  28. pngtest.o: pngtest.c
  29. ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
  30. pngtest: pngtest.o
  31. ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
  32. test: pngtest
  33. cd ${.OBJDIR} && env \
  34. LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
  35. beforeinstall:
  36. if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
  37. ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \
  38. fi
  39. if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
  40. ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
  41. fi
  42. if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
  43. ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
  44. fi
  45. if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
  46. ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
  47. fi
  48. if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
  49. ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
  50. fi
  51. if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
  52. ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
  53. fi
  54. afterinstall:
  55. @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
  56. @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
  57. @rm -f ${DESTDIR}${PREFIX}/include/png.h
  58. @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
  59. @rm -f ${DESTDIR}${PREFIX}/include/pnglibconf.h
  60. @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
  61. ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
  62. -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
  63. ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
  64. -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
  65. ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
  66. -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
  67. .include <bsd.lib.mk>