home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / NETWORK / netpbm_src.lzh / NETPBM / SMakefile < prev    next >
Makefile  |  1996-11-18  |  8KB  |  200 lines

  1. # Makefile for pbmplus tools.
  2. #
  3. # Copyright (C) 1989, 1991 by Jef Poskanzer.
  4. # Modified by Robert A. Knop Jr. (rknop@cco.caltech.edu) 940126 for 
  5. #       Amiga SAS/C 6.0 or greater (tested with 6.50)
  6. #    Merge is not currently supported by this makefile
  7. #    LibTIFF is not currently supported by this makefile (perhaps soon...)
  8. #    RKNOP has also created "SMakefile"s in each of {pbm/ pgm/ ppm/ pnm/}
  9. #       which were similarly based on the Unix Makefile#
  10. #    The shell utility "foreach" (should have been included in the archive with)
  11. #       this SMakefile) is necessary for the SMakefiles to work.
  12. #    Feel free to experiment with SCOPTIONS, although these have been tweaked
  13. #       at great length to get netpbm to compile.  It is probably wise to have
  14. #       the SCOPTIONS files in the four subdirectories identical to the one
  15. #       in the top netpbm source directory.    
  16. #    All changes pertinent to SAS/C 6.x are labeled by the word "RKNOP"
  17. #
  18. # Permission to use, copy, modify, and distribute this software and its
  19. # documentation for any purpose and without fee is hereby granted, provided
  20. # that the above copyright notice appear in all copies and that both that
  21. # copyright notice and this permission notice appear in supporting
  22. # documentation.  This software is provided "as is" without express or
  23. # implied warranty.
  24.  
  25. # CONFIGURE: gcc makes things go faster on some machines, but not everyone
  26. # has it.  Warning: do not use gcc's -finline-functions or -fstrength-reduce
  27. # flags, they can produce incorrect code.  (This is with gcc versions 1.35,
  28. # 1.36, and 1.37, later versions may fix these bugs.)  Also, on some systems
  29. # gcc can't compile pnmconvol - dunno why.  And on some systems you can't
  30. # use the -ansi flag, it gives compilation errors in <math.h>.
  31. # For the Amiga, the makefiles will die severely if you don't use SAS/C 6.x
  32. #CC =        cc
  33. #CC =        gcc
  34. CC =        sc
  35. #CC =        gcc -fcombine-regs -fpcc-struct-return
  36. #CC =        gcc -ansi -pedantic -fcombine-regs -fpcc-struct-return
  37.  
  38. # CONFIGURE: cc flags go here.
  39. # On some systems, e.g a sun386i, there is no strstr function. If this
  40. # is the case on your system, set the -DNEED_STRSTR flag.
  41. #CFLAGS =    -O
  42. #CFLAGS =    -O -DNEED_STRSTR
  43. #CFLAGS =    -g
  44. #CFLAGS =    -g -O
  45. CFLAGS =
  46.  
  47. MFLAGS =
  48.  
  49. # CONFIGURE: ld flags go here.  Eunice users may want to use -noshare so that
  50. # the binaries can run standalone.
  51. LDFLAGS
  52. #LDFLAGS =    -s
  53. #LDFLAGS =    
  54. #LDFLAGS =    -noshare
  55.  
  56. # CONFIGURE: PBMPLUS's support for TIFF files depends on the library from
  57. # Sam Leffler's TIFF Software package - see the OTHER.SYSTEMS file for a
  58. # full description and access information.  To configure PBMPLUS to use the
  59. # library: first, if necessary, fetch the TIFF Software, unpack it in a
  60. # scratch directory somewhere, and move the libtiff subdirectory right here
  61. # into the PBMPLUS top-level directory.  Configure and "make" in the
  62. # libtiff directory.  Yes, you do have to do the TIFF make by hand, the
  63. # general PBMPLUS make will *not* make libtiff.  Finally, uncomment the
  64. # following five definitions.
  65. #
  66. # Libtiff is pretty good about portability, but there are some machines
  67. # it has problems on.  If you run into problems, you may wish to contact
  68. # Sam directly, at the address listed in the OTHER.SYSTEMS file.
  69. #
  70. # By the way, you must have at least version 2.4 of libtiff.  Earlier
  71. # versions will not work.
  72. #
  73. # RKNOP: The SAS/C version does not yet have a converted libtiff SMakefile
  74. TIFFDEF =
  75. TIFFINC =
  76. TIFFLIB =
  77. TIFFBINARIES =
  78. TIFFOBJECTS =
  79. #TIFFDEF =    -DLIBTIFF
  80. #TIFFINC =    -I../libtiff
  81. #TIFFLIB =    ../libtiff/libtiff.a
  82. #TIFFBINARIES =    tifftopnm pnmtotiff
  83. #TIFFOBJECTS =    tifftopnm.o pnmtotiff.o
  84.  
  85. # CONFIGURE: Define the directory that you want the binaries copied to.
  86. # If you need scripts and binaries to be in different directories, you
  87. # can set that up too.
  88. #INSTALLBINARIES =    sys:netpbm
  89. INSTALLBINARIES = Laertes:CCode/netpbm-exec
  90. INSTALLSCRIPTS =    $(INSTALLBINARIES)
  91.  
  92. # CONFIGURE: Define the directories that you want the manual sources copied to,
  93. # plus the suffix you want them to have.
  94. INSTALLMANUALS1 =    sys:netpbm-man/man1
  95. SUFFIXMANUALS1 =    1
  96. INSTALLMANUALS3 =    sys:netpbm-man/man3
  97. SUFFIXMANUALS3 =    3
  98. INSTALLMANUALS5 =    sys:netpbm-man/man5
  99. SUFFIXMANUALS5 =    5
  100.  
  101. # CONFIGURE: Normally the man pages are installed using "cp".  By changing
  102. # this define you can use something else, for example a script that calls
  103. # compress or pack. The ../mantocat is used on systems which use man pages
  104. # in the "cat" format.
  105. MANCP =            copy
  106. #MANCP =            cp
  107. #MANCP =        ../mantocat
  108.  
  109. # CONFIGURE: Normally the Makefiles build and install separate binaries for
  110. # each program.  However, on some systems (especially those without shared
  111. # libraries) this can mean a lot of space.  In this case you might try
  112. # building a "merge" instead.  The idea here is to link all the binaries
  113. # together into one huge executable, with a tiny dispatch program as the
  114. # main.  Then the merged binary is installed with file-system links for
  115. # each program it includes.  The dispatch routine can tell which program
  116. # to run by looking at argv[0].  On a Sun3 under SunOS 3.5 the space for
  117. # executables went from 2.9 meg to .36 meg.
  118. #
  119. # Note that if you make a "merge", the executables don't get created
  120. # until you do the install.
  121. # RKNOP: Merge is not supported for Amiga SAS/C
  122. all:        binaries
  123. install:    install.bin install.man
  124. #all:        merge
  125. #install:    install.merge install.man
  126.  
  127. # End of configurable definitions.
  128.  
  129. SHELL =        /bin/sh
  130. #MAKE =        make
  131. MAKE =        smake
  132. SUBDIRS =    pbm pgm ppm pnm
  133.  
  134. binaries:
  135.     execute stamp-date.amiga
  136.         execute < <(T:main_smake.tmp)
  137.     foreach im in $(SUBDIRS)
  138.         echo $${im}
  139.         cd $${im}
  140.         $(MAKE) $(MFLAGS) CC=$(CC) CFLAGS=$(CFLAGS) TIFFDEF=$(TIFFDEF) TIFFINC=$(TIFFINC) TIFFLIB=$(TIFFLIB) TIFFBINARIES=$(TIFFBINARIES) TIFFOBJECTS=$(TIFFOBJECTS) LDFLAGS=$(LDFLAGS) binaries
  141.     end
  142.     <
  143.  
  144. # RKNOP 940126
  145. # "smake nostamp" will do the same as "smake" or "smake binaries", only
  146. # stamp-date.amiga will NOT be run.  This is convenient if you are
  147. # experimenting and a build tends to die halfway through... the samkefile can
  148. # continue to use the old compile.h (which normally stamp-date creates) and
  149. # whatever objects files previous passes at the compilation have left behind
  150. nostamp:
  151.         execute < <(T:main_smake.tmp)
  152.     foreach im in $(SUBDIRS)
  153.         echo $${im}
  154.         cd $${im}
  155.         $(MAKE) $(MFLAGS) CC=$(CC) CFLAGS=$(CFLAGS) TIFFDEF=$(TIFFDEF) TIFFINC=$(TIFFINC) TIFFLIB=$(TIFFLIB) TIFFBINARIES=$(TIFFBINARIES) TIFFOBJECTS=$(TIFFOBJECTS) LDFLAGS=$(LDFLAGS) binaries
  156.     end
  157.     <
  158.  
  159. #merge:
  160. #    ./stamp-date
  161. #    for i in $(SUBDIRS) ; do \
  162. #        ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' merge ); \
  163. #    done
  164.  
  165. install.bin:
  166.         -makedir $(INSTALLBINARIES)
  167.         execute < <(T:main_smake.tmp)
  168.     foreach im in $(SUBDIRS)
  169.         echo $${im}
  170.         cd $${im}
  171.         $(MAKE) $(MFLAGS) CC=$(CC) CFLAGS=$(CFLAGS) TIFFDEF=$(TIFFDEF) TIFFINC=$(TIFFINC) TIFFLIB=$(TIFFLIB) TIFFBINARIES=$(TIFFBINARIES) TIFFOBJECTS=$(TIFFOBJECTS) LDFLAGS=$(LDFLAGS) INSTALLBINARIES=$(INSTALLBINARIES) INSTALLSCRIPTS=$(INSTALLSCRIPTS) install.bin
  172.     end
  173.         <
  174.  
  175. #install.merge:
  176. #       -mkdir $(INSTALLBINARIES)
  177. #    for i in $(SUBDIRS) ; do \
  178. #        ( 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 ); \
  179. #    done
  180.  
  181. install.man:
  182.         execute < <(T:main_smake.tmp)
  183.     foreach im in $(SUBDIRS)
  184.        echo $${im}
  185.        cd $${im}
  186.        $(MAKE) $(MFLAGS) TIFFBINARIES=$(TIFFBINARIES) INSTALLMANUALS1=$(INSTALLMANUALS1) SUFFIXMANUALS1=$(SUFFIXMANUALS1) INSTALLMANUALS3=$(INSTALLMANUALS3) SUFFIXMANUALS3=$(SUFFIXMANUALS3) INSTALLMANUALS5=$(INSTALLMANUALS5) SUFFIXMANUALS5=$(SUFFIXMANUALS5) MANCP=$(MANCP) install.man
  187.     end
  188.         <
  189.  
  190. clean:
  191.     -delete *.shar *.shar? art.* compile.h
  192. #libtiff removed from the foreach below for the time being
  193.         execute < <(T:main_smake.tmp)
  194.     foreach im in $(SUBDIRS)
  195.        echo $${im}
  196.        cd $${im}
  197.        $(MAKE) $(MFLAGS) clean
  198.     end
  199.     <
  200.