home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / netpbma.zip / Makefile < prev    next >
Makefile  |  1997-04-20  |  6KB  |  138 lines

  1. # Makefile for pbmplus tools.
  2. #
  3. # Copyright (C) 1989, 1991 by Jef Poskanzer.
  4. #
  5. # Permission to use, copy, modify, and distribute this software and its
  6. # documentation for any purpose and without fee is hereby granted, provided
  7. # that the above copyright notice appear in all copies and that both that
  8. # copyright notice and this permission notice appear in supporting
  9. # documentation.  This software is provided "as is" without express or
  10. # implied warranty.
  11.  
  12. # CONFIGURE: gcc makes things go faster on some machines, but not everyone
  13. # has it.  Warning: do not use gcc's -finline-functions or -fstrength-reduce
  14. # flags, they can produce incorrect code.  (This is with gcc versions 1.35,
  15. # 1.36, and 1.37, later versions may fix these bugs.)  Also, on some systems
  16. # gcc can't compile pnmconvol - dunno why.  And on some systems you can't
  17. # use the -ansi flag, it gives compilation errors in <math.h>.
  18. #CC =        cc
  19. CC =        gcc
  20. #CC =        gcc -fcombine-regs -fpcc-struct-return
  21. #CC =        gcc -ansi -pedantic -fcombine-regs -fpcc-struct-return
  22.  
  23. # CONFIGURE: cc flags go here.
  24. CFLAGS =    -O3 -Zcrtdll
  25. #CFLAGS =    -g
  26. #CFLAGS =    -g -O
  27.  
  28. # CONFIGURE: ld flags go here.  Eunice users may want to use -noshare so that
  29. # the binaries can run standalone.
  30. LDFLAGS =    -Zcrtdll
  31. #LDFLAGS =    
  32. #LDFLAGS =    -noshare
  33.  
  34. # CONFIGURE: PBMPLUS's support for TIFF files depends on the library from
  35. # Sam Leffler's TIFF Software package - see the OTHER.SYSTEMS file for a
  36. # full description and access information.  To configure PBMPLUS to use the
  37. # library: first, if necessary, fetch the TIFF Software, unpack it in a
  38. # scratch directory somewhere, and move the libtiff subdirectory right here
  39. # into the PBMPLUS top-level directory.  Configure and "make" in the
  40. # libtiff directory.  Yes, you do have to do the TIFF make by hand, the
  41. # general PBMPLUS make will *not* make libtiff.  Finally, uncomment the
  42. # following five definitions.
  43. #
  44. # Libtiff is pretty good about portability, but there are some machines
  45. # it has problems on.  If you run into problems, you may wish to contact
  46. # Sam directly, at the address listed in the OTHER.SYSTEMS file.
  47. #
  48. # By the way, you must have at least version 2.4 of libtiff.  Earlier
  49. # versions will not work.
  50. TIFFDIR =     ../libtiff
  51. TIFFDEF =    -DLIBTIFF
  52. TIFFINC =     -I$(TIFFDIR)
  53. TIFFLIB =    $(TIFFDIR)/libtiff.a
  54. TIFFBINARIES =    tifftopnm pnmtotiff
  55. TIFFOBJECTS =    tifftopnm.o pnmtotiff.o
  56.  
  57. # CONFIGURE: Define the directory that you want the binaries copied to.
  58. # If you need scripts and binaries to be in different directories, you
  59. # can set that up too.
  60. INSTALLBINARIES =    /usr/local/netpbm
  61. INSTALLSCRIPTS =    $(INSTALLBINARIES)
  62.  
  63. # CONFIGURE: Define the directories that you want the manual sources copied to,
  64. # plus the suffix you want them to have.
  65. INSTALLMANUALS1 =    /usr/local/man/man1
  66. SUFFIXMANUALS1 =    1
  67. INSTALLMANUALS3 =    /usr/local/man/man3
  68. SUFFIXMANUALS3 =    3
  69. INSTALLMANUALS5 =    /usr/local/man/man5
  70. SUFFIXMANUALS5 =    5
  71.  
  72. # CONFIGURE: Normally the man pages are installed using "cp".  By changing
  73. # this define you can use something else, for example a script that calls
  74. # compress or pack. The ../mantocat is used on systems which use man pages
  75. # in the "cat" format.
  76. MANCP =            cp
  77. #MANCP =        ../mantocat
  78.  
  79. # CONFIGURE: Normally the Makefiles build and install separate binaries for
  80. # each program.  However, on some systems (especially those without shared
  81. # libraries) this can mean a lot of space.  In this case you might try
  82. # building a "merge" instead.  The idea here is to link all the binaries
  83. # together into one huge executable, with a tiny dispatch program as the
  84. # main.  Then the merged binary is installed with file-system links for
  85. # each program it includes.  The dispatch routine can tell which program
  86. # to run by looking at argv[0].  On a Sun3 under SunOS 3.5 the space for
  87. # executables went from 2.9 meg to .36 meg.
  88. #
  89. # Note that if you make a "merge", the executables don't get created
  90. # until you do the install.
  91. all:        binaries
  92. #install:    install.bin install.man
  93. #all:        merge
  94. install:    install.merge install.man
  95.  
  96. # End of configurable definitions.
  97.  
  98. SHELL =        /bin/sh
  99. MAKE =        make
  100. SUBDIRS =    pbm pgm ppm pnm
  101.  
  102. binaries:
  103.     ( echo "libtiff" ; cd libtiff ; make )
  104.     for i in $(SUBDIRS) ; do \
  105.         ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' binaries ); \
  106.     done
  107.  
  108. merge:
  109.     ./stamp-date
  110.     ( echo "libtiff" ; cd libtiff ; make )
  111.     for i in $(SUBDIRS) ; do \
  112.         ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' merge ); \
  113.     done
  114.  
  115. install.bin:
  116.     -mkdir $(INSTALLBINARIES)
  117.     for i in $(SUBDIRS) ; do \
  118.         ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' 'INSTALLBINARIES=$(INSTALLBINARIES)' 'INSTALLSCRIPTS=$(INSTALLSCRIPTS)' install.bin ); \
  119.     done
  120.  
  121. install.merge:
  122.     -mkdir $(INSTALLBINARIES)
  123.     for i in $(SUBDIRS) ; do \
  124.         ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' 'INSTALLBINARIES=$(INSTALLBINARIES)' 'INSTALLSCRIPTS=$(INSTALLSCRIPTS)' install.merge ); \
  125.     done
  126.  
  127. install.man:
  128.     for i in $(SUBDIRS) ; do \
  129.         ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'TIFFBINARIES=$(TIFFBINARIES)' 'INSTALLMANUALS1=$(INSTALLMANUALS1)' 'SUFFIXMANUALS1=$(SUFFIXMANUALS1)' 'INSTALLMANUALS3=$(INSTALLMANUALS3)' 'SUFFIXMANUALS3=$(SUFFIXMANUALS3)' 'INSTALLMANUALS5=$(INSTALLMANUALS5)' 'SUFFIXMANUALS5=$(SUFFIXMANUALS5)' 'MANCP=$(MANCP)' install.man ); \
  130.     done
  131.  
  132. clean:
  133.     rm -f *.shar *.shar? art.* *~
  134.     echo "" > compile.h
  135.     for i in $(SUBDIRS) libtiff ; do \
  136.         ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) clean ); \
  137.     done
  138.