Skip to content

Commit a80f97a

Browse files
committed
Implement support for parallel make
The trick that I didn't know in commit 7738e9c is to use explicit rules, with a double-colon. With no prerequisites, their recipe is always executed even if the target already exists.
1 parent c42737f commit a80f97a

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

Makefile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ WRITE_C := $(sort $(shell find . -name write.C))
1515
READ_C := $(sort $(shell find . -name read.C))
1616

1717
.PHONY: dict
18-
dict:
19-
@$(foreach d,$(DICT_MAKEFILE_DIR),make -C $(d) &&) true
18+
dict:: $(DICT_MAKEFILE_DIR)
19+
$(DICT_MAKEFILE_DIR)::
20+
@$(MAKE) -C $@
2021

2122
.PHONY: write
22-
write:
23-
@$(foreach c,$(WRITE_C),LD_LIBRARY_PATH=$(shell dirname $(c)) $(ROOT_EXE) -q -l $(c) &&) true
23+
write:: $(WRITE_C)
24+
$(WRITE_C)::
25+
@LD_LIBRARY_PATH=$(shell dirname $@) $(ROOT_EXE) -q -l $@
2426

2527
.PHONY: read
26-
read:
27-
@$(foreach c,$(READ_C),LD_LIBRARY_PATH=$(shell dirname $(c)) $(ROOT_EXE) -q -l $(c) &&) true
28+
read:: $(READ_C)
29+
$(READ_C)::
30+
@LD_LIBRARY_PATH=$(shell dirname $@) $(ROOT_EXE) -q -l $@

0 commit comments

Comments
 (0)