-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
59 lines (39 loc) · 1.59 KB
/
Makefile
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
# build tools
CP=cp
WEBPACK=npx webpack
# targets
TARGET_DIR=target
SRC_DIR=src
TARGETS_JS=$(TARGET_DIR)/content_scripts/translate.js $(TARGET_DIR)/options/options.js $(TARGET_DIR)/popup/translate.js
TARGETS=$(TARGET_DIR)/manifest.json $(TARGET_DIR)/options/options.html $(TARGET_DIR)/popup/translate.html $(TARGETS_JS)
PACKAGE=llm_translator.xpi
$(TARGET_DIR)/%.js : $(SRC_DIR)/%.js
$(WEBPACK)
$(TARGET_DIR)/%.json : $(SRC_DIR)/%.json
$(CP) $< $@
$(TARGET_DIR)/%.html : $(SRC_DIR)/%.html
$(CP) $< $@
$(TARGET_DIR)/%.css : $(SRC_DIR)/%.css
$(CP) $< $@
all : $(TARGETS) $(PACKAGE)
clean:
$(RM) $(TARGETS)
$(RM) $(PACKAGE)
lint : eslint.config.js
npx eslint
$(TARGET_DIR)/:
mkdir -p $@
$(TARGET_DIR)/content_scripts/:
mkdir -p $@
$(TARGET_DIR)/popup/:
mkdir -p $@
$(TARGET_DIR)/options/:
mkdir -p $@
$(TARGET_DIR)/manifest.json : $(TARGET_DIR)/ $(SRC_DIR)/manifest.json
$(TARGET_DIR)/content_scripts/translate.js : $(TARGET_DIR)/content_scripts/ $(SRC_DIR)/content_scripts/translate.js $(SRC_DIR)/content_scripts/ElementVisitor.js webpack.config.js
$(TARGET_DIR)/options/options.html : $(TARGET_DIR)/options/ $(SRC_DIR)/options/options.html
$(TARGET_DIR)/options/options.js : $(TARGET_DIR)/options/ $(SRC_DIR)/options/options.js $(SRC_DIR)/config.json $(SRC_DIR)/utils.js webpack.config.js
$(TARGET_DIR)/popup/translate.html : $(TARGET_DIR)/popup/ $(SRC_DIR)/popup/translate.html
$(TARGET_DIR)/popup/translate.js : $(TARGET_DIR)/popup/ $(wildcard $(SRC_DIR)/popup/*.js) $(SRC_DIR)/config.json $(SRC_DIR)/utils.js webpack.config.js
$(PACKAGE) : $(TARGETS) package.sh
./package.sh