Dependencies among packages

This commit is contained in:
Tony Garnock-Jones 2021-01-20 00:48:27 +01:00
parent 97aaa5ef5d
commit 63c52d6b46
2 changed files with 17 additions and 2 deletions

2
.gitignore vendored
View File

@ -11,3 +11,5 @@ scratch/
.do_built.dir/ .do_built.dir/
tsconfig.tsbuildinfo tsconfig.tsbuildinfo
deps.mk

View File

@ -8,8 +8,21 @@ node_modules/lerna:
PACKAGE_JSONS=$(wildcard packages/*/package.json) PACKAGE_JSONS=$(wildcard packages/*/package.json)
PACKAGE_DIRS=$(PACKAGE_JSONS:/package.json=) PACKAGE_DIRS=$(PACKAGE_JSONS:/package.json=)
all clean veryclean: clean veryclean:
+for d in $(PACKAGE_DIRS); do make -C $$d $@ & done; wait rm -f deps.mk
for d in $(PACKAGE_DIRS); do make -C $$d $@; done
all: $(PACKAGE_DIRS:=/.phony_all)
include deps.mk
deps.mk:
for d in $(PACKAGE_DIRS); do \
echo $$d/.phony_all: $$(fgrep 'file:' "$$d/package.json" | sed -e 's:.*/\([^/"]*\)",:packages/\1/.phony_all:'); \
done > $@
%/.phony_all:
+$(MAKE) -C $* all
watch: watch:
inotifytest make -j$$(nproc) all inotifytest make -j$$(nproc) all