From 5329b592b75f304609ba34e46d326def64d54dbd Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 30 Jul 1992 19:53:39 +0000 Subject: Formerly default.c.~15~ --- default.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'default.c') diff --git a/default.c b/default.c index 7d153d4..6f69c95 100644 --- a/default.c +++ b/default.c @@ -48,11 +48,11 @@ static struct pspec default_pattern_rules[] = static struct pspec default_terminal_rules[] = { - /* RCS. These commands are not echoed because RCS makes enough noise. */ + /* RCS. */ "%", "%,v", - "@test -f $@ || $(CO) $(COFLAGS) $< $@", + "$(CHECKOUT,v)", "%", "RCS/%,v", - "@test -f $@ || $(CO) $(COFLAGS) $< $@", + "$(CHECKOUT,v)", /* SCCS. */ "%", "s.%", @@ -60,7 +60,7 @@ static struct pspec default_terminal_rules[] = "%", "SCCS/s.%", "$(GET) $(GFLAGS) $<", - 0, 0, 0 + 0, 0, 0, }; static char *default_suffix_rules[] = @@ -128,8 +128,7 @@ static char *default_suffix_rules[] = ".y.ln", "$(YACC.y) $< \n $(LINT.c) -C$* y.tab.c \n $(RM) y.tab.c", ".l.ln", - "@$(RM) $*.c \n $(LEX.l) $< > $*.c \n\ -$(LINT.c) -i $*.c -o $@ \n $(RM) $*.c", + "@$(RM) $*.c\n $(LEX.l) $< > $*.c\n$(LINT.c) -i $*.c -o $@\n $(RM) $*.c", ".y.c", "$(YACC.y) $< \n mv -f y.tab.c $@", @@ -177,8 +176,8 @@ $(LINT.c) -i $*.c -o $@ \n $(RM) $*.c", ".web.tex", "$(WEAVE) $<", - 0} -; + 0, 0, + }; static char *default_variables[] = { @@ -187,6 +186,13 @@ static char *default_variables[] = "AS", "as", "CC", "cc", "C++", "g++", + + /* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist, + and to the empty string if $@ does exist. */ + "CHECKOUT,v", + "$(patsubst $@-noexist,$(CO) $(COFLAGS) $< $@,\ + $(filter-out $@,$(firstword $(wildcard $@) $@-noexist)))", + "CO", "co", "CPP", "$(CC) -E", #ifdef CRAY -- cgit v1.2.3