scripts: Remove the support for "install" targets from all makefiles

In most of the legacy makefiles (with only a few notable exceptions
such as makefile.linux), the "install" targets have been broken since
libpng-1.5.0beta01. Specifically, the "install-shared" targets produced
incorrect library names, due to a missing symbol in the definition of
the LIBSOREL macro.

Rather than correcting this long-standing and long-untested error, we
decided to remove the support for "make install" altogether, from all
legacy makefiles. Further use of "make install", "make install-static"
or "make install-shared" will fail with an error message.

Going forward, the only tested and supported manners to install libpng
shall be the conventional build and install procedures driven by the
configure script or by the CMake file.
This commit is contained in:
Cosmin Truta 2022-09-18 19:37:40 +03:00
parent 3f991d5092
commit 9b65ad49d3
25 changed files with 280 additions and 2096 deletions

10
INSTALL
View File

@ -192,11 +192,11 @@ test. For more confidence, you can run another test by typing
Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare
your output with the result shown in contrib/pngsuite/README. your output with the result shown in contrib/pngsuite/README.
Most of the makefiles will allow you to run "make install" to Most of the makefiles used to allow you to run "make install" to put
put the library in its final resting place (if you want to the library in its final resting place, but that feature is no longer
do that, run "make install" in the zlib directory first if necessary). supported. The only tested and supported manners to install libpng are
Some also allow you to run "make test-installed" after you have the conventional build and install procedures driven by the configure
run "make install". script or by the CMake file.
VIII. Configuring for DOS and other 16-bit platforms VIII. Configuring for DOS and other 16-bit platforms

View File

@ -4,20 +4,18 @@
# Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson # Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998 Greg Roelofs # Copyright (C) 1998 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger # Copyright (C) 1996, 1997 Andreas Dilger
#
# This code is released under the libpng license. # This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer # For conditions of distribution and use, see the disclaimer
# and license in png.h # and license in png.h
# Library name: # Library name:
LIBNAME=libpng16 LIBNAME=libpng16
PNGMAJ = 16 PNGMAJ=16
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).so LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.so
# Utilities: # Utilities:
CC=cc CC=cc
@ -30,10 +28,6 @@ RM_F=/bin/rm -f
SUN_CC_FLAGS=-fast -xtarget=ultra SUN_CC_FLAGS=-fast -xtarget=ultra
SUN_LD_FLAGS=-fast -xtarget=ultra SUN_LD_FLAGS=-fast -xtarget=ultra
# where make install puts libpng.a, libpng16.so and libpng16/png.h
prefix=/a
exec_prefix=$(prefix)
# Where the zlib library and include files are located # Where the zlib library and include files are located
# Changing these to ../zlib poses a security risk. If you want # Changing these to ../zlib poses a security risk. If you want
# to have zlib in an adjacent directory, specify the full path instead of "..". # to have zlib in an adjacent directory, specify the full path instead of "..".
@ -50,26 +44,6 @@ CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=$(SUN_CC_FLAGS) # $(WARNMORE) -g CFLAGS=$(SUN_CC_FLAGS) # $(WARNMORE) -g
LDFLAGS=$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) libpng.a -lz -lm LDFLAGS=$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) libpng.a -lz -lm
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
@ -84,7 +58,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o: .c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c $(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config all: libpng.a $(LIBSO) pngtest
include scripts/pnglibconf.mak include scripts/pnglibconf.mak
DELETE = $(RM_F) DELETE = $(RM_F)
@ -94,26 +68,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo libdir=\"$(LIBPATH)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo R_opts=\"-R$(LIBPATH)\"; \
echo ccopts=\"-fast -xtarget=ultra\"; \
echo ldopts=\"-fast -xtarget=ultra\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
@ -139,86 +93,21 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest test: pngtest
./pngtest ./pngtest
install-headers: png.h pngconf.h pnglibconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
-@$(RM_F) $(DL)/$(LIBSO) @false
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) $(SUN_CC_FLAGS) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtestd -L$(DL) -R$(DL) `$(BINPATH)/$(LIBNAME)-config --ldflags` \
$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
./pngtestd pngtest.png
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(SUN_CC_FLAGS) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
./pngtesti pngtest.png
clean: clean:
$(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ $(RM_F) *.o libpng.a pngtest pngout.png
libpng-config $(LIBSO) $(LIBSOMAJ)* \ $(RM_F) $(LIBSO) $(LIBSOMAJ)*
libpng.pc
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -4,20 +4,18 @@
# Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson # Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998 Greg Roelofs # Copyright (C) 1998 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger # Copyright (C) 1996, 1997 Andreas Dilger
#
# This code is released under the libpng license. # This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer # For conditions of distribution and use, see the disclaimer
# and license in png.h # and license in png.h
# Library name: # Library name:
LIBNAME=libpng16 LIBNAME=libpng16
PNGMAJ = 16 PNGMAJ=16
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).so LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.so
# Utilities: # Utilities:
CC=cc CC=cc
@ -30,10 +28,6 @@ RM_F=/bin/rm -f
SUN_CC_FLAGS=-fast -xtarget=ultra -xarch=v9 SUN_CC_FLAGS=-fast -xtarget=ultra -xarch=v9
SUN_LD_FLAGS=-fast -xtarget=ultra -xarch=v9 SUN_LD_FLAGS=-fast -xtarget=ultra -xarch=v9
# where make install puts libpng.a, libpng16.so and libpng16/png.h
prefix=/a
exec_prefix=$(prefix)
# Where the zlib library and include files are located # Where the zlib library and include files are located
# Changing these to ../zlib poses a security risk. If you want # Changing these to ../zlib poses a security risk. If you want
# to have zlib in an adjacent directory, specify the full path instead of "..". # to have zlib in an adjacent directory, specify the full path instead of "..".
@ -50,26 +44,6 @@ CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS= $(SUN_CC_FLAGS) # $(WARNMORE) -g CFLAGS= $(SUN_CC_FLAGS) # $(WARNMORE) -g
LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
@ -84,7 +58,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o: .c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c $(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config all: libpng.a $(LIBSO) pngtest
include scripts/pnglibconf.mak include scripts/pnglibconf.mak
DELETE = $(RM_F) DELETE = $(RM_F)
@ -94,26 +68,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo libdir=\"$(LIBPATH)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo R_opts=\"-R$(LIBPATH)\"; \
echo ccopts=\"-fast -xtarget=ultra -xarch=v9\"; \
echo ldopts=\"-fast -xtarget=ultra -xarch=v9\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
@ -139,86 +93,21 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest test: pngtest
./pngtest ./pngtest
install-headers: png.h pngconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
-@$(RM_F) $(DL)/$(LIBSO) @false
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) $(SUN_CC_FLAGS) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtestd -L$(DL) -R$(DL) `$(BINPATH)/$(LIBNAME)-config --ldflags` \
$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
./pngtestd pngtest.png
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(SUN_CC_FLAGS) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
./pngtesti pngtest.png
clean: clean:
$(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ $(RM_F) *.o libpng.a pngtest pngout.png
libpng-config $(LIBSO) $(LIBSOMAJ)* \ $(RM_F) $(LIBSO) $(LIBSOMAJ)*
libpng.pc
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -19,28 +19,10 @@ AR_RC = ar rcs
RANLIB = ranlib RANLIB = ranlib
MKDIR_P = mkdir -p MKDIR_P = mkdir -p
RM_F = rm -f RM_F = rm -f
LN_SF = ln -f -s
LIBNAME = libpng16 LIBNAME = libpng16
PNGMAJ = 16 PNGMAJ = 16
prefix=/usr/local
INCPATH=$(prefix)/include
LIBPATH=$(prefix)/lib
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
WARNMORE = WARNMORE =
CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5 CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
@ -55,7 +37,7 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
all: $(LIBNAME).a pngtest$(E) all: $(LIBNAME).a pngtest
include scripts/pnglibconf.mak include scripts/pnglibconf.mak
REMOVE = $(RM_F) REMOVE = $(RM_F)
@ -65,34 +47,15 @@ $(LIBNAME).a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
test: pngtest$(E) test: pngtest
./pngtest$(E) ./pngtest
pngtest$(E): pngtest.o $(LIBNAME).a pngtest: pngtest.o $(LIBNAME).a
$(LD) -o $@ pngtest.o $(LDFLAGS) $(LD) -o $@ pngtest.o $(LDFLAGS)
install: $(LIBNAME).a install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
-@$(RM_F) $(DI)/$(LIBNAME)/png.h
-@$(RM_F) $(DI)/$(LIBNAME)/pngconf.h
-@$(RM_F) $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h
-@$(RM_F) $(DI)/pngconf.h
-@$(RM_F) $(DI)/pnglibconf.h
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h \
$(DI)/$(LIBNAME)/pngconf.h \
$(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) -r $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-@$(RM_F) $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
cp $(LIBNAME).a $(DL)/$(LIBNAME).a
chmod 644 $(DL)/$(LIBNAME).a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
(cd $(DI); $(LN_SF) libpng/* .;)
clean: clean:
$(RM_F) *.o $(LIBNAME).a pngtest pngout.png pnglibconf.h $(RM_F) *.o $(LIBNAME).a pngtest pngout.png pnglibconf.h

View File

@ -1,4 +1,5 @@
# makefile for libpng # makefile for libpng
# Copyright (C) 2022 Cosmin Truta
# Copyright (C) 2002, 2014 Glenn Randers-Pehrson # Copyright (C) 2002, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# #
@ -9,25 +10,10 @@
# Modified for LC56/ATARI assumes libz.lib is in same dir and uses default # Modified for LC56/ATARI assumes libz.lib is in same dir and uses default
# rules for library management # rules for library management
# #
CPPFLAGS = -I..\zlib CPPFLAGS = -I../zlib
CFLAGS = -O CFLAGS = -O
LBR = png.lib LBR = png.lib
LDFLAGS = -L. -L..\zlib -lpng -lz -lm LDFLAGS = -L. -L../zlib -lpng -lz -lm
# where make install puts libpng.a and png.h
prefix=/usr/local
INCPATH=$(prefix)/include
LIBPATH=$(prefix)/lib
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
@ -54,18 +40,6 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
pngtest.ttp: pngtest.o $(LBR) pngtest.ttp: pngtest.o $(LBR)
$(CC) $(CFLAGS) $(LDFLAGS) -o$@ pngtest.o $(CC) $(CFLAGS) $(LDFLAGS) -o$@ pngtest.o
install: libpng.a install:
-@mkdir $(DESTDIR)$(INCPATH) @echo "The $@ target is no longer supported by this makefile."
-@mkdir $(DESTDIR)$(INCPATH)/libpng @false
-@mkdir $(DESTDIR)$(LIBPATH)
-@rm -f $(DESTDIR)$(INCPATH)/png.h
-@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
-@rm -f $(DESTDIR)$(INCPATH)/pnglibconf.h
cp png.h $(DESTDIR)$(INCPATH)/libpng
cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
(cd $(DESTDIR)$(INCPATH); ln -f -s $(LIBNAME) libpng; \
ln -f -s $(LIBNAME)/* .)

View File

@ -11,13 +11,11 @@
# Library name: # Library name:
LIBNAME=libpng16 LIBNAME=libpng16
PNGMAJ = 16 PNGMAJ=16
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).so LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.so
# Utilities: # Utilities:
CC=gcc CC=gcc
@ -47,29 +45,6 @@ CFLAGS=-O1 -funroll-loops $(ALIGN) -Wall -Wextra -Wundef # $(WARNMORE) -g
# LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz # LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz
LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz # -g LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz # -g
# where make install puts libpng.a, libpng16.so*, and png.h
prefix=/usr/local
exec_prefix=$(prefix)
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
@ -85,7 +60,7 @@ OBJSDLL = $(OBJS)
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@ $(CP) $(PNGLIBCONF_H_PREBUILT) $@
@ -94,28 +69,13 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo libs=\"-lpng16 -lz \"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
cp $(LIBSO)* /boot/home/config/lib cp $(LIBSO)* /boot/home/config/lib
$(LIBSOMAJ): $(OBJSDLL) $(LIBSOMAJ): $(OBJSDLL)
$(CC) -nostart -Wl,-soname,$(LIBSOMAJ) -o \ $(CC) -nostart -Wl,-soname,$(LIBSOMAJ) \
$(LIBSOMAJ) $(OBJSDLL) $(LDFLAGS) -o $(LIBSOMAJ) $(OBJSDLL) $(LDFLAGS)
pngtest: pngtest.o $(LIBSO) pngtest: pngtest.o $(LIBSO)
$(CC) -L$(ZLIBLIB) -L. -lz -lpng16 -o pngtest pngtest.o $(CC) -L$(ZLIBLIB) -L. -lz -lpng16 -o pngtest pngtest.o
@ -123,84 +83,21 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest test: pngtest
./pngtest ./pngtest
install-headers: png.h pngconf.h pnglibconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
-@$(RM_F) $(DL)/$(LIBSO) @false
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) $(CPPFLAGS) $(CFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) -Wl,-rpath $(ZLIBLIB):$(DL) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
$(CC) $(CPPFLAGS) $(CFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtesti pngtest.png
clean: clean:
$(RM_F) *.o libpng.a pngtest pngout.png libpng-config \ $(RM_F) *.o libpng.a pngtest pngout.png
$(LIBSO) $(LIBSOMAJ)* pngtesti \ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
pnglibconf.h libpng.pc
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -10,26 +10,17 @@
# For conditions of distribution and use, see the disclaimer # For conditions of distribution and use, see the disclaimer
# and license in png.h # and license in png.h
# where "make install" puts libpng.a, libpng16.dylib, png.h, pngconf.h,
# and pnglibconf.h
prefix=/usr/local
exec_prefix=$(prefix)
# Where the zlib library and include files are located # Where the zlib library and include files are located
ZLIBLIB=/usr/lib ZLIBLIB=/usr/lib
ZLIBINC=/usr/include ZLIBINC=/usr/include
# Library name: # Library name:
LIBNAME = libpng16 LIBNAME=libpng16
PNGMAJ = 16 PNGMAJ=16
RELEASE = 38
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).dylib LIBSO=$(LIBNAME).dylib
LIBSOMAJ=$(LIBNAME).$(PNGMAJ).dylib LIBSOMAJ=$(LIBNAME).$(PNGMAJ).dylib
LIBSOREL=$(LIBNAME).$(PNGMAJ).$(RELEASE).dylib
OLDSO=libpng.dylib
# Utilities: # Utilities:
CC=cc CC=cc
@ -47,26 +38,6 @@ CPPFLAGS=-I$(ZLIBINC) $(DEFS)
CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
@ -86,7 +57,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o: .c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fno-common -o $@ $*.c $(CC) -c $(CPPFLAGS) $(CFLAGS) -fno-common -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@ $(CP) $(PNGLIBCONF_H_PREBUILT) $@
@ -95,28 +66,11 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo libs=\"-lpng16 -lz\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
$(LIBSOMAJ): $(OBJSDLL) $(LIBSOMAJ): $(OBJSDLL)
$(CC) -dynamiclib \ $(CC) -dynamiclib \
-install_name $(LIBPATH)/$(LIBSOMAJ) \
-current_version 16 -compatibility_version 16 \ -current_version 16 -compatibility_version 16 \
-o $(LIBSOMAJ) \ -o $(LIBSOMAJ) \
$(OBJSDLL) -L$(ZLIBLIB) -lz $(OBJSDLL) -L$(ZLIBLIB) -lz
@ -127,84 +81,21 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest test: pngtest
./pngtest ./pngtest
install-headers: png.h pngconf.h pnglibconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
$(RANLIB) $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
-@$(RM_F) $(DL)/$(LIBSO) @false
-@$(RM_F) $(DL)/$(LIBSOMAJ)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)
chmod 755 $(DL)/$(LIBSOMAJ)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
$(CC) $(CPPFLAGS) $(CFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtesti pngtest.png
clean: clean:
$(RM_F) *.o libpng.a pngtest pngout.png libpng-config \ $(RM_F) *.o libpng.a pngtest pngout.png
libpng.pc $(LIBNAME).*dylib pngtesti pnglibconf.h $(RM_F) $(LIBNAME).*dylib pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -1,4 +1,5 @@
# makefile for libpng on DEC Alpha Unix # makefile for libpng on DEC Alpha Unix
# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 2000-2002, 2006, 2010-2014 Glenn Randers-Pehrson # Copyright (C) 2000-2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# #
@ -7,14 +8,12 @@
# and license in png.h # and license in png.h
# Library name: # Library name:
PNGMAJ = 16 LIBNAME=libpng16
LIBNAME = libpng16 PNGMAJ=16
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).so LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.so
# Utilities: # Utilities:
CC=cc CC=cc
@ -25,29 +24,6 @@ LN_SF=ln -f -s
CP=cp CP=cp
RM_F=/bin/rm -f RM_F=/bin/rm -f
# where make install puts libpng.a and png.h
prefix=/usr/local
exec_prefix=$(prefix)
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Where the zlib library and include files are located # Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib #ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include #ZLIBINC=/usr/local/include
@ -69,7 +45,7 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
all: $(LIBSO) libpng.a pngtest libpng.pc libpng-config all: $(LIBSO) libpng.a pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@ $(CP) $(PNGLIBCONF_H_PREBUILT) $@
@ -78,29 +54,11 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo ccopts=\"-std\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
$(LIBSOMAJ): $(OBJS) $(LIBSOMAJ): $(OBJS)
$(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) \ $(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) -soname $(LIBSOMAJ)
-soname $(LIBSOMAJ)
pngtest: pngtest.o libpng.a pngtest: pngtest.o libpng.a
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
@ -108,86 +66,21 @@ pngtest: pngtest.o libpng.a
test: pngtest test: pngtest
./pngtest ./pngtest
install-headers: png.h pngconf.h pnglibconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@/bin/rm -f $(DI)/libpng
(cd $(DI); $(LN_SF)(LIBNAME) libpng; $(LN_SF)(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
-@/bin/rm -f $(DL)/libpng.a
(cd $(DL); $(LN_SF)(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
-@$(RM_F) $(DL)/$(LIBSO) @false
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@/bin/rm -f $(DM)/man3/libpng.3
-@/bin/rm -f $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@/bin/rm -f $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@/bin/rm -f $(DB)/libpng-config
-@/bin/rm -f $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF)(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -w1 -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) -w1 $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) -R$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtesti pngtest.png
clean: clean:
$(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ $(RM_F) *.o libpng.a pngtest pngout.png
libpng-config $(LIBSO) $(LIBSOMAJ)* \ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
libpng.pc pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -7,12 +7,6 @@
# For conditions of distribution and use, see the disclaimer # For conditions of distribution and use, see the disclaimer
# and license in png.h # and license in png.h
# where make install will put libpng.a and png.h
#prefix=/usr/local
prefix=.
INCPATH=$(prefix)/include
LIBPATH=$(prefix)/lib
CC=gcc CC=gcc
CPPFLAGS=-I../zlib -DPNG_NO_SNPRINTF CPPFLAGS=-I../zlib -DPNG_NO_SNPRINTF
CFLAGS=-O CFLAGS=-O
@ -47,6 +41,11 @@ pngtest: pngtest.o libpng.a
test: pngtest test: pngtest
./pngtest ./pngtest
install:
@echo "The $@ target is no longer supported by this makefile."
@false
clean: clean:
$(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h $(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h

View File

@ -7,28 +7,11 @@
# For conditions of distribution and use, see the disclaimer # For conditions of distribution and use, see the disclaimer
# and license in png.h # and license in png.h
PREFIX?= /usr/local
SHLIB_VER?= 16
LIB= png LIB= png
SHLIB_VER= 16
SHLIB_MAJOR= ${SHLIB_VER} SHLIB_MAJOR= ${SHLIB_VER}
SHLIB_MINOR= 0 SHLIB_MINOR= 0
NO_PROFILE= YES
NO_OBJ= YES
# where make install puts libpng.a and png.h
DESTDIR= ${PREFIX}
LIBDIR= /lib
INCS= png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.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 \
libpng/pnglibconf.h ${INCSDIR}/../pnglibconf.h
# where make install finds libz.a and zlib.h
ZLIBLIB= /usr/lib ZLIBLIB= /usr/lib
ZLIBINC= /usr/include ZLIBINC= /usr/include
@ -39,6 +22,9 @@ DPADD+= ${LIBM} ${LIBZ}
CPPFLAGS+= -I. -I${ZLIBINC} CPPFLAGS+= -I. -I${ZLIBINC}
CFLAGS+= -Wall -Wextra -Wundef CFLAGS+= -Wall -Wextra -Wundef
LDFLAGS+= -L. -L${ZLIBLIB}
CLEANFILES+= pngtest pngtest.o pngout.png
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
@ -49,18 +35,19 @@ SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< ${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $<
pngtest: pngtest.o libpng.a pnglibconf.h: ${PNGLIBCONF_H_PREBUILT}
${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -L${ZLIBLIB} \ cp ${PNGLIBCONF_H_PREBUILT} $@
-lpng ${LDADD}
CLEANFILES= pngtest pngtest.o pngout.png pngtest: pngtest.o libpng.a
${CC} ${LDFLAGS} -static -o pngtest pngtest.o -lpng ${LDADD}
test: pngtest test: pngtest
./pngtest ./pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) install:
cp $(PNGLIBCONF_H_PREBUILT) $@ @echo "The $@ target is no longer supported by this makefile."
@false
.include <bsd.lib.mk> .include <bsd.lib.mk>

View File

@ -20,14 +20,12 @@ ZLIBINC=/opt/zlib/include
# SHAREDLIB=libz.sl # SHAREDLIB=libz.sl
# Library name: # Library name:
LIBNAME = libpng16 LIBNAME=libpng16
PNGMAJ = 16 PNGMAJ=16
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).sl LIBSO=$(LIBNAME).sl
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.sl
# Utilities: # Utilities:
CC=cc CC=cc
@ -46,29 +44,6 @@ CCFLAGS=-O -Ae -Wl,+vnocompatwarnings +DD64 +Z
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
# where make install puts libpng.a, libpng16.sl, and png.h
prefix=/opt/libpng
exec_prefix=$(prefix)
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
@ -87,7 +62,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o: .c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) +z -o $@ $*.c $(CC) -c $(CPPFLAGS) $(CFLAGS) +z -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@ $(CP) $(PNGLIBCONF_H_PREBUILT) $@
@ -96,23 +71,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo ccopts=\"-O -Ae -Wl,+vnocompatwarnings +DD64 +Z\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
@ -126,86 +84,21 @@ pngtest: pngtest.o libpng.a
test: pngtest test: pngtest
./pngtest ./pngtest
install-headers: png.h pngconf.h pnglibconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
-@$(RM_F) $(DL)/$(LIBSO) @false
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) $(CPPFLAGS) $(CCFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(CPPFLAGS) $(CCFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtesti pngtest.png
clean: clean:
$(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ $(RM_F) *.o libpng.a pngtest pngout.png
libpng-config $(LIBSO) $(LIBSOMAJ)* \ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
libpng.pc pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -10,14 +10,12 @@
# and license in png.h # and license in png.h
# Library name: # Library name:
LIBNAME = libpng16 LIBNAME=libpng16
PNGMAJ = 16 PNGMAJ=16
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).sl LIBSO=$(LIBNAME).sl
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.sl
# Utilities: # Utilities:
CC=gcc CC=gcc
@ -29,11 +27,6 @@ LN_SF=ln -sf
CP=cp CP=cp
RM_F=/bin/rm -f RM_F=/bin/rm -f
# where "make install" puts libpng.a, $(OLDSO)*, png.h, pngconf.h
# and pnglibconf.h
prefix=/usr/local
exec_prefix=$(prefix)
# Where the zlib library and include files are located # Where the zlib library and include files are located
ZLIBLIB=/opt/zlib/lib ZLIBLIB=/opt/zlib/lib
ZLIBINC=/opt/zlib/include ZLIBINC=/opt/zlib/include
@ -54,26 +47,6 @@ CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g
#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g #LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
@ -88,27 +61,12 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o: .c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c $(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config all: libpng.a $(LIBSO) pngtest
libpng.a: $(OBJS) libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
@ -122,87 +80,21 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest test: pngtest
./pngtest ./pngtest
install:
@echo "The $@ target is no longer supported by this makefile."
@false
install-headers: png.h pngconf.h pnglibconf.h install-static:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
-@$(RM_F) $(DL)/$(LIBSO)
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) -Wl,-rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtesti pngtest.png
clean: clean:
$(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ $(RM_F) *.o libpng.a pngtest pngout.png
libpng-config $(LIBSO) $(LIBSOMAJ)* \ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
libpng.pc pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -21,14 +21,12 @@ ZLIBINC=/opt/zlib/include
# SHAREDLIB=libz.sl # SHAREDLIB=libz.sl
# Library name: # Library name:
LIBNAME = libpng16 LIBNAME=libpng16
PNGMAJ = 16 PNGMAJ=16
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).sl LIBSO=$(LIBNAME).sl
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.sl
# Utilities: # Utilities:
CC=cc CC=cc
@ -38,35 +36,12 @@ MKDIR_P=mkdir -p
LN_SF=ln -sf LN_SF=ln -sf
RM_F=/bin/rm -f RM_F=/bin/rm -f
# where make install puts libpng.a, libpng16.sl, and png.h
prefix=/opt/libpng
exec_prefix=$(prefix)
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
CPPFLAGS=-I$(ZLIBINC) CPPFLAGS=-I$(ZLIBINC)
CFLAGS=-O -Ae +DA1.1 +DS2.0 CFLAGS=-O -Ae +DA1.1 +DS2.0
# Caution: be sure you have built zlib with the same CFLAGS. # Caution: be sure you have built zlib with the same CFLAGS.
CCFLAGS=-O -Ae +DA1.1 +DS2.0 CCFLAGS=-O -Ae +DA1.1 +DS2.0
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
@ -85,7 +60,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o: .c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) +z -o $@ $*.c $(CC) -c $(CPPFLAGS) $(CFLAGS) +z -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@ $(CP) $(PNGLIBCONF_H_PREBUILT) $@
@ -94,23 +69,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo ccopts=\"-O -Ae +DA1.1 +DS2.0\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
@ -124,86 +82,21 @@ pngtest: pngtest.o libpng.a
test: pngtest test: pngtest
./pngtest ./pngtest
install-headers: png.h pngconf.h pnglibconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
-@$(RM_F) $(DL)/$(LIBSO) @false
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) $(CPPFLAGS) $(CCFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(CPPFLAGS) $(CCFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtesti pngtest.png
clean: clean:
$(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ $(RM_F) *.o libpng.a pngtest pngout.png
libpng-config $(LIBSO) $(LIBSOMAJ)* \ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
libpng.pc pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -9,15 +9,12 @@
# and license in png.h # and license in png.h
# Library name: # Library name:
LIBNAME = libpng16 LIBNAME=libpng16
PNGMAJ = 16 PNGMAJ=16
RELEASE = 38
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).so LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.so
# Utilities: # Utilities:
CC=gcc CC=gcc
@ -28,12 +25,6 @@ LN_SF=ln -sf
CP=cp CP=cp
RM_F=rm -f RM_F=rm -f
# where "make install" puts libpng16.a, libpng16.so*,
# libpng16/png.h, libpng16/pngconf.h, and libpng16/pnglibconf.h
# Prefix must be a full pathname.
prefix=/usr/local
exec_prefix=$(prefix)
# Where the zlib library and include files are located. # Where the zlib library and include files are located.
#ZLIBLIB=/usr/local/lib #ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include #ZLIBINC=/usr/local/include
@ -52,26 +43,6 @@ CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g
LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g
LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm # -g LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm # -g
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
@ -91,7 +62,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o: .c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c $(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config all: libpng.a $(LIBSO) pngtest pngtest-static
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@ $(CP) $(PNGLIBCONF_H_PREBUILT) $@
@ -100,23 +71,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
@ -139,87 +93,22 @@ test: pngtest pngtest-static
@echo "" @echo ""
./pngtest-static ./pngtest-static
install-headers: png.h pngconf.h pnglibconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
-@$(RM_F) $(DL)/$(LIBSO) @false
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) -Wl, -rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtesti pngtest.png
clean: clean:
$(RM_F) $(OBJS) $(OBJSDLL) libpng.a $(RM_F) $(OBJS) $(OBJSDLL) libpng.a
$(RM_F) pngtest*.o pngtest pngtesti pngtest-static pngout.png $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
$(RM_F) $(LIBSO) $(LIBSOMAJ)* $(RM_F) pngtest*.o pngtest pngtest-static pngout.png
$(RM_F) libpng.pc pnglibconf.h libpng-config
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -7,32 +7,16 @@
# For conditions of distribution and use, see the disclaimer # For conditions of distribution and use, see the disclaimer
# and license in png.h # and license in png.h
# where make install puts libpng.a and png.h
prefix=/usr/local
INCPATH=$(prefix)/include
LIBPATH=$(prefix)/lib
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
CC=cc CC=cc
CPPFLAGS=-I../zlib -DSYSV -Dmips CPPFLAGS=-I../zlib -DSYSV -Dmips
CFLAGS=-O -systype sysv -w CFLAGS=-O -systype sysv -w
#CFLAGS=-O #CFLAGS=-O
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
AR_RC=ar rc
#RANLIB=ranlib #RANLIB=ranlib
RANLIB=echo RANLIB=echo
CP=cp
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
@ -47,10 +31,10 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
all: libpng.a pngtest all: libpng.a pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@ cp $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS) libpng.a: $(OBJS)
ar rc $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
pngtest: pngtest.o libpng.a pngtest: pngtest.o libpng.a
@ -59,22 +43,9 @@ pngtest: pngtest.o libpng.a
test: pngtest test: pngtest
./pngtest ./pngtest
install: libpng.a install:
-@mkdir $(DESTDIR)$(INCPATH) @echo "The $@ target is no longer supported by this makefile."
-@mkdir $(DESTDIR)$(INCPATH)/libpng @false
-@mkdir $(DESTDIR)$(LIBPATH)
-@rm -f $(DESTDIR)$(INCPATH)/png.h
-@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
-@rm -f $(DESTDIR)$(INCPATH)/pnglibconf.h
cp png.h $(DESTDIR)$(INCPATH)/libpng
cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
(cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
cp libpng.a $(DESTDIR)$(LIBPATH)
chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
clean: clean:
rm -f *.o libpng.a pngtest pngout.png pnglibconf.h rm -f *.o libpng.a pngtest pngout.png pnglibconf.h

View File

@ -12,20 +12,14 @@
# This code is released under the libpng license. # This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer # For conditions of distribution and use, see the disclaimer
# and license in png.h # and license in png.h
# # # # # # # # # # # # # # # # #
prefix=/usr/local
exec_prefix=$(prefix)
# Library name: # Library name:
LIBNAME = libpng16 LIBNAME=libpng16
PNGMAJ = 16 PNGMAJ=16
RELEASE = 38
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).dll LIBSO=$(LIBNAME).dll
LIBSOMAJ=$(LIBNAME).dll.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).dll.$(PNGMAJ)
LIBSOREL=$(PNGMAJ).$(RELEASE)
OLDSO=libpng.dll
# Where the zlib library and include files are located. # Where the zlib library and include files are located.
#ZLIBLIB=../zlib #ZLIBLIB=../zlib
@ -51,26 +45,6 @@ LIBS = -lz -lm
# File extensions # File extensions
EXEEXT=.exe EXEEXT=.exe
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
@ -104,69 +78,17 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
install-headers: png.h pngconf.h pnglibconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
libpng.pc: install-shared:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \ @echo "The $@ target is no longer supported by this makefile."
-e s!@exec_prefix@!$(exec_prefix)! \ @false
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
install-shared: install-headers $(LIBSOMAJ) libpng.pc
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
-@$(RM_F) $(DL)/$(LIBSO)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSO) $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
test: pngtest$(EXEEXT) test: pngtest$(EXEEXT)
./pngtest$(EXEEXT) ./pngtest$(EXEEXT)
@ -176,9 +98,8 @@ pngtest$(EXEEXT): pngtest.o libpng.a
clean: clean:
$(RM_F) $(OBJS) libpng.a $(RM_F) $(OBJS) libpng.a
$(RM_F) $(LIBSO) $(LIBSOMAJ) pnglibconf.h
$(RM_F) pngtest*.o pngtest$(EXEEXT) pngout.png $(RM_F) pngtest*.o pngtest$(EXEEXT) pngout.png
$(RM_F) $(LIBSO) $(LIBSOMAJ)
$(RM_F) libpng.pc pnglibconf.h libpng-config
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h

View File

@ -1,29 +1,25 @@
# makefile for libpng for NetBSD for the standard # makefile for libpng on NetBSD
# make obj && make depend && make && make test # Copyright (C) 2020-2022 Cosmin Truta
# make includes && make install
# Copyright (C) 2002 Patrick R.L. Welche
# Copyright (C) 2007-2009, 2014 Glenn Randers-Pehrson # Copyright (C) 2007-2009, 2014 Glenn Randers-Pehrson
# Copyright (C) 2002 Patrick R.L. Welche
# #
# This code is released under the libpng license. # This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer # For conditions of distribution and use, see the disclaimer
# and license in png.h # and license in png.h
LOCALBASE?=/usr/local
LIBDIR= ${LOCALBASE}/lib
MANDIR= ${LOCALBASE}/man
INCSDIR=${LOCALBASE}/include
SHLIB_MAJOR= 16 SHLIB_MAJOR= 16
SHLIB_MINOR= 1.6.38 SHLIB_MINOR= 0
LIB= png LIB= png
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \ SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c \ pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c \
pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c
INCS= png.h pngconf.h pnglibconf.h INCS= png.h pngconf.h pnglibconf.h
MAN= libpng.3 libpngpf.3 png.5
CPPFLAGS+=-I${.CURDIR} CPPFLAGS+= -I${.CURDIR}
CFLAGS+= -Wall -Wextra -Wundef
CLEANFILES+= pngtest.o pngtest pnglibconf.h
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
@ -35,12 +31,10 @@ PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
# MKLINT= no # MKLINT= no
# .endif # .endif
CLEANFILES+=pngtest.o pngtest pnglibconf.h
.c.o: .c.o:
${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $< ${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $<
pnglibconf.h: ${PNGLIBCONF_H_PREBUILT} pnglibconf.h: ${PNGLIBCONF_H_PREBUILT}
cp ${PNGLIBCONF_H_PREBUILT} $@ cp ${PNGLIBCONF_H_PREBUILT} $@
pngtest.o: pngtest.c pngtest.o: pngtest.c
@ -50,6 +44,10 @@ pngtest: pngtest.o libpng.a
${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -lz -lm ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -lz -lm
test: pngtest test: pngtest
cd ${.CURDIR} && ${.OBJDIR}/pngtest ./pngtest
install:
@echo "The $@ target is no longer supported by this makefile."
@false
.include <bsd.lib.mk> .include <bsd.lib.mk>

View File

@ -7,28 +7,19 @@
# For conditions of distribution and use, see the disclaimer # For conditions of distribution and use, see the disclaimer
# and license in png.h # and license in png.h
PREFIX?= /usr/local
LIBDIR= ${PREFIX}/lib
MANDIR= ${PREFIX}/man/cat
SHLIB_MAJOR= 16 SHLIB_MAJOR= 16
SHLIB_MINOR= 1.6.38 SHLIB_MINOR= 0
LIB= png LIB= png
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \ SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c \ pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c \
pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c
HDRS= png.h pngconf.h pnglibconf.h HDRS= png.h pngconf.h pnglibconf.h
MAN= libpng.3 libpngpf.3 png.5
DOCS= ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO \
libpng-manual.txt
CFLAGS+= -Wall -Wextra -Wundef CPPFLAGS+= -I${.CURDIR}
CPPFLAGS+= -I${.CURDIR} CFLAGS+= -Wall -Wextra -Wundef
NOPROFILE= Yes CLEANFILES+= pngtest.o pngtest pnglibconf.h
CLEANFILES+= pngtest.o pngtest pnglibconf.h
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
@ -37,7 +28,7 @@ PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
.c.o: .c.o:
${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $< ${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $<
pnglibconf.h: ${PNGLIBCONF_H_PREBUILT} pnglibconf.h: ${PNGLIBCONF_H_PREBUILT}
cp ${PNGLIBCONF_H_PREBUILT} $@ cp ${PNGLIBCONF_H_PREBUILT} $@
pngtest.o: pngtest.c pngtest.o: pngtest.c
@ -47,41 +38,10 @@ pngtest: pngtest.o
${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
test: pngtest test: pngtest
cd ${.OBJDIR} && env \ env LD_LIBRARY_PATH="${.OBJDIR}" ./pngtest
LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
beforeinstall: install:
if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \ @echo "The $@ target is no longer supported by this makefile."
${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \ @false
fi
if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
fi
if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
fi
if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
fi
if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
fi
if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
fi
afterinstall:
@rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
@rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
@rm -f ${DESTDIR}${PREFIX}/include/png.h
@rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
@rm -f ${DESTDIR}${PREFIX}/include/pnglibconf.h
@rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
-m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
-m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
-m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
.include <bsd.lib.mk> .include <bsd.lib.mk>

View File

@ -11,14 +11,12 @@
# and license in png.h # and license in png.h
# Library name: # Library name:
LIBNAME = libpng16 LIBNAME=libpng16
PNGMAJ = 16 PNGMAJ=16
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).so LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.so
# Utilities: # Utilities:
CC=cc CC=cc
@ -29,10 +27,6 @@ LN_SF=ln -f -s
CP=cp CP=cp
RM_F=/bin/rm -f RM_F=/bin/rm -f
# where make install puts libpng.a, $(OLDSO)*, and png.h
prefix=/usr/local
exec_prefix=$(prefix)
# Where the zlib library and include files are located # Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib #ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include #ZLIBINC=/usr/local/include
@ -43,26 +37,6 @@ CPPFLAGS=-I$(ZLIBINC)
CFLAGS= -dy -belf -O3 CFLAGS= -dy -belf -O3
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
@ -81,7 +55,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o: .c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c $(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@ $(CP) $(PNGLIBCONF_H_PREBUILT) $@
@ -90,23 +64,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo ccopts=\"-belf\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
@ -120,87 +77,21 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest test: pngtest
./pngtest ./pngtest
install-headers: png.h pngconf.h pnglibconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
-@$(RM_F) $(DI)/png.h
-@$(RM_F) $(DI)/pngconf.h
-@$(RM_F) $(DI)/pnglibconf.h
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
-@$(RM_F) $(DL)/$(LIBSO) @false
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
$(CC) $(CPPFLAGS) $(CFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtesti pngtest.png
clean: clean:
$(RM_F) *.o libpng.a pngtest pngout.png libpng-config \ $(RM_F) *.o libpng.a pngtest pngout.png
$(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pngtest-static pnglibconf.h
pnglibconf.h libpng.pc
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -9,13 +9,11 @@
# Library name: # Library name:
LIBNAME=libpng16 LIBNAME=libpng16
PNGMAJ = 16 PNGMAJ=16
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).so LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.so
# Utilities: # Utilities:
CC=gcc CC=gcc
@ -26,12 +24,6 @@ LN_SF=ln -sf
CP=cp CP=cp
RM_F=/bin/rm -f RM_F=/bin/rm -f
# Where make install puts libpng.a, libpng16.so, and libpng16/png.h
# Prefix must be a full pathname.
prefix=/usr/local
exec_prefix=$(prefix)
# Where the zlib library and include files are located # Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib32 #ZLIBLIB=/usr/local/lib32
#ZLIBINC=/usr/local/include #ZLIBINC=/usr/local/include
@ -52,27 +44,6 @@ LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
-set_version sgi$(PNGMAJ).0 -set_version sgi$(PNGMAJ).0
# See "man dso" for info about shared objects # See "man dso" for info about shared objects
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
#LIBPATH=$(exec_prefix)/lib32
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
@ -84,7 +55,7 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
all: libpng.a pngtest shared libpng.pc libpng-config all: libpng.a pngtest shared
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@ $(CP) $(PNGLIBCONF_H_PREBUILT) $@
@ -95,26 +66,6 @@ libpng.a: $(OBJS)
shared: $(LIBSOMAJ) shared: $(LIBSOMAJ)
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo ccopts=\"$(ABI)\"; \
echo cppflags=\"\"; \
echo ldopts=\"$(ABI)\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo libdir=\"$(LIBPATH)\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
@ -130,87 +81,21 @@ test: pngtest
echo Testing local static library. echo Testing local static library.
./pngtest ./pngtest
install-headers: png.h pngconf.h pnglibconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
-@$(RM_F) $(DL)/$(LIBSO) @false
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-rpath $(ZLIBLIB):$(DL) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) \
-rpath $(ZLIBLIB):`$(BINPATH)/$(LIBNAME)-config --libdir` \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtesti pngtest.png
clean: clean:
$(RM_F) libpng.a pngtest pngtesti pngout.png libpng.pc \ $(RM_F) libpng.a pngtest pngout.png
so_locations libpng-config $(LIBSO) $(LIBSOMAJ)* pnglibconf.h $(RM_F) so_locations $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -9,13 +9,11 @@
# Library name: # Library name:
LIBNAME=libpng16 LIBNAME=libpng16
PNGMAJ = 16 PNGMAJ=16
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).so LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.so
# Utilities: # Utilities:
CC=cc CC=cc
@ -26,12 +24,6 @@ LN_SF=ln -sf
CP=cp CP=cp
RM_F=/bin/rm -f RM_F=/bin/rm -f
# Where make install puts libpng.a, libpng16.so, and libpng16/png.h
# Prefix must be a full pathname.
prefix=/usr/local
exec_prefix=$(prefix)
# Where the zlib library and include files are located # Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib32 #ZLIBLIB=/usr/local/lib32
#ZLIBINC=/usr/local/include #ZLIBINC=/usr/local/include
@ -55,27 +47,6 @@ LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
-set_version sgi$(PNGMAJ).0 -set_version sgi$(PNGMAJ).0
# See "man dso" for info about shared objects # See "man dso" for info about shared objects
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
#LIBPATH=$(exec_prefix)/lib32
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
@ -87,7 +58,7 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
all: libpng.a pngtest shared libpng.pc libpng-config all: libpng.a pngtest shared
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@ $(CP) $(PNGLIBCONF_H_PREBUILT) $@
@ -96,25 +67,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo ccopts=\"$(ABI)\"; \
echo ldopts=\"$(ABI)\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo libdir=\"$(LIBPATH)\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
@ -130,88 +82,21 @@ test: pngtest
echo Testing local static library. echo Testing local static library.
./pngtest ./pngtest
install-headers: png.h pngconf.h pnglibconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
-@$(RM_F) $(DL)/$(LIBSO) @false
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-rpath $(ZLIBLIB):$(DL) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) \
-rpath $(ZLIBLIB):`$(BINPATH)/$(LIBNAME)-config --libdir` \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtesti pngtest.png
clean: clean:
$(RM_F) *.o libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \ $(RM_F) *.o libpng.a pngtest pngout.png
$(LIBSO) $(LIBSOMAJ)* \ $(RM_F) $(LIBSO) $(LIBSOMAJ)* so_locations pnglibconf.h
so_locations pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -11,14 +11,12 @@
# and license in png.h # and license in png.h
# Library name: # Library name:
PNGMAJ = 16 LIBNAME=libpng16
LIBNAME = libpng16 PNGMAJ=16
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).so LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.so
# Utilities: # Utilities:
# gcc 2.95 doesn't work. # gcc 2.95 doesn't work.
@ -30,10 +28,6 @@ LN_SF=ln -f -s
CP=cp CP=cp
RM_F=/bin/rm -f RM_F=/bin/rm -f
# Where make install puts libpng.a, $(OLDSO)*, and png.h
prefix=/usr/local
exec_prefix=$(prefix)
# Where the zlib library and include files are located # Where the zlib library and include files are located
# Changing these to ../zlib poses a security risk. If you want # Changing these to ../zlib poses a security risk. If you want
# to have zlib in an adjacent directory, specify the full path instead of "..". # to have zlib in an adjacent directory, specify the full path instead of "..".
@ -49,26 +43,6 @@ CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=-O3 CFLAGS=-O3
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
@ -87,7 +61,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o: .c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c $(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@ $(CP) $(PNGLIBCONF_H_PREBUILT) $@
@ -96,23 +70,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo R_opts=\"-R$(LIBPATH)\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
@ -138,86 +95,21 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest test: pngtest
./pngtest ./pngtest
install-headers: png.h pngconf.h pnglibconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
-@$(RM_F) $(DL)/$(LIBSO) @false
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags` \
-L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL)
./pngtestd pngtest.png
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
-L$(ZLIBLIB) -R$(ZLIBLIB)
./pngtesti pngtest.png
clean: clean:
$(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ $(RM_F) *.o libpng.a pngtest pngout.png
libpng-config $(LIBSO) $(LIBSOMAJ)* \ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
libpng.pc pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -10,14 +10,12 @@
# and license in png.h # and license in png.h
# Library name: # Library name:
LIBNAME = libpng16 LIBNAME=libpng16
PNGMAJ = 16 PNGMAJ=16
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).so LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.so
# Utilities: # Utilities:
CC=gcc CC=gcc
@ -28,10 +26,6 @@ LN_SF=ln -f -s
CP=cp CP=cp
RM_F=/bin/rm -f RM_F=/bin/rm -f
# Where make install puts libpng.a, libpng16.so*, and png.h
prefix=/usr/local
exec_prefix=$(prefix)
# Where the zlib library and include files are located # Where the zlib library and include files are located
# Changing these to ../zlib poses a security risk. If you want # Changing these to ../zlib poses a security risk. If you want
# to have zlib in an adjacent directory, specify the full path instead of "..". # to have zlib in an adjacent directory, specify the full path instead of "..".
@ -48,26 +42,6 @@ CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=-O -Wall -Wextra -Wundef # $(WARNMORE) -g CFLAGS=-O -Wall -Wextra -Wundef # $(WARNMORE) -g
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm # -g LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm # -g
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration # Pre-built configuration
# See scripts/pnglibconf.mak for more options # See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
@ -86,7 +60,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o: .c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c $(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@ $(CP) $(PNGLIBCONF_H_PREBUILT) $@
@ -95,24 +69,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS) $(AR_RC) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo cppflags=\"\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo R_opts=\"-R$(LIBPATH)\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ) $(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO) $(LN_SF) $(LIBSOMAJ) $(LIBSO)
@ -138,86 +94,21 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest test: pngtest
./pngtest ./pngtest
install-headers: png.h pngconf.h pnglibconf.h install:
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi @echo "The $@ target is no longer supported by this makefile."
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi @false
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a install-static:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
cp libpng.a $(DL)/$(LIBNAME).a @false
chmod 644 $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc install-shared:
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi @echo "The $@ target is no longer supported by this makefile."
-@$(RM_F) $(DL)/$(LIBSO) @false
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags` \
-L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL)
./pngtestd pngtest.png
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
-L$(ZLIBLIB) -R$(ZLIBLIB)
./pngtesti pngtest.png
clean: clean:
$(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ $(RM_F) *.o libpng.a pngtest pngout.png
libpng-config $(LIBSO) $(LIBSOMAJ)* \ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
libpng.pc pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -7,21 +7,6 @@
# For conditions of distribution and use, see the disclaimer # For conditions of distribution and use, see the disclaimer
# and license in png.h # and license in png.h
# where make install puts libpng.a and png.h
prefix=/usr/local
INCPATH=$(prefix)/include
LIBPATH=$(prefix)/lib
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
# Where the zlib library and include files are located # Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib #ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include #ZLIBINC=/usr/local/include
@ -34,8 +19,6 @@ LD = $(CC)
AR_RC = ar rc AR_RC = ar rc
RANLIB = ranlib RANLIB = ranlib
MKDIR_P = mkdir MKDIR_P = mkdir
LN_SF = ln -sf
CP = cp
MV_F = mv -f MV_F = mv -f
RM_F = rm -f RM_F = rm -f
AWK = awk AWK = awk
@ -92,22 +75,9 @@ pngtest: pngtest.o libpng.a
test: pngtest test: pngtest
./pngtest ./pngtest
install: libpng.a pnglibconf.h install:
-@$(MKDIR_P) $(DESTDIR)$(INCPATH) @echo "The $@ target is no longer supported by this makefile."
-@$(MKDIR_P) $(DESTDIR)$(INCPATH)/libpng @false
-@$(MKDIR_P) $(DESTDIR)$(LIBPATH)
-@$(RM_F) $(DESTDIR)$(INCPATH)/png.h
-@$(RM_F) $(DESTDIR)$(INCPATH)/pngconf.h
-@$(RM_F) $(DESTDIR)$(INCPATH)/pnglibconf.h
cp png.h $(DESTDIR)$(INCPATH)/libpng
cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
(cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
cp libpng.a $(DESTDIR)$(LIBPATH)
chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
clean: clean:
$(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h $(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h

View File

@ -7,21 +7,6 @@
# For conditions of distribution and use, see the disclaimer # For conditions of distribution and use, see the disclaimer
# and license in png.h # and license in png.h
# where make install puts libpng.a and png.h
prefix=/usr/local
INCPATH=$(prefix)/include
LIBPATH=$(prefix)/lib
# 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, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
# Where the zlib library and include files are located # Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib #ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include #ZLIBINC=/usr/local/include
@ -32,7 +17,6 @@ CC=gcc
AR_RC=ar rc AR_RC=ar rc
RANLIB=ranlib RANLIB=ranlib
MKDIR_P=mkdir -p MKDIR_P=mkdir -p
LN_SF=ln -f -s
CP=cp CP=cp
RM_F=/bin/rm -f RM_F=/bin/rm -f
@ -66,22 +50,9 @@ pngtest: pngtest.o libpng.a
test: pngtest test: pngtest
./pngtest ./pngtest
install: libpng.a install:
-@$(MKDIR_P) $(DESTDIR)$(INCPATH) @echo "The $@ target is no longer supported by this makefile."
-@$(MKDIR_P) $(DESTDIR)$(INCPATH)/libpng @false
-@$(MKDIR_P) $(DESTDIR)$(LIBPATH)
-@$(RM_F) $(DESTDIR)$(INCPATH)/png.h
-@$(RM_F) $(DESTDIR)$(INCPATH)/pngconf.h
-@$(RM_F) $(DESTDIR)$(INCPATH)/pnglibconf.h
cp png.h $(DESTDIR)$(INCPATH)/libpng
cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
(cd $(DESTDIR)$(INCPATH); $(LN_SF) libpng/* .)
cp libpng.a $(DESTDIR)$(LIBPATH)
chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
clean: clean:
$(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h $(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h