|
Packit |
0ba690 |
# makefile for libpng on Darwin / Mac OS X
|
|
Packit |
0ba690 |
# Copyright (C) 2002, 2004, 2006, 2008 Glenn Randers-Pehrson
|
|
Packit |
0ba690 |
# Copyright (C) 2001 Christoph Pfisterer
|
|
Packit |
0ba690 |
# derived from makefile.linux:
|
|
Packit |
0ba690 |
# Copyright (C) 1998, 1999 Greg Roelofs
|
|
Packit |
0ba690 |
# Copyright (C) 1996, 1997 Andreas Dilger
|
|
Packit |
0ba690 |
#
|
|
Packit |
0ba690 |
# This code is released under the libpng license.
|
|
Packit |
0ba690 |
# For conditions of distribution and use, see the disclaimer
|
|
Packit |
0ba690 |
# and license in png.h
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
# where "make install" puts libpng.a, libpng12.dylib, png.h and pngconf.h
|
|
Packit |
0ba690 |
prefix=/usr/local
|
|
Packit |
0ba690 |
exec_prefix=$(prefix)
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
# Where the zlib library and include files are located
|
|
Packit |
0ba690 |
#ZLIBLIB=/usr/local/lib
|
|
Packit |
0ba690 |
#ZLIBINC=/usr/local/include
|
|
Packit |
0ba690 |
ZLIBLIB=../zlib
|
|
Packit |
0ba690 |
ZLIBINC=../zlib
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
# Library name:
|
|
Packit |
0ba690 |
LIBNAME = libpng12
|
|
Packit |
0ba690 |
PNGMAJ = 12
|
|
Packit |
0ba690 |
PNGMIN = 1.2.57
|
|
Packit |
0ba690 |
PNGVER = $(PNGMAJ).$(PNGMIN)
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
# Shared library names:
|
|
Packit |
0ba690 |
LIBSO=$(LIBNAME).dylib
|
|
Packit |
0ba690 |
LIBSOMAJ=$(LIBNAME).$(PNGMAJ).dylib
|
|
Packit |
0ba690 |
LIBSOVER=$(LIBNAME).$(PNGVER).dylib
|
|
Packit |
0ba690 |
OLDSO=libpng.dylib
|
|
Packit |
0ba690 |
OLDSOMAJ=libpng.3.dylib
|
|
Packit |
0ba690 |
OLDSOVER=libpng.3.$(PNGMIN).dylib
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
# Utilities:
|
|
Packit |
0ba690 |
CC=cc
|
|
Packit |
0ba690 |
AR_RC=ar rc
|
|
Packit |
0ba690 |
MKDIR_P=mkdir -p
|
|
Packit |
0ba690 |
LN_SF=ln -sf
|
|
Packit |
0ba690 |
RANLIB=ranlib
|
|
Packit |
0ba690 |
RM_F=/bin/rm -f
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
# CFLAGS=-I$(ZLIBINC) -W -Wall -O3 -funroll-loops -DPNG_NO_MMX_CODE
|
|
Packit |
0ba690 |
CFLAGS=-I$(ZLIBINC) -W -Wall -O -funroll-loops
|
|
Packit |
0ba690 |
LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
INCPATH=$(prefix)/include
|
|
Packit |
0ba690 |
LIBPATH=$(exec_prefix)/lib
|
|
Packit |
0ba690 |
MANPATH=$(prefix)/man
|
|
Packit |
0ba690 |
BINPATH=$(exec_prefix)/bin
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
# override DESTDIR= on the make install command line to easily support
|
|
Packit |
0ba690 |
# installing into a temporary location. Example:
|
|
Packit |
0ba690 |
#
|
|
Packit |
0ba690 |
# make install DESTDIR=/tmp/build/libpng
|
|
Packit |
0ba690 |
#
|
|
Packit |
0ba690 |
# If you're going to install into a temporary location
|
|
Packit |
0ba690 |
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
|
Packit |
0ba690 |
# you execute make install.
|
|
Packit |
0ba690 |
DESTDIR=
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
DB=$(DESTDIR)$(BINPATH)
|
|
Packit |
0ba690 |
DI=$(DESTDIR)$(INCPATH)
|
|
Packit |
0ba690 |
DL=$(DESTDIR)$(LIBPATH)
|
|
Packit |
0ba690 |
DM=$(DESTDIR)$(MANPATH)
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
|
Packit |
0ba690 |
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
|
Packit |
0ba690 |
pngwtran.o pngmem.o pngerror.o pngpread.o
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
OBJSDLL = $(OBJS:.o=.pic.o)
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
.SUFFIXES: .c .o .pic.o
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
.c.pic.o:
|
|
Packit |
0ba690 |
$(CC) -c $(CFLAGS) -fno-common -o $@ $*.c
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
libpng.a: $(OBJS)
|
|
Packit |
0ba690 |
$(AR_RC) $@ $(OBJS)
|
|
Packit |
0ba690 |
$(RANLIB) $@
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
libpng.pc:
|
|
Packit |
0ba690 |
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
|
|
Packit |
0ba690 |
-e s!@exec_prefix@!$(exec_prefix)! \
|
|
Packit |
0ba690 |
-e s!@libdir@!$(LIBPATH)! \
|
|
Packit |
0ba690 |
-e s!@includedir@!$(INCPATH)! \
|
|
Packit |
0ba690 |
-e s!-lpng12!-lpng12\ -lz! > libpng.pc
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
libpng-config:
|
|
Packit |
0ba690 |
( cat scripts/libpng-config-head.in; \
|
|
Packit |
0ba690 |
echo prefix=\"$(prefix)\"; \
|
|
Packit |
0ba690 |
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
|
Packit |
0ba690 |
echo L_opts=\"-L$(LIBPATH)\"; \
|
|
Packit |
0ba690 |
echo libs=\"-lpng12 -lz\"; \
|
|
Packit |
0ba690 |
cat scripts/libpng-config-body.in ) > libpng-config
|
|
Packit |
0ba690 |
chmod +x libpng-config
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
$(LIBSO): $(LIBSOMAJ)
|
|
Packit |
0ba690 |
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
$(LIBSOMAJ): $(LIBSOVER)
|
|
Packit |
0ba690 |
$(LN_SF) $(LIBSOVER) $(LIBSOMAJ)
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
$(LIBSOVER): $(OBJSDLL)
|
|
Packit |
0ba690 |
$(CC) -dynamiclib \
|
|
Packit |
0ba690 |
-install_name $(LIBPATH)/$(LIBSOMAJ) \
|
|
Packit |
0ba690 |
-current_version 0 -compatibility_version 0 \
|
|
Packit |
0ba690 |
-o $(LIBSOVER) \
|
|
Packit |
0ba690 |
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
$(OLDSOVER): $(OBJSDLL)
|
|
Packit |
0ba690 |
$(CC) -dynamiclib \
|
|
Packit |
0ba690 |
-install_name $(LIBPATH)/$(OLDSOMAJ) \
|
|
Packit |
0ba690 |
-current_version 3 -compatibility_version 3 \
|
|
Packit |
0ba690 |
-o $(OLDSOVER) \
|
|
Packit |
0ba690 |
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
pngtest: pngtest.o $(LIBSO)
|
|
Packit |
0ba690 |
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
test: pngtest
|
|
Packit |
0ba690 |
./pngtest
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
install-headers: png.h pngconf.h
|
|
Packit |
0ba690 |
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
|
|
Packit |
0ba690 |
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
|
|
Packit |
0ba690 |
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
|
Packit |
0ba690 |
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
|
Packit |
0ba690 |
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
|
|
Packit |
0ba690 |
-@$(RM_F) $(DI)/libpng
|
|
Packit |
0ba690 |
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
install-static: install-headers libpng.a
|
|
Packit |
0ba690 |
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
|
|
Packit |
0ba690 |
cp libpng.a $(DL)/$(LIBNAME).a
|
|
Packit |
0ba690 |
chmod 644 $(DL)/$(LIBNAME).a
|
|
Packit |
0ba690 |
$(RANLIB) $(DL)/$(LIBNAME).a
|
|
Packit |
0ba690 |
-@$(RM_F) $(DL)/libpng.a
|
|
Packit |
0ba690 |
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
install-shared: install-headers $(LIBSO) libpng.pc \
|
|
Packit |
0ba690 |
$(OLDSOVER)
|
|
Packit |
0ba690 |
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
|
|
Packit |
0ba690 |
-@$(RM_F) $(DL)/$(LIBNAME).$(PNGVER)*.dylib
|
|
Packit |
0ba690 |
-@$(RM_F) $(DL)/$(LIBNAME).$(PNGMAJ)*.dylib
|
|
Packit |
0ba690 |
-@$(RM_F) $(DL)/$(LIBSO)
|
|
Packit |
0ba690 |
-@$(RM_F) $(DL)/$(OLDSO)
|
|
Packit |
0ba690 |
-@$(RM_F) $(DL)/$(OLDSOMAJ)
|
|
Packit |
0ba690 |
-@$(RM_F) $(DL)/libpng.3.$(PNGMIN)*.dylib
|
|
Packit |
0ba690 |
cp $(LIBSOVER) $(DL)
|
|
Packit |
0ba690 |
cp $(OLDSOVER) $(DL)
|
|
Packit |
0ba690 |
chmod 755 $(DL)/$(LIBSOVER)
|
|
Packit |
0ba690 |
chmod 755 $(DL)/$(OLDSOVER)
|
|
Packit |
0ba690 |
(cd $(DL); \
|
|
Packit |
0ba690 |
$(LN_SF) $(OLDSOVER) $(OLDSOMAJ); \
|
|
Packit |
0ba690 |
$(LN_SF) $(OLDSOMAJ) $(OLDSO); \
|
|
Packit |
0ba690 |
$(LN_SF) $(LIBSOVER) $(LIBSOMAJ); \
|
|
Packit |
0ba690 |
$(LN_SF) $(LIBSOMAJ) $(LIBSO))
|
|
Packit |
0ba690 |
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
|
|
Packit |
0ba690 |
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
|
|
Packit |
0ba690 |
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
|
|
Packit |
0ba690 |
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
|
Packit |
0ba690 |
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
|
Packit |
0ba690 |
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
install-man: libpng.3 libpngpf.3 png.5
|
|
Packit |
0ba690 |
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
|
|
Packit |
0ba690 |
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
|
|
Packit |
0ba690 |
-@$(RM_F) $(DM)/man3/libpng.3
|
|
Packit |
0ba690 |
-@$(RM_F) $(DM)/man3/libpngpf.3
|
|
Packit |
0ba690 |
cp libpng.3 $(DM)/man3
|
|
Packit |
0ba690 |
cp libpngpf.3 $(DM)/man3
|
|
Packit |
0ba690 |
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
|
|
Packit |
0ba690 |
-@$(RM_F) $(DM)/man5/png.5
|
|
Packit |
0ba690 |
cp png.5 $(DM)/man5
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
install-config: libpng-config
|
|
Packit |
0ba690 |
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
|
|
Packit |
0ba690 |
-@$(RM_F) $(DB)/libpng-config
|
|
Packit |
0ba690 |
-@$(RM_F) $(DB)/$(LIBNAME)-config
|
|
Packit |
0ba690 |
cp libpng-config $(DB)/$(LIBNAME)-config
|
|
Packit |
0ba690 |
chmod 755 $(DB)/$(LIBNAME)-config
|
|
Packit |
0ba690 |
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
install: install-static install-shared install-man install-config
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
# If you installed in $(DESTDIR), test-installed won't work until you
|
|
Packit |
0ba690 |
# move the library to its final location. Use test-dd to test it
|
|
Packit |
0ba690 |
# before then.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
test-dd:
|
|
Packit |
0ba690 |
echo
|
|
Packit |
0ba690 |
echo Testing installed dynamic shared library in $(DL).
|
|
Packit |
0ba690 |
$(CC) -I$(DI) -I$(ZLIBINC) \
|
|
Packit |
0ba690 |
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
|
|
Packit |
0ba690 |
-L$(DL) -L$(ZLIBLIB) \
|
|
Packit |
0ba690 |
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
|
|
Packit |
0ba690 |
./pngtestd pngtest.png
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
test-installed:
|
|
Packit |
0ba690 |
$(CC) $(CFLAGS) \
|
|
Packit |
0ba690 |
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
|
|
Packit |
0ba690 |
-L$(ZLIBLIB) \
|
|
Packit |
0ba690 |
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
|
|
Packit |
0ba690 |
./pngtesti pngtest.png
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
clean:
|
|
Packit |
0ba690 |
$(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
|
|
Packit |
0ba690 |
$(OLDSOVER) \
|
|
Packit |
0ba690 |
libpng.pc $(LIBNAME).*dylib pngtesti
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
|
Packit |
0ba690 |
writelock:
|
|
Packit |
0ba690 |
chmod a-w *.[ch35] $(DOCS) scripts/*
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
png.o png.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngerror.o pngerror.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngrio.o pngrio.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngwio.o pngwio.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngmem.o pngmem.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngset.o pngset.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngget.o pngget.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngread.o pngread.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngrtran.o pngrtran.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngrutil.o pngrutil.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngtrans.o pngtrans.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngwrite.o pngwrite.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngwtran.o pngwtran.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngwutil.o pngwutil.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
pngpread.o pngpread.pic.o: png.h pngconf.h
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
pngtest.o: png.h pngconf.h
|