Imported from libpng-1.2.3.tar
diff --git a/scripts/makefile.freebsd b/scripts/makefile.freebsd
index 717e755..d7d5fae 100644
--- a/scripts/makefile.freebsd
+++ b/scripts/makefile.freebsd
@@ -1,107 +1,48 @@
# makefile for libpng under FreeBSD
# Copyright (C) 2002 Glenn Randers-Pehrson and Andrey A. Chernov
-# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# For conditions of distribution and use, see copyright notice in png.h
-.include <bsd.own.mk>
+PREFIX?= /usr/local
+SHLIB_VER?= 5
+
+LIB= png
+SHLIB_MAJOR= ${SHLIB_VER}
+SHLIB_MINOR= 0
+NOPROFILE= YES
+NOOBJ= YES
# where make install puts libpng.a and png.h
-prefix=/usr/local
-INCPATH=$(prefix)/include
-LIBPATH=$(prefix)/lib
-MANPATH=$(prefix)/man
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, that location must already exist before
-# you execute make install.
-DESTDIR=
-
-PNGMAJ= 5
-.if (${OBJFORMAT} == "elf")
-PNGVER= $(PNGMAJ)
-.else
-PNGMIN= 0
-PNGVER= $(PNGMAJ).$(PNGMIN)
-.endif
+DESTDIR= ${PREFIX}
+LIBDIR= /lib
+INCS= png.h pngconf.h
+INCSDIR= /include/libpng
+INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk
+MAN= libpng.3 libpngpf.3 png.5
+MANDIR= /man/man
+SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \
+ libpng/pngconf.h ${INCSDIR}/../pngconf.h
+LDADD+= -lm -lz
+DPADD+= ${LIBM} ${LIBZ}
CFLAGS+= -I. -DPNG_USE_PNGGCCRD
.if (${MACHINE_ARCH} != "i386")
CFLAGS+= -DPNG_NO_ASSEMBLER_CODE
.endif
-LDFLAGS+=-L. -lpng -lz -lm -static
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o pnggccrd.o
-
-.SUFFIXES: .c .so .o
-
-.c.so:
- ${CC} ${CFLAGS} -fPIC -DPIC -o $@ -c $<
-
-all: libpng.a libpng.so.${PNGVER} pngtest
-
-libpng.a: $(OBJS)
- ar rc $@ $(OBJS)
- $(RANLIB) $@
-
-libpng.so.${PNGVER}: $(OBJS:S/o$/so/g)
-.if (${OBJFORMAT} == "elf")
- ${CC} -shared -Wl,-x,-soname,$@ -o $@ $(OBJS:S/o$/so/g) -lz -lm
-.else
- ${CC} -shared -Wl,-x -o $@ $(OBJS:S/o$/so/g) -lz -lm
-.endif
+SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
+ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
+ pngwtran.c pngmem.c pngerror.c pngpread.c pnggccrd.c
pngtest: pngtest.o libpng.a
- $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
+ ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -lpng -lz -lm
+
+CLEANFILES= pngtest pngtest.o pngout.png
test: pngtest
./pngtest
-install: libpng.a libpng.so.${PNGVER}
- -@mkdir $(DESTDIR)$(INCPATH)/libpng
- ${INSTALL} -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} \
- png.h pngconf.h $(DESTDIR)$(INCPATH)/libpng
- (cd $(DESTDIR)$(INCPATH); rm -f png.h pngconf.h; ln -sf libpng/*.h .)
- ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- libpng.a libpng.so.${PNGVER} $(DESTDIR)$(LIBPATH)
- $(RANLIB) $(DESTDIR)$(LIBPATH)/libpng.a
- ln -sf libpng.so.${PNGVER} $(DESTDIR)$(LIBPATH)/libpng.so
- /sbin/ldconfig -R
- ${INSTALL} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
- libpng.3 libpngpf.3 $(DESTDIR)$(MANPATH)/man3
- ${INSTALL} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
- png.5 $(DESTDIR)$(MANPATH)/man5
-
-clean:
- rm -f *.o *.so libpng.a libpng.so.${PNGVER} pngtest pngout.png
-
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
writelock:
chmod a-w *.[ch35] $(DOCS) scripts/*
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-png.o: png.h pngconf.h
-pngerror.o: png.h pngconf.h
-pngrio.o: png.h pngconf.h
-pngwio.o: png.h pngconf.h
-pngmem.o: png.h pngconf.h
-pngset.o: png.h pngconf.h
-pngget.o: png.h pngconf.h
-pngread.o: png.h pngconf.h
-pngrtran.o: png.h pngconf.h
-pngrutil.o: png.h pngconf.h
-pngtest.o: png.h pngconf.h
-pngtrans.o: png.h pngconf.h
-pngwrite.o: png.h pngconf.h
-pngwtran.o: png.h pngconf.h
-pngwutil.o: png.h pngconf.h
-pngpread.o: png.h pngconf.h
-pnggccrd.o: png.h pngconf.h
-
+.include <bsd.lib.mk>