Skip to content

Commit

Permalink
Merge pull request lh3#27 from junghans/fix_parallel_build
Browse files Browse the repository at this point in the history
fixed parallel build
  • Loading branch information
onetrueawk authored Jan 21, 2019
2 parents bf2585c + e4bb3bc commit c3c7c13
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,15 @@ a.out: ytab.o $(OFILES)

$(OFILES): awk.h ytab.h proto.h

ytab.c: awk.h proto.h awkgram.y
#Clear dependency for parallel build: (make -j)
#YACC generated y.tab.c and y.tab.h at the same time
#this needs to be a static pattern rules otherwise multiple target
#are mapped onto multiple executions of yacc, which overwrite
#each others outputs.
y%.c y%.h: awk.h proto.h awkgram.y
$(YACC) $(YFLAGS) awkgram.y
mv y.tab.c ytab.c
mv y.tab.h ytab.h
mv y.$*.c y$*.c
mv y.$*.h y$*.h

ytab.h: ytab.c

Expand Down

0 comments on commit c3c7c13

Please sign in to comment.