makefile.freebsd 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # makefile for libpng under FreeBSD
  2. # Copyright (C) 2014 Glenn Randers-Pehrson and Andrey A. Chernov
  3. # Copyright (C) 2002, 2007, 2009 Glenn Randers-Pehrson and Andrey A. Chernov
  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. SHLIB_VER?= 16
  10. LIB= png
  11. SHLIB_MAJOR= ${SHLIB_VER}
  12. SHLIB_MINOR= 0
  13. NO_PROFILE= YES
  14. NO_OBJ= YES
  15. # where make install puts libpng.a and png.h
  16. DESTDIR= ${PREFIX}
  17. LIBDIR= /lib
  18. INCS= png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  19. INCSDIR= /include/libpng
  20. INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk
  21. MAN= libpng.3 libpngpf.3 png.5
  22. MANDIR= /man/man
  23. SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \
  24. libpng/pngconf.h ${INCSDIR}/../pngconf.h \
  25. libpng/pnglibconf.h ${INCSDIR}/../pnglibconf.h
  26. # where make install finds libz.a and zlib.h
  27. ZLIBLIB= /usr/lib
  28. ZLIBINC= /usr/include
  29. LDADD+= -lm -lz
  30. #LDADD+= -lm -lz -lssp_nonshared # for OSVERSION < 800000 ?
  31. DPADD+= ${LIBM} ${LIBZ}
  32. CPPFLAGS+= -I. -I${ZLIBINC}
  33. CFLAGS+= -W -Wall
  34. # Pre-built configuration
  35. # See scripts/pnglibconf.mak for more options
  36. PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
  37. SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
  38. pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
  39. pngwtran.c pngmem.c pngerror.c pngpread.c
  40. .c.o:
  41. $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
  42. pngtest: pngtest.o libpng.a
  43. ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -L${ZLIBLIB} \
  44. -lpng ${LDADD}
  45. CLEANFILES= pngtest pngtest.o pngout.png
  46. test: pngtest
  47. ./pngtest
  48. pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
  49. cp $(PNGLIBCONF_H_PREBUILT) $@
  50. DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
  51. writelock:
  52. chmod a-w *.[ch35] $(DOCS) scripts/*
  53. .include <bsd.lib.mk>