makefile.openbsd 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # makefile for libpng
  2. # Copyright (C) 2007-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. PREFIX?= /usr/local
  9. LIBDIR= ${PREFIX}/lib
  10. MANDIR= ${PREFIX}/man/cat
  11. SHLIB_MAJOR= 16
  12. SHLIB_MINOR= 1.6.20
  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. # Pre-built configuration
  26. # See scripts/pnglibconf.mak for more options
  27. PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
  28. .c.o:
  29. $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
  30. pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
  31. cp $(PNGLIBCONF_H_PREBUILT) $@
  32. pngtest.o: pngtest.c
  33. ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
  34. pngtest: pngtest.o
  35. ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
  36. test: pngtest
  37. cd ${.OBJDIR} && env \
  38. LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
  39. beforeinstall:
  40. if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
  41. ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \
  42. fi
  43. if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
  44. ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
  45. fi
  46. if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
  47. ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
  48. fi
  49. if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
  50. ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
  51. fi
  52. if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
  53. ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
  54. fi
  55. if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
  56. ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
  57. fi
  58. afterinstall:
  59. @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
  60. @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
  61. @rm -f ${DESTDIR}${PREFIX}/include/png.h
  62. @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
  63. @rm -f ${DESTDIR}${PREFIX}/include/pnglibconf.h
  64. @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
  65. ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
  66. -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
  67. ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
  68. -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
  69. ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
  70. -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
  71. .include <bsd.lib.mk>