This repository has been archived on 2023-11-11. You can view files and clone it, but cannot push or open issues or pull requests.
libpng/scripts/makefile.freebsd

108 lines
2.9 KiB
Plaintext
Raw Normal View History

2002-04-15 14:25:51 +00:00
# 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
2002-04-27 15:11:25 +00:00
.include <bsd.own.mk>
2002-04-15 14:25:51 +00:00
# where make install puts libpng.a and png.h
prefix=/usr/local
2002-04-27 15:11:25 +00:00
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=
2002-04-15 14:25:51 +00:00
PNGMAJ= 5
.if (${OBJFORMAT} == "elf")
PNGVER= $(PNGMAJ)
.else
PNGMIN= 0
PNGVER= $(PNGMAJ).$(PNGMIN)
.endif
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
pngtest: pngtest.o libpng.a
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
test: pngtest
./pngtest
install: libpng.a libpng.so.${PNGVER}
2002-04-27 15:11:25 +00:00
-@mkdir $(DESTDIR)$(INCPATH)/libpng
2002-04-15 14:25:51 +00:00
${INSTALL} -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} \
2002-04-27 15:11:25 +00:00
png.h pngconf.h $(DESTDIR)$(INCPATH)/libpng
(cd $(DESTDIR)$(INCPATH); rm -f png.h pngconf.h; ln -sf libpng/*.h .)
2002-04-15 14:25:51 +00:00
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
2002-04-27 15:11:25 +00:00
libpng.a libpng.so.${PNGVER} $(DESTDIR)$(LIBPATH)
$(RANLIB) $(DESTDIR)$(LIBPATH)/libpng.a
ln -sf libpng.so.${PNGVER} $(DESTDIR)$(LIBPATH)/libpng.so
2002-04-15 14:25:51 +00:00
/sbin/ldconfig -R
${INSTALL} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
2002-04-27 15:11:25 +00:00
libpng.3 libpngpf.3 $(DESTDIR)$(MANPATH)/man3
2002-04-15 14:25:51 +00:00
${INSTALL} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
2002-04-27 15:11:25 +00:00
png.5 $(DESTDIR)$(MANPATH)/man5
2002-04-15 14:25:51 +00:00
clean:
2002-04-27 15:11:25 +00:00
rm -f *.o *.so libpng.a libpng.so.${PNGVER} pngtest pngout.png
2002-04-15 14:25:51 +00:00
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