-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (54 loc) · 1.65 KB
/
Makefile
File metadata and controls
63 lines (54 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
PROJECTS = skillforge runlens ragcheck promptdeck datasetlint go-chrome-ai
REPOS = $(PROJECTS) homebrew-tap itamaker
homebrew-tap_REPO = https://github.com/itamaker/homebrew-tap.git
itamaker_REPO = https://github.com/itamaker/itamaker.git
go-chrome-ai_REPO = https://github.com/itamaker/go-chrome-ai.git
skillforge_REPO = https://github.com/itamaker/skillforge.git
runlens_REPO = https://github.com/itamaker/runlens.git
ragcheck_REPO = https://github.com/itamaker/ragcheck.git
promptdeck_REPO = https://github.com/itamaker/promptdeck.git
datasetlint_REPO = https://github.com/itamaker/datasetlint.git
.PHONY: build test sync clean
ifneq ($(filter sync,$(MAKECMDGOALS)),)
SYNC_GOAL_REPOS := $(filter $(REPOS),$(MAKECMDGOALS))
INVALID_SYNC_GOALS := $(filter-out sync $(REPOS),$(MAKECMDGOALS))
ifneq ($(strip $(INVALID_SYNC_GOALS)),)
$(error Unknown repo target(s) for sync: $(INVALID_SYNC_GOALS))
endif
.PHONY: $(REPOS)
$(REPOS):
@:
endif
ifneq ($(strip $(SYNC_GOAL_REPOS)),)
SYNC_TARGET_REPOS := $(SYNC_GOAL_REPOS)
else
SYNC_TARGET_REPOS := $(REPOS)
endif
build:
@for dir in $(PROJECTS); do \
(cd $$dir && go build ./...); \
done
test:
@for dir in $(PROJECTS); do \
(cd $$dir && go test ./...); \
done
sync: $(addprefix sync-,$(SYNC_TARGET_REPOS))
clean:
@for dir in $(REPOS); do \
if [ -e "$$dir" ]; then \
echo "Removing $$dir"; \
rm -rf "$$dir"; \
else \
echo "Skipping $$dir: not found."; \
fi; \
done
sync-%:
@if [ -d "$*/.git" ]; then \
echo "Pulling $*"; \
git -C "$*" pull --ff-only; \
elif [ -e "$*" ]; then \
echo "Skipping $*: $* exists but is not a git repository."; \
else \
echo "Cloning $*"; \
git clone "$($*_REPO)" "$*"; \
fi