Fix race condition when building -O3 files in parallel

This commit is contained in:
Ryan Dwyer 2021-02-07 21:17:11 +10:00
parent b081a9c755
commit f293847014
1 changed files with 12 additions and 0 deletions

View File

@ -417,6 +417,18 @@ $(B_DIR)/lib/ultra/libc/ll.o: src/lib/ultra/libc/ll.c
$(IDOCC) -c $(CFLAGS) $< -o $@
tools/patchmips3 $@ || rm $@
# Files that use -O3 must be compiled without the ASM processor, otherwise it
# introduces a race condition when using make -j because they create a temporary
# include-stdin.u file during compilation.
$(B_DIR)/lib/ultra/gu/frustum.o: src/lib/ultra/gu/frustum.c
$(IDOCC) -c $(CFLAGS) $< -o $@
$(B_DIR)/lib/ultra/gu/ortho.o: src/lib/ultra/gu/ortho.c
$(IDOCC) -c $(CFLAGS) $< -o $@
$(B_DIR)/lib/ultra/gu/scale.o: src/lib/ultra/gu/scale.c
$(IDOCC) -c $(CFLAGS) $< -o $@
$(B_DIR)/lib/%.o: src/lib/%.c
@mkdir -p $(dir $@)
/usr/bin/env python3 tools/asmpreproc/asm-processor.py -O2 $< | $(IDOCC) -c $(CFLAGS) tools/asmpreproc/include-stdin.c -o $@