-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (32 loc) · 955 Bytes
/
Makefile
File metadata and controls
46 lines (32 loc) · 955 Bytes
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
.PHONY: test test-watch
test:
go test -vet=all ./...
test-watch:
gow -c test ./...
.PHONY: build
build:
go build ./...
.PHONY: watch
watch:
gow -s -S "Build done" build
SOURCES_DIR := internal/specs/sources/ed
ED_DIR := $(SOURCES_DIR)
IDL_DIR := $(ED_DIR)/idlparsed
ELEMENTS_DIR := $(ED_DIR)/elements
EVENTS_DIR := $(ED_DIR)/events
OUTPUT_DIR := internal/specs/curated
# If you add a new folder to build, include it here.
SOURCE_JSON_FILES := $(wildcard $(IDL_DIR)/*.json) $(wildcard $(ELEMENTS_DIR)/*.json) $(wildcard $(EVENTS_DIR)/*.json)
# The jq transformation command
JQ_CMD := jq -c 'del(.. | .fragment? // empty, .href? // empty)'
TARGET_JSON_FILES := $(SOURCE_JSON_FILES:$(ED_DIR)/%=$(OUTPUT_DIR)/%)
specs: $(TARGET_JSON_FILES)
diag:
echo $(TARGET_JSON_FILES)
# Rule to process each JSON file
$(OUTPUT_DIR)/%.json: $(ED_DIR)/%.json
@echo "Processing $@..."
$(JQ_CMD) $< > $@
.PHONY: release
release: build test
pnpm release