home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / conf / Makefile.config < prev    next >
Encoding:
Makefile  |  1992-04-22  |  2.6 KB  |  119 lines

  1. # Mach Operating System
  2. # Copyright (c) 1992 Carnegie Mellon University
  3. # All Rights Reserved.
  4. # Permission to use, copy, modify and distribute this software and its
  5. # documentation is hereby granted, provided that both the copyright
  6. # notice and this permission notice appear in all copies of the
  7. # software, derivative works or modified versions, and any portions
  8. # thereof, and that both notices appear in supporting documentation.
  9. # CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  10. # CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  11. # ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  12. # Carnegie Mellon requests users of this software to return to
  13. #  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  14. #  School of Computer Science
  15. #  Carnegie Mellon University
  16. #  Pittsburgh PA 15213-3890
  17. # any improvements or extensions that they make and grant Carnegie Mellon 
  18. # the rights to redistribute these changes.
  19. #
  20. #
  21. # HISTORY
  22. # $Log:    Makefile.config,v $
  23. # Revision 2.1  92/04/21  17:11:42  rwd
  24. # BSDSS
  25. #
  26. #
  27.  
  28. ${SYS}:    ${MASTER}
  29.     @echo +${SYS} \
  30.     | \
  31.     cat ${MASTER} - ${MASTER} \
  32.     | \
  33.     sed -n \
  34.     -e "/^+/{" \
  35.        -e "s;[-+];#&;gp" \
  36.           -e 't loop' \
  37.        -e ': loop' \
  38.            -e 'n' \
  39.        -e '/^#/b loop' \
  40.        -e '/^$$/b loop' \
  41.        -e 's;^\([^#]*\).*#[     ]*<\(.*\)>[     ]*$$;\2#\1;' \
  42.           -e 't not' \
  43.        -e 's;\([^#]*\).*;#\1;' \
  44.           -e 't not' \
  45.        -e ': not' \
  46.        -e 's;[     ]*$$;;' \
  47.        -e 's;^!\(.*\);\1#!;' \
  48.        -e 'p' \
  49.           -e 't loop' \
  50.            -e 'b loop' \
  51.     -e '}' \
  52.     -e "/^[^#]/d" \
  53.     -e 's;    ; ;g' \
  54.     -e "s;^# *\([^ ]*\)[ ]*=[ ]*\[\(.*\)\].*;\1#\2;p" \
  55.     | \
  56.     awk '-F#' '\
  57.  part == 0 && $$1 != "" {\
  58.     m[$$1]=m[$$1] " " $$2;\
  59.     next;\
  60.  }\
  61.  part == 0 && $$1 == "" {\
  62.     for (i=NF;i>1;i--){\
  63.         s=substr($$i,2);\
  64.         c[++na]=substr($$i,1,1);\
  65.         a[na]=s;\
  66.     }\
  67.     while (na > 0){\
  68.         s=a[na];\
  69.         d=c[na--];\
  70.         if (m[s] == "") {\
  71.             f[s]=d;\
  72.         } else {\
  73.             nx=split(m[s],x," ");\
  74.             for (j=nx;j>0;j--) {\
  75.                 z=x[j];\
  76.                 a[++na]=z;\
  77.                 c[na]=d;\
  78.             }\
  79.         }\
  80.     }\
  81.     part=1;\
  82.     next;\
  83.     }\
  84.     part != 0 {\
  85.     if ($$1 != "") {\
  86.         n=split($$1,x,",");\
  87.         ok=0;\
  88.         for (i=1;i<=n;i++) {\
  89.             if (f[x[i]] == "+") {\
  90.                 ok=1;\
  91.             }\
  92.         }\
  93.         if (NF > 2 && ok == 0 || NF <= 2 && ok != 0) {\
  94.             print $$2; \
  95.         }\
  96.     } else { \
  97.         print $$2; \
  98.     }\
  99.     }' >${SYS}.tmp
  100.     @-if [ -s ${SYS}.tmp ]; then \
  101.         if [ -f ${SYS} ]; then \
  102.         diff ${SYS} ${SYS}.tmp; \
  103.         cp -p ${SYS} ${SYS}.old; \
  104.         fi; \
  105.         cp -p ${SYS}.tmp ${SYS}; \
  106.     fi; \
  107.     rm -f ${SYS}.tmp;
  108.  
  109. ${SYS}.config:    ${SYS} ../conf/files ../conf/files.${cpu} \
  110.     ../conf/Makefile.template ../conf/Makefile.${cpu}
  111.     ../bin/config ${SYS}
  112.