Fix ytab.[ch] dependencies to allow parallel make.

The old ytab.o rule produced ytab.c and ytab.h too, but this wasn't
visible as dependencies, so make -j would fail. Make this explicit, and
use the implicit .c.o rule rather than writing out the $(CC) command.
This commit is contained in:
Adam Sampson 2018-08-27 20:28:29 +01:00
parent 837b8da3a5
commit 9a4aa89176
1 changed files with 3 additions and 2 deletions

View File

@ -54,11 +54,12 @@ a.out: ytab.o $(OFILES)
$(OFILES): awk.h ytab.h proto.h
ytab.o: awk.h proto.h awkgram.y
ytab.c: awk.h proto.h awkgram.y
$(YACC) $(YFLAGS) awkgram.y
mv y.tab.c ytab.c
mv y.tab.h ytab.h
$(CC) $(CFLAGS) -c ytab.c
ytab.h: ytab.c
proctab.c: maketab
./maketab >proctab.c