home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / Mgr / Sparcmgr / src.zoo / Makefile next >
Makefile  |  1989-09-27  |  5KB  |  189 lines

  1. #                        Copyright (c) 1987 Bellcore
  2. #                            All Rights Reserved
  3. #       Permission is granted to copy or use this program, EXCEPT that it
  4. #       may not be sold for profit, the copyright notice must be reproduced
  5. #       on copies, and credit should be given to Bellcore where it is due.
  6. #       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7.  
  8. #    $Header: Makefile,v 1.1 89/09/27 09:55:04 sau Exp $
  9. #    $Source: /m1/mgr.new/RCS/Makefile,v $
  10.  
  11. #    top level makefile for mgr
  12.  
  13. #########################################################################
  14.  
  15. #    To make mgr type:
  16. #    make INSROOT=<root> TARGET=<target> [OTHERLIB=<otherlib>]
  17. #        <root> is the mgr root directory (normally /usr/mgr)
  18. #        <target> is the target version of mgr, typically
  19. #            prodmgr:     for the "production" monochrome release or
  20. #            colormgr: for the color version
  21. #        <otherlib> is the name of any auxiliary graphics libraries required.
  22. #            The color (and 386/i) versions need -lpixrect
  23. #
  24.  
  25. #########################################################################33
  26.  
  27.  
  28. # set to root of mgr directory
  29. INSROOT = /usr/mgr
  30. INSROOT = /usr/public/pkg/nmgr
  31.  
  32. # set to auxiliary bitmap library (use -lpixrect for color)
  33. OTHERLIB=-lpixrect
  34. OTHERLIB=
  35.  
  36. # pieces necessary for creating demos and applications only
  37. # (for not-necessarily-suns)
  38. SMALLDIR = lib demo doc menu
  39.  
  40. # directories that need making (-src, a special case)
  41. SUBDIR = font icon $(SMALLDIR)
  42.  
  43. # full mgr directories
  44. ALLDIR = src font icon $(SMALLDIR) misc
  45.  
  46. START=.
  47.  
  48. CPIO=cpio
  49. CPIO_OUT=mgr.cpio
  50. CPIO_OPTS = ocv
  51.  
  52. MAKE=make
  53. TARGET=all
  54.  
  55. all:    src $(SUBDIR)
  56.  
  57. #    this is broken - use co_mgr instead
  58. co:
  59.     -mkdir $(ALLDIR)
  60.     co `make -s list MAKE=true`
  61.     for i in $(ALLDIR); do \
  62.     (cd $$i; echo "    co: $$i";\
  63.      co Makefile
  64.      $(MAKE) co ;\
  65.      cd ..);\
  66.     done    
  67.  
  68. #    "make fast" builds the mgr command quickly, without paying attention
  69. #    to dependencies.
  70.  
  71. fast:
  72.     cd src;  echo "    making src fast";  $(MAKE)  INSROOT=$(INSROOT) fast
  73.  
  74.  
  75. #    "make small" builds the mgr support library and support commands.
  76. #    A "small" mgr package (see smallinstall and smallcpio) is that portion
  77. #    which does not necessarily have to be on the same machine as the mgr
  78. #    command.
  79.  
  80. small:
  81.     for i in $(SMALLDIR); do \
  82.     (cd $$i; echo "    making $$i";\
  83.       $(MAKE)  INSROOT=$(INSROOT) $@;\
  84.      cd ..);\
  85.     done    
  86.  
  87. #    "make <<directoryname>>" will make the named directory.  Note that this
  88. #    is the better way to make individual subdirectories because that way
  89. #    INSROOT is propigated down to all files that need it, in particular
  90. #    "src" files.
  91.  
  92. $(SUBDIR):
  93.     cd $@;  echo "    making $@";  $(MAKE) \
  94.          OTHERLIB=$(OTHERLIB) INSROOT=$(INSROOT) all
  95.  
  96. src:
  97.     cd src; echo " making src"; $(MAKE) \
  98.          OTHERLIB=$(OTHERLIB) INSROOT=$(INSROOT) $(TARGET)
  99.  
  100. #    "make install" installs mgr and all its support files and commands.
  101. #    mgr is not made setuid-root.
  102.  
  103. install:    $(INSROOT)
  104.     cd src; \
  105.      $(MAKE) OTHERLIB=$(OTHERLIB) INSROOT=$(INSROOT) $(TARGET) install;
  106.     for i in $(SUBDIR); do \
  107.     (cd $$i; echo "    installing $$i";\
  108.       $(MAKE)  OTHERLIB=$(OTHERLIB) INSROOT=$(INSROOT) install;\
  109.      cd ..);\
  110.     done    
  111.  
  112. #    "make installasroot" runs "make install" as root.  mgr and some of the
  113. #    support commands are made setuid-root.
  114. installasroot:
  115.     /bin/su root -c '$(MAKE) OTHERLIB=$(OTHERLIB) INSROOT=$(INSROOT) \
  116.         TARGET=$(TARGET) install'
  117.  
  118. #    "make smallinstall" installs the mgr support commands which do not
  119. #    have to be on the same machine as the mgr command.
  120. smallinstall:    $(INSROOT)
  121.     for i in $(SMALLDIR); do \
  122.         (cd $$i; echo "    $@ing $$i";\
  123.          $(MAKE)  OTHERLIB=$(OTHERLIB) INSROOT=$(INSROOT) $@;\
  124.          cd ..);\
  125.     done    
  126.  
  127. $(INSROOT):
  128.     mkdir $@
  129.  
  130. #    "make clean" removes all intermediate files created by "make all".
  131. #    "make clobber" removes all target files created by "make all".
  132. clean clobber:
  133.     for i in $(ALLDIR); do \
  134.         if [ -d $$i ]; then \
  135.             (cd $$i; echo "    $@ing $$i";\
  136.              $(MAKE)  INSROOT=$(INSROOT) $@;\
  137.              cd ..);\
  138.         fi; \
  139.     done    
  140.  
  141. #    "make list" outputs the complete list of files needed by "make all".
  142. #    This list is also what goes into a delivery package.
  143. #    This list is used by several scripts to keep track of stuff
  144. list:
  145.     @echo $(START)/README
  146.     @echo $(START)/Makefile
  147.     @/bin/ls $(START)/PATCH*
  148.     @for i in $(ALLDIR); do \
  149.         echo "$(START)/$$i"; \
  150.         if [ -d $$i ]; then \
  151.             cd $$i; $(MAKE)  START=$(START)/$$i list; cd ..; \
  152.         fi \
  153.     done    
  154.  
  155.  
  156. #    "make smalllist" outputs the list of files needed by "make small".
  157. #    This list is also what goes into a "small" delivery package.
  158. smalllist:
  159.     @echo $(START)/README
  160.     @echo $(START)/Makefile
  161.     @echo $(START)/font
  162.     @echo $(START)/font/default.fnt
  163.     @echo $(START)/font/Makefile
  164.     @for i in $(SMALLDIR); do \
  165.         (cd $$i; echo "$(START)/$$i";\
  166.          $(MAKE)  START=$(START)/$$i list;\
  167.          cd ..);\
  168.     done    
  169.  
  170. #    "make cpio" creates a file containing a complete delivery package.
  171. cpio:
  172.     $(MAKE) -s list | $(CPIO) -$(CPIO_OPTS) > $(CPIO_OUT)
  173.  
  174. #    "make smallcpio" creates a file containing a "small" delivery package.
  175. smallcpio:
  176.     $(MAKE) -s smalllist | $(CPIO) -$(CPIO_OPTS) > $(CPIO_OUT).small
  177.  
  178.  
  179. #    The FRC target forces items to remake.  Thus "make lib" will
  180. #    issue the commands for the "lib" target, even though the lib directory
  181. #    exists.
  182. src $(SUBDIR):    FRC
  183.  
  184. FRC:
  185.  
  186. #    for GNU make
  187. .PHONY:    src $(SUBDIR)
  188. .PHONY:    clean list fast cpio smallcpio install smallinstall
  189.