Annotation of researchv10no/cmd/usgmake/rules.c, revision 1.1.1.1

1.1       root        1: /*      @(#)rules.c     3.1     */
                      2: #include "defs"
                      3: /* DEFAULT RULES FOR UNIX */
                      4: 
                      5: /*
                      6:  *      These are the internal rules that "make" trucks around with it at
                      7:  *      all times. One could completely delete this entire list and just
                      8:  *      conventionally define a global "include" makefile which had these
                      9:  *      rules in it. That would make the rules dynamically changeable
                     10:  *      without recompiling make. This file may be modified to local
                     11:  *      needs. There are currently two versions of this file with the
                     12:  *      source; namely, rules.c (which is the version running in Columbus)
                     13:  *      and pwbrules.c which is my attempt at satisfying the requirements
                     14:  *      of PWB systems.
                     15:  *      The makefile for make (make.mk) is parameterized for a different
                     16:  *      rules file. The macro $(RULES) defined in "make.mk" can be set
                     17:  *      to another file and when "make" is "made" the procedure will
                     18:  *      use the new file. The recommended way to do this is on the
                     19:  *      command line as follows:
                     20:  *              "make -f make.mk RULES=pwbrules"
                     21:  */
                     22: 
                     23: CHARSTAR builtin[] =
                     24:         {
                     25:         ".SUFFIXES: .o .c .c~ .y .y~ .l .l~ .s .s~ .sh .sh~ .h .h~",
                     26: 
                     27: /* PRESET VARIABLES */
                     28:         "MAKE=make",
                     29:         "YACC=yacc",
                     30:         "YFLAGS=",
                     31:         "LEX=lex",
                     32:         "LFLAGS=",
                     33:         "LD=ld",
                     34:         "LDFLAGS=-n",
                     35:         "CC=cc",
                     36:         "CFLAGS=-O",
                     37:         "AS=as",
                     38:         "ASFLAGS=",
                     39:         "GET=get",
                     40:         "GFLAGS=",
                     41: 
                     42: /* SINGLE SUFFIX RULES */
                     43:         ".c:",
                     44:                 "\t$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@",
                     45:         ".c~:",
                     46:                 "\t$(GET) $(GFLAGS) -p $< > $*.c",
                     47:                 "\t$(CC) $(CFLAGS) $(LDFLAGS) $*.c -o $*",
                     48:                 "\t-rm -f $*.c",
                     49:         ".sh:",
                     50:                 "\tcp $< $@; chmod 0777 $@",
                     51:         ".sh~:",
                     52:                 "\t$(GET) $(GFLAGS) -p $< > $*.sh",
                     53:                 "\tcp $*.sh $*; chmod 0777 $@",
                     54:                 "\t-rm -f $*.sh",
                     55: 
                     56: /* DOUBLE SUFFIX RULES */
                     57:         ".c.o:",
                     58:                 "\t$(CC) $(CFLAGS) -c $<",
                     59:         ".c~.o:",
                     60:                 "\t$(GET) $(GFLAGS) -p $< > $*.c",
                     61:                 "\t$(CC) $(CFLAGS) -c $*.c",
                     62:                 "\t-rm -f $*.c",
                     63:         ".c~.c:",
                     64:                 "\t$(GET) $(GFLAGS) -p $< > $*.c",
                     65:         ".s.o:",
                     66:                 "\t$(AS) $(ASFLAGS) -o $@ $<",
                     67:         ".s~.o:",
                     68:                 "\t$(GET) $(GFLAGS) -p $< > $*.s",
                     69:                 "\t$(AS) $(ASFLAGS) -o $*.o $*.s",
                     70:                 "\t-rm -f $*.s",
                     71:         ".y.o:",
                     72:                 "\t$(YACC) $(YFLAGS) $<",
                     73:                 "\t$(CC) $(CFLAGS) -c y.tab.c",
                     74:                 "\trm y.tab.c",
                     75:                 "\tmv y.tab.o $@",
                     76:         ".y~.o:",
                     77:                 "\t$(GET) $(GFLAGS) -p $< > $*.y",
                     78:                 "\t$(YACC) $(YFLAGS) $*.y",
                     79:                 "\t$(CC) $(CFLAGS) -c y.tab.c",
                     80:                 "\trm -f y.tab.c $*.y",
                     81:                 "\tmv y.tab.o $*.o",
                     82:         ".l.o:",
                     83:                 "\t$(LEX) $(LFLAGS) $<",
                     84:                 "\t$(CC) $(CFLAGS) -c lex.yy.c",
                     85:                 "\trm lex.yy.c",
                     86:                 "\tmv lex.yy.o $@",
                     87:         ".l~.o:",
                     88:                 "\t$(GET) $(GFLAGS) -p $< > $*.l",
                     89:                 "\t$(LEX) $(LFLAGS) $*.l",
                     90:                 "\t$(CC) $(CFLAGS) -c lex.yy.c",
                     91:                 "\trm -f lex.yy.c $*.l",
                     92:                 "\tmv lex.yy.o $*.o",
                     93:         ".y.c :",
                     94:                 "\t$(YACC) $(YFLAGS) $<",
                     95:                 "\tmv y.tab.c $@",
                     96:         ".y~.c :",
                     97:                 "\t$(GET) $(GFLAGS) -p $< > $*.y",
                     98:                 "\t$(YACC) $(YFLAGS) $*.y",
                     99:                 "\tmv y.tab.c $*.c",
                    100:                 "\t-rm -f $*.y",
                    101:         ".l.c :",
                    102:                 "\t$(LEX) $<",
                    103:                 "\tmv lex.yy.c $@",
                    104:         ".c.a:",
                    105:                 "\t$(CC) -c $(CFLAGS) $<",
                    106:                 "\tar rv $@ $*.o",
                    107:                 "\trm -f $*.o",
                    108:         ".c~.a:",
                    109:                 "\t$(GET) $(GFLAGS) -p $< > $*.c",
                    110:                 "\t$(CC) -c $(CFLAGS) $*.c",
                    111:                 "\tar rv $@ $*.o",
                    112:                 "\trm -f $*.[co]",
                    113:         ".s~.a:",
                    114:                 "\t$(GET) $(GFLAGS) -p $< > $*.s",
                    115:                 "\t$(AS) $(ASFLAGS) -o $*.o $*.s",
                    116:                 "\tar rv $@ $*.o",
                    117:                 "\t-rm -f $*.[so]",
                    118:         ".h~.h:",
                    119:                 "\t$(GET) $(GFLAGS) -p $< > $*.h",
                    120:         "markfile.o:    markfile",
                    121:                 "\tA=@;echo \"static char _sccsid[] = \\042`grep $$A'(#)' markfile`\\042;\" > markfile.c",
                    122:                 "\tcc -c markfile.c",
                    123:                 "\trm -f markfile.c",
                    124:         0 };
                    125: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.