-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (38 loc) · 1.01 KB
/
Copy pathMakefile
File metadata and controls
46 lines (38 loc) · 1.01 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
EXTENSION_NAME := time-tracker-analytics
VERSION := $(shell python3 -c "import json; print(json.load(open('manifest.json'))['version'])")
DIST_DIR := dist
ZIP_FILE := $(DIST_DIR)/$(EXTENSION_NAME)-v$(VERSION).zip
SOURCES := \
manifest.json \
src/background/background.js \
src/popup/popup.html \
src/popup/popup.css \
src/popup/popup.js \
assets/icons/icon128.png \
assets/screenshots/chrome_time_tracker_demo.png \
assets/screenshots/chrome_time_tracker_demo_1280x800.png \
README.md \
PRIVACY.md \
LICENSE
.PHONY: all build clean validate list
all: build
build: validate $(ZIP_FILE)
$(ZIP_FILE): $(SOURCES)
mkdir -p $(DIST_DIR)
rm -f $(ZIP_FILE)
zip -r $(ZIP_FILE) $(SOURCES)
@echo "Built $(ZIP_FILE)"
validate:
python3 -m json.tool manifest.json > /dev/null
@for file in $(SOURCES); do \
if [ ! -f "$$file" ]; then \
echo "Missing required file: $$file"; \
exit 1; \
fi; \
done
@echo "Validation passed"
list:
@echo "Package files:"
@printf ' %s\n' $(SOURCES)
clean:
rm -rf $(DIST_DIR)