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 / PGM / Makefile.dice < prev    next >
Makefile  |  1996-11-18  |  7KB  |  186 lines

  1. # Makefile for pgm tools, for use with Amiga DICE
  2. #
  3. # Copyright (C) 1989, 1991 by Jef Poskanzer.
  4. # Modified for Amiga DICE by Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
  5. #
  6. # Permission to use, copy, modify, and distribute this software and its
  7. # documentation for any purpose and without fee is hereby granted, provided
  8. # that the above copyright notice appear in all copies and that both that
  9. # copyright notice and this permission notice appear in supporting
  10. # documentation.  This software is provided "as is" without express or
  11. # implied warranty.
  12.  
  13. # CONFIG: generate executable with debugging information
  14. #DEBUG =     -s -d1
  15. # CONFIG: use memory pools
  16. #MPOOL =     -L/amiga -l mpool
  17.  
  18. CC =            dcc
  19. CFLAGS =        -E DCC_ERRORS -ms -mu -gs $(DEBUG)
  20. LDFLAGS =       $(MPOOL) /amiga/dice_stack.o
  21. BINDIR =        bin
  22. MERGE=          pgmmerge
  23.  
  24. # where to install the binaries, libraries and important header files
  25. INSTALLBIN =    bin:pbmplus
  26. INSTALLLIB =    dlib:local
  27. INSTALLINCL=    dinclude:local
  28. # install which headers
  29. HEADERS=        pgm.h /pbmplus.h
  30.  
  31. PBMDIR =        /pbm
  32. INCLUDEPBM =    -I$(PBMDIR)
  33. RLIBPBM =       $(PBMDIR)/pbmsr.lib
  34. RLLIBPBM =      $(PBMDIR)/pbmrl.lib
  35. SLIBPBM =       $(PBMDIR)/pbms.lib
  36. SLLIBPBM =      $(PBMDIR)/pbml.lib
  37. DEFPBM =        $(PBMDIR)/pbm.h /pbmplus.h
  38. DEFLIBPBM =     $(PBMDIR)/libpbm.h
  39.  
  40. INCLUDE =       -I/ $(INCLUDEPBM)
  41. RALLCFLAGS =    $(CFLAGS) $(INCLUDE) -proto -mRR
  42. SALLCFLAGS =    $(CFLAGS) $(INCLUDE) -proto
  43. MALLCFLAGS =    $(CFLAGS) $(INCLUDE) -mD -mC
  44. RLIBPGM =       pgmsr.lib
  45. RLLIBPGM =      pgmrl.lib
  46. SLIBPGM =       pgms.lib
  47. SLLIBPGM =      pgml.lib
  48. DEFPGM =        pgm.h
  49. DEFLIBPGM =     libpgm.h
  50.  
  51. LIBRARIES =     $(RLIBPGM) $(RLLIBPGM) $(SLIBPGM) $(SLLIBPGM)
  52.  
  53. BINS =          hipstopgm lispmtopgm pgmbentley pgmedge pgmenhance \
  54.                 pgmnoise pgmoil pgmramp pgmtofs pgmtolispm \
  55.                 psidtopgm rawtopgm asciitopgm bioradtopgm spottopgm \
  56.                 pbmtopgm
  57.  
  58. MATHBINS =      fstopgm pgmcrater pgmhist pgmnorm pgmtexture \
  59.                 pgmtopbm pgmkernel
  60.  
  61. BINARIES =      $(BINS) $(MATHBINS)
  62.  
  63. OBJECTS =       fstopgm.om hipstopgm.om lispmtopgm.om pgmbentley.om \
  64.                 pgmenhance.om pgmhist.om pgmnoise.om pgmnorm.om pgmoil.om \
  65.                 pgmramp.om pgmtofs.om pgmtolispm.om pgmtopbm.om \
  66.                 psidtopgm.om rawtopgm.om pgmcrater.om pgmedge.om pgmtexture.om \
  67.                 asciitopgm.om bioradtopgm.om spottopgm.om pbmtopgm.om pgmkernel.om
  68.  
  69.  
  70. all:            lib binaries
  71.  
  72. bindir:
  73.                 -makedir $(BINDIR)
  74.  
  75. binaries:       lib bindir $(BINARIES)
  76.  
  77. lib:            $(LIBRARIES)
  78.  
  79. merge:          lib bindir $(MERGE)
  80.  
  81.  
  82. # Rules for merged binary
  83. .c.om:       $(DEFPGM) $(DEFPBM) $<
  84.         $(CC) -proto $(MALLCFLAGS) "-Dmain=$*_main" -c $*.c -o $*.om
  85. $(MERGE):   pgmmerge.c $(OBJECTS) $(SLLIBPGM) $(SLLIBPBM)
  86.         $(CC) $(MALLCFLAGS) $(LDFLAGS) -o $(BINDIR)/$@ $@.c $(OBJECTS) -l $(SLLIBPGM) -l $(SLLIBPBM) -lm
  87. #$(OBJECTS):     $(DEFPGM) $(DEFPBM)
  88. #        $(CC) -mD -mC $(SALLCFLAGS) "-Dmain=$*_main" -c $*.c
  89.  
  90.  
  91. # Rule for plain programs.
  92. $(BINS):        $(DEFPGM) $(DEFPBM) $(RLIBPGM) $(RLIBPBM)
  93.         $(CC) -r $(RALLCFLAGS) $(LDFLAGS) -o $(BINDIR)/$@ $@.c -l $(RLIBPGM) -l $(RLIBPBM)
  94.  
  95. # Rule for math-dependent programs.
  96. $(MATHBINS):    $(DEFPGM) $(DEFPBM) $(RLIBPGM) $(RLIBPBM)
  97.         $(CC) -r $(RALLCFLAGS) $(LDFLAGS) -o $(BINDIR)/$@ $@.c -l $(RLIBPGM) -l $(RLIBPBM) -lm
  98.  
  99.  
  100. # And libraries.
  101. #$(LIBPBM):
  102. #        cd $(PBMDIR) ; make lib
  103.  
  104. # small data version of libpgm
  105. $(RLIBPGM):      libpgm1.or libpgm2.or
  106.         -delete $(RLIBPGM)
  107.         join libpgm1.or libpgm2.or to $(RLIBPGM)
  108. libpgm1.or:      $(DEFPGM) $(DEFPBM) $(DEFLIBPGM) libpgm1.c
  109.         $(CC) -r $(RALLCFLAGS) -S -o $@ -c libpgm1.c
  110. libpgm2.or:      $(DEFPGM) $(DEFPBM) $(DEFLIBPGM) libpgm2.c $(DEFLIBPBM)
  111.         $(CC) -r $(RALLCFLAGS) -S -o $@ -c libpgm2.c
  112.  
  113. # small data version of libpgm, not registerized (arguments on stack)
  114. $(SLIBPGM):     libpgm1.os libpgm2.os
  115.         -delete $(SLIBPGM)
  116.         join libpgm1.os libpgm2.os to $(SLIBPGM)
  117. libpgm1.os:      $(DEFPGM) $(DEFPBM) $(DEFLIBPGM) libpgm1.c
  118.         $(CC) -r $(SALLCFLAGS) -S -o $@ -c libpgm1.c
  119. libpgm2.os:      $(DEFPGM) $(DEFPBM) $(DEFLIBPGM) libpgm2.c $(DEFLIBPBM)
  120.         $(CC) -r $(SALLCFLAGS) -S -o $@ -c libpgm2.c
  121.  
  122. # large data version of libpgm
  123. $(RLLIBPGM):     libpgm1.olr libpgm2.olr
  124.         -delete $(RLLIBPGM)
  125.         join libpgm1.olr libpgm2.olr to $(RLLIBPGM)
  126. libpgm1.olr:      $(DEFPGM) $(DEFPBM) $(DEFLIBPGM) libpgm1.c
  127.         $(CC) -mD $(RALLCFLAGS) -S -c libpgm1.c -o $@
  128. libpgm2.olr:      $(DEFPGM) $(DEFPBM) $(DEFLIBPGM) libpgm2.c $(DEFLIBPBM)
  129.         $(CC) -mD $(RALLCFLAGS) -S -c libpgm2.c -o $@
  130.  
  131. # large data version of libpgm, not registerized (arguments on stack)
  132. $(SLLIBPGM):    libpgm1.ols libpgm2.ols
  133.         -delete $(SLLIBPGM)
  134.         join libpgm1.ols libpgm2.ols to $(SLLIBPGM)
  135. libpgm1.ols:      $(DEFPGM) $(DEFPBM) $(DEFLIBPGM) libpgm1.c
  136.         $(CC) -mD $(SALLCFLAGS) -S -c libpgm1.c -o $@
  137. libpgm2.ols:      $(DEFPGM) $(DEFPBM) $(DEFLIBPGM) libpgm2.c $(DEFLIBPBM)
  138.         $(CC) -mD $(SALLCFLAGS) -S -c libpgm2.c -o $@
  139.  
  140.  
  141. # Other dependencies.
  142. fstopgm fstopgm.om:              fstopgm.c
  143. hipstopgm hipstopgm.om:          hipstopgm.c
  144. lispmtopgm lispmtopgm.om:        lispmtopgm.c
  145. pgmbentley pgmbentley.om:        pgmbentley.c
  146. pgmcrater pgmcrater.om:          pgmcrater.c
  147. pgmedge pgmedge.om:              pgmedge.c
  148. pgmenhance pgmenhance.om:        pgmenhance.c
  149. pgmhist pgmhist.om:              pgmhist.c
  150. pgmnoise pgmnoise.om:            pgmnoise.c
  151. pgmnorm pgmnorm.om:              pgmnorm.c
  152. pgmoil pgmoil.om:                pgmoil.c
  153. pgmramp pgmramp.om:              pgmramp.c
  154. pgmtexture pgmtexture.om:        pgmtexture.c
  155. pgmtopbm pgmtopbm.om:            pgmtopbm.c dithers.h $(DEFPBM)
  156. pgmtofs pgmtofs.om:              pgmtofs.c
  157. pgmtolispm pgmtolispm.om:        pgmtolispm.c
  158. psidtopgm psidtopgm.om:          psidtopgm.c
  159. rawtopgm rawtopgm.om:            rawtopgm.c
  160. asciitopgm asciitopgm.om:        asciitopgm.c
  161. bioradtopgm bioradtopgm.om:      bioradtopgm.c
  162. spottopgm spottopgm.om:          spottopgm.c
  163. pbmtopgm pbmtopgm.om:            pbmtopgm.c
  164. pgmkernel pgmkernel.om:          pgmkernel.c
  165.  
  166. clean:
  167.         -delete \#?.om \#?.os \#?.or \#?.ols \#?.olr DCC_ERRORS
  168.  
  169. cleanall:   clean
  170.         -delete \#?.lib
  171.         -delete $(BINDIR) all
  172.  
  173. installlib:     lib
  174.         copy $(LIBRARIES) to $(INSTALLLIB)
  175.         copy $(HEADERS) to $(INSTALLINCL)
  176.  
  177. installbin:     binaries
  178.         copy $(BINDIR) all to $(INSTALLBIN)
  179.  
  180. installall:     installlib installbin
  181.  
  182. install:
  183.         @echo "Please select: installlib, installbin, installall"
  184.  
  185.  
  186.