summaryrefslogtreecommitdiff
path: root/scripts/makefile.sggcc
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/makefile.sggcc')
-rw-r--r--scripts/makefile.sggcc63
1 files changed, 35 insertions, 28 deletions
diff --git a/scripts/makefile.sggcc b/scripts/makefile.sggcc
index c6d10a4d1..d1cc49280 100644
--- a/scripts/makefile.sggcc
+++ b/scripts/makefile.sggcc
@@ -1,5 +1,5 @@
# makefile for libpng.a and libpng12.so, SGI IRIX with 'cc'
-# Copyright (C) 2001-2002 Glenn Randers-Pehrson
+# Copyright (C) 2001-2002, 2006 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# For conditions of distribution and use, see copyright notice in png.h
@@ -7,6 +7,7 @@
# Prefix must be a full pathname.
prefix=/usr/local
+exec_prefix=$prefix
# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib32
@@ -18,9 +19,15 @@ ZLIBINC=../zlib
LIBNAME=libpng12
PNGMAJ = 0
-PNGMIN = 1.2.9beta6
+PNGMIN = 1.2.9beta7
PNGVER = $(PNGMAJ).$(PNGMIN)
+
+AR_RC=ar rc
CC=gcc
+MKDIR_P=mkdir -p
+LN_SF=ln -sf
+RANLIB=echo
+RM_F=/bin/rm -f
# ABI can be blank to use default for your system, -32, -o32, -n32, or -64
# See "man abi". zlib must be built with the same ABI.
@@ -39,10 +46,10 @@ RANLIB=echo
#RANLIB=ranlib
INCPATH=$(prefix)/include
-LIBPATH=$(prefix)/lib
-#LIBPATH=$(prefix)/lib32
+LIBPATH=$(exec_prefix)/lib
+#LIBPATH=$(exec_prefix)/lib32
MANPATH=$(prefix)/man
-BINPATH=$(prefix)/bin
+BINPATH=$(exec_prefix)/bin
# override DESTDIR= on the make install command line to easily support
# installing into a temporary location. Example:
@@ -66,7 +73,7 @@ OBJS = pnggccrd.o png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
all: libpng.a pngtest shared libpng.pc libpng-config
libpng.a: $(OBJS)
- ar rc $@ $(OBJS)
+ $(AR_RC) $@ $(OBJS)
$(RANLIB) $@
shared: $(LIBNAME).so.$(PNGVER)
@@ -94,7 +101,7 @@ $(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
$(LIBNAME).so.$(PNGVER): $(OBJS)
$(LDSHARED) -o $@ $(OBJS)
- rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)
+ $(RM_F) $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)
libpng.so.0.$(PNGMIN): $(OBJS)
$(LDLEGACY) -o $@ $(OBJS)
@@ -112,25 +119,25 @@ install-headers: png.h pngconf.h
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
cp png.h pngconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
- -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
- -@/bin/rm -f $(DI)/libpng
+ -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
+ -@$(RM_F) $(DI)/libpng
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
install-static: install-headers libpng.a
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
cp libpng.a $(DL)/$(LIBNAME).a
chmod 644 $(DL)/$(LIBNAME).a
- -@/bin/rm -f $(DL)/libpng.a
+ -@$(RM_F) $(DL)/libpng.a
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
libpng.so.0.$(PNGMIN)
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
- -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
- -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)
- -@/bin/rm -f $(DL)/libpng.so
- -@/bin/rm -f $(DL)/libpng.so.0
- -@/bin/rm -f $(DL)/libpng.so.0.$(PNGMIN)*
+ -@$(RM_F) $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
+ -@$(RM_F) $(DL)/$(LIBNAME).so.$(PNGMAJ)
+ -@$(RM_F) $(DL)/libpng.so
+ -@$(RM_F) $(DL)/libpng.so.0
+ -@$(RM_F) $(DL)/libpng.so.0.$(PNGMIN)*
cp $(LIBNAME).so.$(PNGVER) $(DL)
cp libpng.so.0.$(PNGMIN) $(DL)
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
@@ -141,8 +148,8 @@ install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
- -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
- -@/bin/rm -f $(DL)/pkgconfig/libpng.pc
+ -@$(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)
@@ -150,18 +157,18 @@ install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
- -@/bin/rm -f $(DM)/man3/libpng.3
- -@/bin/rm -f $(DM)/man3/libpngpf.3
+ -@$(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 $(DM)/man5; fi
- -@/bin/rm -f $(DM)/man5/png.5
+ -@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
- -@/bin/rm -f $(DB)/libpng-config
- -@/bin/rm -f $(DB)/$(LIBNAME)-config
+ -@$(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)
@@ -176,24 +183,24 @@ test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) -I$(ZLIBINC) \
- `$(BINPATH)/libpng12-config --cflags` pngtest.c \
+ `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-rpath $(ZLIBLIB):$(DL)\
- -o pngtestd `$(BINPATH)/libpng12-config --ldflags`
+ -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) -I$(ZLIBINC) \
- `$(BINPATH)/libpng12-config --cflags` pngtest.c \
+ `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) \
- -rpath $(ZLIBLIB):`$(BINPATH)/libpng12-config --libdir` \
- -o pngtesti `$(BINPATH)/libpng12-config --ldflags`
+ -rpath $(ZLIBLIB):`$(BINPATH)/$(LIBNAME)-config --libdir` \
+ -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtesti pngtest.png
clean:
- rm -f *.o libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \
+ $(RM_F)libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \
$(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
libpng.so.0.$(PNGMIN) \
so_locations