home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wxos2233.zip / wxOS2-2_3_3.zip / wxWindows-2.3.3 / src / png / scripts / makefile.hpux < prev    next >
Makefile  |  2002-07-08  |  6KB  |  189 lines

  1. # makefile for libpng, HPUX (10.20 and 11.00)
  2. # Copyright (C) 1999-2002 Glenn Randers-Pehrson
  3. # Copyright (C) 1995 Guy Eric Schalnat, Group 42
  4. # contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
  5. # For conditions of distribution and use, see copyright notice in png.h
  6.  
  7. # Where the zlib library and include files are located
  8. ZLIBLIB=/opt/zlib/lib
  9. ZLIBINC=/opt/zlib/include
  10.  
  11. CC=cc
  12. CFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
  13. # Caution: be sure you have built zlib with the same CFLAGS.
  14. CCFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
  15. LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
  16.  
  17. RANLIB=ranlib
  18.  
  19. PNGMAJ = 0
  20. PNGMIN = 1.2.4
  21. PNGVER = $(PNGMAJ).$(PNGMIN)
  22. LIBNAME = libpng12
  23.  
  24. # where make install puts libpng.a, libpng12.sl, and png.h
  25. prefix=/opt/libpng
  26. INCPATH=$(prefix)/include
  27. LIBPATH=$(prefix)/lib
  28. MANPATH=$(prefix)/man
  29. BINPATH=$(prefix)/bin
  30.  
  31. # override DESTDIR= on the make install command line to easily support
  32. # installing into a temporary location.  Example:
  33. #
  34. #    make install DESTDIR=/tmp/build/libpng
  35. #
  36. # If you're going to install into a temporary location
  37. # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
  38. # you execute make install.
  39. DESTDIR=
  40.  
  41. DB=$(DESTDIR)$(BINPATH)
  42. DI=$(DESTDIR)$(INCPATH)
  43. DL=$(DESTDIR)$(LIBPATH)
  44. DM=$(DESTDIR)$(MANPATH)
  45.  
  46. OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
  47.     pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
  48.     pngwtran.o pngmem.o pngerror.o pngpread.o
  49.  
  50. OBJSDLL = $(OBJS:.o=.pic.o)
  51.  
  52. .SUFFIXES:    .c .o .pic.o
  53.  
  54. .c.pic.o:
  55.     $(CC) -c $(CFLAGS) +z -o $@ $*.c
  56.  
  57. all: libpng.a $(LIBNAME).sl pngtest libpng.pc libpng-config
  58.  
  59. libpng.a: $(OBJS)
  60.     ar rc $@  $(OBJS)
  61.     $(RANLIB) $@
  62.  
  63. libpng.pc:
  64.     cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
  65.  
  66. libpng-config:
  67.     ( cat scripts/libpng-config-head.in; \
  68.     echo prefix=\"$(prefix)\"; \
  69.     echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
  70.     echo cflags=\"-Ae +DA1.1 +DS2.0"; \
  71.     echo ldflags=\"-L$(LIBPATH)\"; \
  72.     echo libs=\"-lpng12 -lz -lm\"; \
  73.     cat scripts/libpng-config-body.in ) > libpng-config
  74.     chmod +x libpng-config
  75.  
  76. $(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ)
  77.     ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl
  78.  
  79. $(LIBNAME).sl.$(PNGMAJ): $(LIBNAME).sl.$(PNGVER)
  80.     ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ)
  81.  
  82. $(LIBNAME).sl.$(PNGVER): $(OBJSDLL)
  83.     $(LD) -b -L$(ZLIBLIB) +s +b $(ZLIBLIB) \
  84.     +h $(LIBNAME).sl.$(PNGMAJ) -o $(LIBNAME).sl.$(PNGVER) \
  85.     $(OBJSDLL) -lz
  86.  
  87. pngtest: pngtest.o libpng.a
  88.     $(CC) -o pngtest $(CCFLAGS) pngtest.o $(LDFLAGS)
  89.  
  90. test: pngtest
  91.     ./pngtest
  92.  
  93. install-headers: png.h pngconf.h
  94.     -@if [ ! -d $(DI) ]; then mkdir $(DI); fi
  95.     -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
  96.     cp png.h pngconf.h $(DI)/$(LIBNAME)
  97.     chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
  98.     -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
  99.     -@/bin/rm -f $(DI)/libpng
  100.     (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
  101.  
  102. install-static: install-headers libpng.a
  103.     -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
  104.     cp libpng.a $(DL)/$(LIBNAME).a
  105.     chmod 644 $(DL)/$(LIBNAME).a
  106.     -@/bin/rm -f $(DL)/libpng.a
  107.     (cd $(DL); ln -sf $(LIBNAME).a libpng.a)
  108.  
  109. install-shared: install-headers $(LIBNAME).sl.$(PNGVER) libpng.pc
  110.     -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
  111.     -@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGMAJ)* $(DL)/$(LIBNAME).sl
  112.     -@/bin/rm -f $(DL)/libpng.sl
  113.     -@/bin/rm -f $(DL)/libpng.sl.3
  114.     -@/bin/rm -f $(DL)/libpng.sl.3.*
  115.     cp $(LIBNAME).sl.$(PNGVER) $(DL)
  116.     chmod 755 $(DL)/$(LIBNAME).sl.$(PNGVER)
  117.     (cd $(DL); \
  118.     ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl; \
  119.     ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3; \
  120.     ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3.$(PNGMIN); \
  121.     ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
  122.     ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
  123.     -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
  124.     -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
  125.     -@/bin/rm -f $(DL)/pkgconfig/libpng.pc
  126.     cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
  127.     chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
  128.     (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
  129.  
  130. install-man: libpng.3 libpngpf.3 png.5
  131.     -@if [ ! -d $(DM) ]; then mkdir $(DM); fi
  132.     -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
  133.     -@/bin/rm -f $(DM)/man3/libpng.3
  134.     -@/bin/rm -f $(DM)/man3/libpngpf.3
  135.     cp libpng.3 $(DM)/man3
  136.     cp libpngpf.3 $(DM)/man3
  137.     -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
  138.     -@/bin/rm -f $(DM)/man5/png.5
  139.     cp png.5 $(DM)/man5
  140.  
  141. install-config: libpng-config
  142.     -@if [ ! -d $(DB) ]; then mkdir $(DB); fi
  143.     -@/bin/rm -f $(DB)/libpng-config
  144.     -@/bin/rm -f $(DB)/$(LIBNAME)-config
  145.     cp libpng-config $(DB)/$(LIBNAME)-config
  146.     chmod 755 $(DB)/$(LIBNAME)-config
  147.     (cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
  148.  
  149. install: install-static install-shared install-man install-config
  150.  
  151. # If you installed in $(DESTDIR), test-installed won't work until you
  152. # move the library to its final location.
  153.  
  154. test-installed:
  155.     echo
  156.     echo Testing installed dynamic shared library.
  157.     $(CC) $(CCFLAGS) \
  158.        `$(BINPATH)/libpng12-config --cppflags --cflags` pngtest.c \
  159.        -L$(ZLIBLIB) \
  160.        -o pngtesti `$(BINPATH)/libpng12-config --ldflags --libs`
  161.     ./pngtesti pngtest.png
  162.  
  163. clean:
  164.     /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png libpng.pc \
  165.     libpng-config $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)*
  166.  
  167. DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
  168. writelock:
  169.     chmod a-w *.[ch35] $(DOCS) scripts/*
  170.  
  171. # DO NOT DELETE THIS LINE -- make depend depends on it.
  172.  
  173. png.o: png.h pngconf.h
  174. pngerror.o: png.h pngconf.h
  175. pngrio.o: png.h pngconf.h
  176. pngwio.o: png.h pngconf.h
  177. pngmem.o: png.h pngconf.h
  178. pngset.o: png.h pngconf.h
  179. pngget.o: png.h pngconf.h
  180. pngread.o: png.h pngconf.h
  181. pngrtran.o: png.h pngconf.h
  182. pngrutil.o: png.h pngconf.h
  183. pngtest.o: png.h pngconf.h
  184. pngtrans.o: png.h pngconf.h
  185. pngwrite.o: png.h pngconf.h
  186. pngwtran.o: png.h pngconf.h
  187. pngwutil.o: png.h pngconf.h
  188. pngpread.o: png.h pngconf.h
  189.