linux.git = $(HOME)/src/github.com/torvalds/linux all: build .PHONY: all .NOTINTERMEDIATE: .DELETE_ON_ERROR: ################################################################################ generate/files = generate/files += 3rd-party/linux-errno.txt 3rd-party/linux-errno.txt: %: %.gen ./$< $(linux.git) generate/files += lib9p/include/lib9p/linux-errno.h lib9p/include/lib9p/linux-errno.h: %: %.gen 3rd-party/linux-errno.txt ./$^ >$@ generate/files += lib9p/9p.generated.c lib9p/include/lib9p/9p.generated.h lib9p/9p.generated.c lib9p/include/lib9p/9p.generated.h &: lib9p/idl.gen lib9p/idl/*.9p ./$^ generate/files += libusb/include/libusb/tusb_helpers.h 3rd-party/MS-LCID.pdf 3rd-party/MS-LCID.txt libusb/include/libusb/tusb_helpers.h 3rd-party/MS-LCID.pdf 3rd-party/MS-LCID.txt &: libusb/include/libusb/tusb_helpers.h.gen ./$^ ################################################################################ commands := $(patsubst cmd/%/CMakeLists.txt,%,$(wildcard cmd/*/CMakeLists.txt)) build: $(foreach c,$(commands),cmd/$c/build) .PHONY: build cmd/%/build: build/%/Makefile $(generate/files) $(MAKE) -C $(