Skip to content

Commit

Permalink
test.mk: don't use a temporary random.bin
Browse files Browse the repository at this point in the history
Sometimes using a temp file to make test-random.h breaks builds because
clean and test get made in parallel.

Since debugging parallel make is anything but easy, it's better to just
not use the intermediate file.  This patch makes it use a pipe instead.

Signed-off-by: Peter Jones <[email protected]>
  • Loading branch information
vathpela committed Jan 22, 2025
1 parent 98173f0 commit cbf2abd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ libefi-test.a :
clean

test-random.h:
dd if=/dev/urandom bs=512 count=17 of=random.bin
xxd -i random.bin test-random.h
dd if=/dev/urandom bs=512 count=17 status=none | xxd - test-random.h

$(wildcard test-*.c) :: %.c : test-random.h
$(patsubst %.c,%,$(wildcard test-*.c)) :: | test-random.h
Expand Down Expand Up @@ -119,14 +118,13 @@ test-coverage : CFLAGS_GCOV+=--coverage
test-coverage : $(tests)

test-clean :
@rm -vf test-random.h random.bin libefi-test.a
@rm -vf test-random.h libefi-test.a
@rm -vf *.gcda *.gcno *.gcov vgcore.*

clean : test-clean

all : test-clean test

.PHONY: $(tests) all test clean
.SECONDARY: random.bin

# vim:ft=make

0 comments on commit cbf2abd

Please sign in to comment.