mirror of
https://github.com/yldio/copilot.git
synced 2024-11-30 23:20:06 +02:00
c959751d9a
- Fixes #35
30 lines
743 B
Makefile
30 lines
743 B
Makefile
.PHONY: check
|
|
check:
|
|
@yarn install --prefer-offline
|
|
@./bin/setup
|
|
|
|
.PHONY: setup
|
|
setup: .git/hooks/pre-commit
|
|
@cp bin/pre-commit.hook .git/hooks/pre-commit
|
|
|
|
SUBDIRS := $(dir $(wildcard */Makefile))
|
|
TARGETS := install clean test lint # whatever else, but must not contain '/'
|
|
|
|
# foo/.all bar/.all foo/.clean bar/.clean
|
|
SUBDIRS_TARGETS := \
|
|
$(foreach t,$(TARGETS),$(addsuffix $t,$(SUBDIRS)))
|
|
|
|
.PHONY: $(TARGETS) $(SUBDIRS_TARGETS)
|
|
|
|
# static pattern rule, expands into:
|
|
# all clean: %: foo/.% bar/.%
|
|
$(TARGETS): %: $(addsuffix %,$(SUBDIRS))
|
|
@echo 'Done "$*" target'
|
|
|
|
# here, for foo/.all:
|
|
# $(@D) is foo
|
|
# $(@F) is .all, with leading period
|
|
# $(@F:.%=%) is just all
|
|
$(SUBDIRS_TARGETS):
|
|
$(MAKE) --no-print-directory -C $(@D) $(@F:.%=%)
|