Home | History | Annotate | Download | only in scripts
      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 
      9 PREFIX?=        /usr/local
     10 SHLIB_VER?=     16
     11 
     12 LIB=		png
     13 SHLIB_MAJOR=	${SHLIB_VER}
     14 SHLIB_MINOR=	0
     15 NO_PROFILE=	YES
     16 NO_OBJ=          YES
     17 
     18 # where make install puts libpng.a and png.h
     19 DESTDIR=	${PREFIX}
     20 LIBDIR=		/lib
     21 INCS=		png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
     22 INCSDIR=	/include/libpng
     23 INCDIR=		${INCSDIR}		# for 4.x bsd.lib.mk
     24 MAN=		libpng.3 libpngpf.3 png.5
     25 MANDIR=		/man/man
     26 SYMLINKS=       libpng/png.h ${INCSDIR}/../png.h \
     27 		libpng/pngconf.h ${INCSDIR}/../pngconf.h \
     28 		libpng/pnglibconf.h ${INCSDIR}/../pnglibconf.h
     29 
     30 # where make install finds libz.a and zlib.h
     31 ZLIBLIB=	/usr/lib
     32 ZLIBINC=	/usr/include
     33 
     34 LDADD+=		-lm -lz
     35 #LDADD+=	-lm -lz -lssp_nonshared   # for OSVERSION < 800000 ?
     36 
     37 DPADD+=		${LIBM} ${LIBZ}
     38 
     39 CPPFLAGS+=	-I. -I${ZLIBINC}
     40 CFLAGS+=	-W -Wall
     41 
     42 SRCS=	png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
     43 	pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
     44 	pngwtran.c pngmem.c pngerror.c pngpread.c
     45 
     46 .c.o:
     47 	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
     48 
     49 pngtest: pngtest.o libpng.a
     50 	${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -L${ZLIBLIB} \
     51 	-lpng ${LDADD}
     52 
     53 CLEANFILES= pngtest pngtest.o pngout.png
     54 
     55 test: pngtest
     56 	./pngtest
     57 
     58 # see scripts/pnglibconf.mak for more options
     59 pnglibconf.h: scripts/pnglibconf.h.prebuilt
     60 	cp scripts/pnglibconf.h.prebuilt $@
     61 
     62 DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
     63 writelock:
     64 	chmod a-w *.[ch35] $(DOCS) scripts/*
     65 
     66 .include <bsd.lib.mk>
     67