home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 309.lha / PBM_PLUS / pnm / Makefile < prev    next >
Makefile  |  1980-12-04  |  4KB  |  131 lines

  1. # Makefile for pnm tools.
  2. #
  3. # Copyright (C) 1989 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 -fstrength-reduce -fcombine-regs
  15. # CFLAGS =    -O
  16. CFLAGS =    -g
  17. # CFLAGS =    
  18. # LDFLAGS =    -s
  19. LDFLAGS =    
  20. INSTALLBINARIES =    /usr/new/pbm
  21. INSTALLMANUALS =    n
  22.  
  23. # CONFIGURE: You can compile PNM without PPM.  If you don't want PPM,
  24. # comment out the next five lines.  This will make the PNM programs use
  25. # less memory.
  26. PPMOPT =    -DPPM
  27. PPMDIR =    ../ppm
  28. INCLUDEPPM =    -I$(PPMDIR)
  29. LIBPPM =    $(PPMDIR)/libppm.a
  30. DEFPPM =    $(PPMDIR)/ppm.h ../pbmplus.h
  31. DEFLIBPPM =    $(PPMDIR)/libppm.h
  32.  
  33. # CONFIGURE: Likewise here: if you don't have PGM, comment these lines out.
  34. PGMOPT =    -DPGM
  35. PGMDIR =    ../pgm
  36. INCLUDEPGM =    -I$(PGMDIR)
  37. LIBPGM =    $(PGMDIR)/libpgm.a
  38. DEFPGM =    $(PGMDIR)/pgm.h
  39. DEFLIBPGM =    $(PGMDIR)/libpgm.h
  40.  
  41. # PBM is required, don't comment these lines out.
  42. PBMOPT =    -DPBM
  43. PBMDIR =    ../pbm
  44. INCLUDEPBM =    -I$(PBMDIR)
  45. LIBPBM =    $(PBMDIR)/libpbm.a
  46. DEFPBM =    $(PBMDIR)/pbm.h
  47. DEFLIBPBM =    $(PBMDIR)/libpbm.h
  48.  
  49. INCLUDE =    $(INCLUDEPPM) $(INCLUDEPGM) $(INCLUDEPBM)
  50. ALLCFLAGS =    $(CFLAGS) $(PPMOPT) $(PGMOPT) $(PBMOPT) $(INCLUDE)
  51. LIBPNM =    libpnm.a
  52.  
  53. PORTBINARIES =    pnmcat pnmcrop pnmcut pnmenlarge pnmflip pnminvert pnmpaste \
  54.         pnmtile
  55.  
  56. PORTMANUALS =    pnm.5 pnmcat.1 pnmcrop.1 pnmcut.1 pnmenlarge.1 pnmflip.1 \
  57.         pnminvert.1 pnmpaste.1 pnmtile.1
  58.  
  59. BINARIES =    $(PORTBINARIES)
  60.  
  61. all:        binaries
  62. install:    installbinaries
  63.  
  64. binaries:    $(BINARIES)
  65.  
  66. installbinaries:    binaries
  67.     cp $(BINARIES) $(INSTALLBINARIES)
  68.  
  69. installmanuals:
  70.     cp $(PORTMANUALS) /usr/man/man$(INSTALLMANUALS)
  71.  
  72. # Rule for plain programs.
  73. $(PORTBINARIES):    pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) $(LIBPNM) \
  74.             $(LIBPPM) $(LIBPGM) $(LIBPBM)
  75.     $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c $(LIBPNM) $(LIBPPM) $(LIBPGM) $(LIBPBM)
  76.  
  77. # And library.
  78. $(LIBPNM):    libpnm1.o libpnm2.o libpnm3.o
  79.     -rm $(LIBPNM)
  80.     ar rc $(LIBPNM) libpnm1.o libpnm2.o libpnm3.o
  81.     -ranlib $(LIBPNM)
  82.  
  83. libpnm1.o:    pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm1.c
  84.     $(CC) $(ALLCFLAGS) -c libpnm1.c
  85. libpnm2.o:    pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm2.c $(DEFLIBPPM) \
  86.         $(DEFLIBPGM) $(DEFLIBPBM)
  87.     $(CC) $(ALLCFLAGS) -c libpnm2.c
  88. libpnm3.o:    pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm3.c $(DEFLIBPPM) \
  89.         $(DEFLIBPGM) $(DEFLIBPBM)
  90.     $(CC) $(ALLCFLAGS) -c libpnm3.c
  91.  
  92. # Other dependencies.
  93. pnmcat:        pnmcat.c
  94. pnmcrop:    pnmcrop.c
  95. pnmcut:        pnmcut.c
  96. pnmenlarge:    pnmenlarge.c
  97. pnmflip:    pnmflip.c
  98. pnminvert:    pnminvert.c
  99. pnmpaste:    pnmpaste.c
  100. pnmtile:    pnmtile.c
  101.  
  102. clean:
  103.     -rm -f *.o *.a *.cat core $(BINARIES)
  104.  
  105.  
  106. # Imakefile stuff.  Ignore if you're not an X11 type.
  107.  
  108.             TOP = ../../../../../../usr/src/new/X11
  109.  
  110.              RM = rm -f
  111.              MV = mv
  112.         UTILSRC = $(TOP)/util
  113.        IMAKESRC = $(UTILSRC)/imake
  114.        IRULESRC = $(UTILSRC)/imake.includes
  115.           IMAKE = $(IMAKESRC)/imake
  116.   IMAKE_DEFINES =
  117.       IMAKE_CMD = $(NEWTOP)$(IMAKE) -TImake.tmpl -I$(NEWTOP)$(IRULESRC) \
  118.             -s Makefile $(IMAKE_DEFINES)
  119. Makefile: Imakefile \
  120.     $(IRULESRC)/Imake.tmpl \
  121.     $(IRULESRC)/Imake.rules \
  122.     $(IRULESRC)/site.def \
  123.     $(IRULESRC)/$(MACROFILE)
  124.     -@if [ -f Makefile ]; then \
  125.     echo "$(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
  126.     $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  127.     else exit 0; fi
  128.     $(IMAKE_CMD) -DTOPDIR=$(TOP)
  129.  
  130. Makefiles:
  131.