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 / PPM / Makefile.std < prev    next >
Makefile  |  1996-11-18  |  8KB  |  239 lines

  1. # Makefile for ppm 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. # Default values, usually overridden by top-level Makefile.
  13. #CC =        cc
  14. CC =        gcc -ansi -pedantic -fpcc-struct-return
  15. CFLAGS =    -O
  16. #CFLAGS =    -g
  17. #CFLAGS =    -g -O
  18. #LDFLAGS =    -s
  19. LDFLAGS =    
  20. INSTALLBINARIES =    /usr/new/pbm
  21. INSTALLSCRIPTS =    $(INSTALLBINARIES)
  22. INSTALLMANUALS1 =    /usr/man/mann
  23. SUFFIXMANUALS1 =    1
  24. INSTALLMANUALS3 =    /usr/man/mann
  25. SUFFIXMANUALS3 =    3
  26. INSTALLMANUALS5 =    /usr/man/mann
  27. SUFFIXMANUALS5 =    5
  28. MANCP =            cp
  29.  
  30. PGMDIR =    ../pgm
  31. INCLUDEPGM =    -I$(PGMDIR)
  32. LIBPGM =    $(PGMDIR)/libpgm.a
  33. DEFPGM =    $(PGMDIR)/pgm.h
  34. DEFLIBPGM =    $(PGMDIR)/libpgm.h
  35.  
  36. PBMDIR =    ../pbm
  37. INCLUDEPBM =    -I$(PBMDIR)
  38. LIBPBM =    $(PBMDIR)/libpbm.a
  39. DEFPBM =    $(PBMDIR)/pbm.h ../pbmplus.h
  40. DEFLIBPBM =    $(PBMDIR)/libpbm.h
  41.  
  42. SHELL =        /bin/sh
  43. INCLUDE =    -I.. $(INCLUDEPGM) $(INCLUDEPBM)
  44. ALLCFLAGS =    $(CFLAGS) $(INCLUDE)
  45. LIBPPM =    libppm.a
  46.  
  47. PORTBINARIES =    bmptoppm gouldtoppm hpcdtoppm ilbmtoppm imgtoppm \
  48.         mtvtoppm pcxtoppm pgmtoppm pi1toppm picttoppm \
  49.         pjtoppm \
  50.         ppm3d ppmbrighten ppmchange ppmdim ppmdist ppmdither \
  51.         ppmflash ppmhist ppmmake ppmmix ppmnorm \
  52.         ppmntsc ppmquant ppmrelief ppmshift ppmspread \
  53.         ppmtoacad \
  54.         ppmtobmp ppmtogif ppmtoicr ppmtoilbm ppmtomitsu \
  55.         ppmtopcx ppmtopgm ppmtopi1 ppmtopict ppmtopj \
  56.         ppmtopjxl ppmtopuzz ppmtorgb3 ppmtosixel \
  57.         ppmtotga ppmtouil ppmtoxpm ppmtoyuv \
  58.         ppmtoyuvsplit \
  59.         qrttoppm rawtoppm rgb3toppm sldtoppm spctoppm \
  60.         sputoppm tgatoppm ximtoppm xpmtoppm xvminitoppm \
  61.         yuvtoppm yuvsplittoppm
  62. MATHBINARIES =    ppmforge ppmpat ppmqvga ppmtomap
  63. BINARIES =    $(PORTBINARIES) $(MATHBINARIES)
  64. SCRIPTS =    ppmquantall
  65.  
  66. OBJECTS =    bmptoppm.o gouldtoppm.o hpcdtoppm.o ilbmtoppm.o imgtoppm.o \
  67.         mtvtoppm.o pcxtoppm.o pgmtoppm.o pi1toppm.o picttoppm.o \
  68.         pjtoppm.o \
  69.         ppm3d.o ppmbrighten.o ppmchange.o ppmdim.o ppmdist.o ppmdither.o \
  70.         ppmflash.o ppmhist.o ppmmake.o ppmmix.o ppmnorm.o \
  71.         ppmntsc.o ppmquant.o ppmrelief.o ppmshift.o ppmspread.o \
  72.         ppmtoacad.o \
  73.         ppmtobmp.o ppmtogif.o ppmtoicr.o ppmtoilbm.o ppmtomitsu.o \
  74.         ppmtopcx.o ppmtopgm.o ppmtopi1.o ppmtopict.o ppmtopj.o \
  75.         ppmtopjxl.o ppmtopuzz.o ppmtorgb3.o ppmtosixel.o \
  76.         ppmtotga.o ppmtouil.o ppmtoxpm.o ppmtoyuv.o \
  77.         ppmtoyuvsplit.o \
  78.         qrttoppm.o rawtoppm.o rgb3toppm.o sldtoppm.o spctoppm.o \
  79.         sputoppm.o tgatoppm.o ximtoppm.o xpmtoppm.o xvminitoppm.o \
  80.         yuvtoppm.o yuvsplittoppm.o \
  81.         ppmforge.o ppmpat.o ppmqvga.o ppmtomap.o
  82.  
  83. MANUALS1 =    $(BINARIES) $(SCRIPTS)
  84. MANUALS3 =    libppm
  85. MANUALS5 =    ppm
  86.  
  87.  
  88. #all:        binaries
  89. all:        merge
  90. #install:    install.bin
  91. install:    install.merge
  92.  
  93.  
  94. binaries:    $(BINARIES)
  95.  
  96. install.bin:    binaries $(SCRIPTS)
  97.     cd $(INSTALLBINARIES) ; rm -f $(BINARIES)
  98.     cp $(BINARIES) $(INSTALLBINARIES)
  99.     cd $(INSTALLSCRIPTS) ; rm -f $(SCRIPTS)
  100.     cp $(SCRIPTS) $(INSTALLSCRIPTS)
  101.     cd $(INSTALLSCRIPTS) ; chmod +x $(SCRIPTS)
  102.  
  103.  
  104. merge:        ppmmerge
  105. ppmmerge:    ppmmerge.c $(OBJECTS) $(LIBPPM) $(LIBPGM) $(LIBPBM)
  106.     $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c $(OBJECTS) -lm $(LIBPPM) $(LIBPGM) $(LIBPBM)
  107.  
  108. install.merge:    install.ppmmerge $(SCRIPTS)
  109. install.ppmmerge:    ppmmerge
  110.     cd $(INSTALLBINARIES) ; rm -f $(BINARIES)
  111.     cp ppmmerge $(INSTALLBINARIES)
  112.     cd $(INSTALLBINARIES) ; for i in $(BINARIES) ; do ln ppmmerge $$i ; done
  113.     rm -f $(INSTALLBINARIES)/ppmmerge
  114.     cd $(INSTALLSCRIPTS) ; rm -f $(SCRIPTS)
  115.     cp $(SCRIPTS) $(INSTALLSCRIPTS)
  116.     cd $(INSTALLSCRIPTS) ; chmod +x $(SCRIPTS)
  117.  
  118.  
  119. install.man:
  120.     for i in $(MANUALS1) ; do \
  121.         rm -f $(INSTALLMANUALS1)/$$i.$(SUFFIXMANUALS1) ; \
  122.         $(MANCP) $$i.1 $(INSTALLMANUALS1)/$$i.$(SUFFIXMANUALS1) ; \
  123.     done
  124.     for i in $(MANUALS3) ; do \
  125.         rm -f $(INSTALLMANUALS3)/$$i.$(SUFFIXMANUALS3) ; \
  126.         $(MANCP) $$i.3 $(INSTALLMANUALS3)/$$i.$(SUFFIXMANUALS3) ; \
  127.     done
  128.     for i in $(MANUALS5) ; do \
  129.         rm -f $(INSTALLMANUALS5)/$$i.$(SUFFIXMANUALS5) ; \
  130.         $(MANCP) $$i.5 $(INSTALLMANUALS5)/$$i.$(SUFFIXMANUALS5) ; \
  131.     done
  132.  
  133.  
  134. # Rule for plain programs.
  135. $(PORTBINARIES):    ppm.h $(DEFPGM) $(DEFPBM) $(LIBPPM) $(LIBPGM) $(LIBPBM)
  136.     $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c $(LIBPPM) $(LIBPGM) $(LIBPBM)
  137.  
  138. # Rule for math-dependent programs.
  139. $(MATHBINARIES):    ppm.h $(DEFPGM) $(DEFPBM) $(LIBPPM) $(LIBPGM) $(LIBPBM)
  140.     $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c -lm $(LIBPPM) $(LIBPGM) $(LIBPBM)
  141.  
  142. # Rule for objects.
  143. $(OBJECTS):    ppm.h $(DEFPGM) $(DEFPBM)
  144.     $(CC) $(ALLCFLAGS) "-Dmain=$*_main" -c $*.c
  145.  
  146. # And libraries.
  147. $(LIBPBM):
  148.     cd $(PBMDIR) ; make lib
  149. $(LIBPGM):
  150.     cd $(PGMDIR) ; make lib
  151. lib:        $(LIBPPM)
  152. $(LIBPPM):    libppm1.o libppm2.o libppm3.o libppm4.o libppm5.o bitio.o
  153.     -rm -f $(LIBPPM)
  154.     ar rc $(LIBPPM) libppm1.o libppm2.o libppm3.o libppm4.o \
  155.     libppm5.o bitio.o
  156.     -ranlib $(LIBPPM)
  157.  
  158. libppm1.o:    ppm.h $(DEFPGM) $(DEFPBM) libppm.h libppm1.c
  159.     $(CC) $(ALLCFLAGS) -c libppm1.c
  160. libppm2.o:    ppm.h $(DEFPGM) $(DEFPBM) libppm.h libppm2.c $(DEFLIBPGM) \
  161.         $(DEFLIBPBM)
  162.     $(CC) $(ALLCFLAGS) -c libppm2.c
  163. libppm3.o:    ppm.h $(DEFPGM) $(DEFPBM) ppmcmap.h libppm.h libppm3.c
  164.     $(CC) $(ALLCFLAGS) -c libppm3.c
  165. libppm4.o:    ppm.h $(DEFPGM) $(DEFPBM) libppm4.c
  166.     $(CC) $(ALLCFLAGS) -c libppm4.c
  167. libppm5.o:    ppm.h $(DEFPGM) $(DEFPBM) ppmdraw.h libppm5.c
  168.     $(CC) $(ALLCFLAGS) -c libppm5.c
  169. bitio.o:    ../pbmplus.h bitio.c
  170.     $(CC) $(ALLCFLAGS) -c bitio.c
  171.  
  172. # Other dependencies.
  173. bmptoppm bmptoppm.o:        bmptoppm.c bitio.o bitio.h bmp.h
  174. gouldtoppm gouldtoppm.o:    gouldtoppm.c
  175. hpcdtoppm hpcdtoppm.o:        hpcdtoppm.c
  176. ilbmtoppm ilbmtoppm.o:        ilbmtoppm.c ilbm.h
  177. imgtoppm imgtoppm.o:        imgtoppm.c
  178. mtvtoppm mtvtoppm.o:        mtvtoppm.c
  179. pcxtoppm pcxtoppm.o:        pcxtoppm.c
  180. pgmtoppm pgmtoppm.o:        pgmtoppm.c
  181. pi1toppm pi1toppm.o:        pi1toppm.c
  182. picttoppm picttoppm.o:        picttoppm.c
  183. pjtoppm pjtoppm.o:        pjtoppm.c
  184. ppm3d ppm3d.o:            ppm3d.c
  185. ppmbrighten ppmbrighten.o:    ppmbrighten.c
  186. ppmchange ppmchange.o:        ppmchange.c
  187. ppmdim ppmdim.o:        ppmdim.c
  188. ppmdist ppmdist.o:        ppmdist.c ppmcmap.h
  189. ppmdither ppmdither.o:        ppmdither.c
  190. ppmflash ppmflash.o:        ppmflash.c
  191. ppmforge ppmforge.o:        ppmforge.c
  192. ppmhist ppmhist.o:        ppmhist.c ppmcmap.h
  193. ppmmake ppmmake.o:        ppmmake.c
  194. ppmmix ppmmix.o:        ppmmix.c
  195. ppmnorm ppmnorm.o:        ppmnorm.c lum.h
  196. ppmntsc ppmntsc.o:        ppmntsc.c
  197. ppmpat ppmpat.o:        ppmpat.c ppmdraw.h
  198. ppmquant ppmquant.o:        ppmquant.c $(PGMDIR)/dithers.h ppmcmap.h
  199. ppmqvga ppmqvga.o:        ppmqvga.c
  200. ppmrelief ppmrelief.o:        ppmrelief.c
  201. ppmshift ppmshift.o:        ppmshift.c
  202. ppmspread ppmspread.o:        ppmspread.c
  203. ppmtoacad ppmtoacad.o:        ppmtoacad.c ppmcmap.h autocad.h
  204. ppmtobmp ppmtobmp.o:        ppmtobmp.c bitio.h bmp.h
  205. ppmtogif ppmtogif.o:        ppmtogif.c ppmcmap.h
  206. ppmtoicr ppmtoicr.o:        ppmtoicr.c ppmcmap.h
  207. ppmtoilbm ppmtoilbm.o:        ppmtoilbm.c ilbm.h ppmcmap.h
  208. ppmtomitsu ppmtomitsu.o:    ppmtomitsu.c ppmcmap.h mitsu.h
  209. ppmtomap ppmtomap.o:        ppmtomap.c ppmcmap.h
  210. ppmtopcx ppmtopcx.o:        ppmtopcx.c ppmcmap.h
  211. ppmtopgm ppmtopgm.o:        ppmtopgm.c
  212. ppmtopi1 ppmtopi1.o:        ppmtopi1.c ppmcmap.h
  213. ppmtopict ppmtopict.o:        ppmtopict.c ppmcmap.h
  214. ppmtopj ppmtopj.o:        ppmtopj.c
  215. ppmtopjxl ppmtopjxl.o:        ppmtopjxl.c ppmcmap.h
  216. ppmtopuzz ppmtopuzz.o:        ppmtopuzz.c ppmcmap.h
  217. ppmtorgb3 ppmtorgb3.o:        ppmtorgb3.c
  218. ppmtosixel ppmtosixel.o:    ppmtosixel.c ppmcmap.h
  219. ppmtotga ppmtotga.o:        ppmtotga.c ppmcmap.h
  220. ppmtouil ppmtouil.o:        ppmtouil.c ppmcmap.h
  221. ppmtoxpm ppmtoxpm.o:        ppmtoxpm.c ppmcmap.h
  222. ppmtoyuv ppmtoyuv.o:        ppmtoyuv.c
  223. ppmtoyuvsplit ppmtoyuvsplit.o:    ppmtoyuvsplit.c
  224. qrttoppm qrttoppm.o:        qrttoppm.c
  225. rawtoppm rawtoppm.o:        rawtoppm.c
  226. rgb3toppm rgb3toppm.o:        rgb3toppm.c
  227. sldtoppm sldtoppm.o:        sldtoppm.c ppmdraw.h autocad.h
  228. spctoppm spctoppm.o:        spctoppm.c
  229. sputoppm sputoppm.o:        sputoppm.c
  230. tgatoppm tgatoppm.o:        tgatoppm.c tga.h
  231. ximtoppm ximtoppm.o:        ximtoppm.c xim.h
  232. xpmtoppm xpmtoppm.o:        xpmtoppm.c
  233. xvminitoppm xvminitoppm.o:    xvminitoppm.c
  234. yuvtoppm yuvtoppm.o:        yuvtoppm.c
  235. yuvsplittoppm yuvsplittoppm.o:    yuvsplittoppm.c
  236.  
  237. clean:
  238.     -rm -f *.o *.a *.cat *~ core $(BINARIES) ppmmerge
  239.