-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (51 loc) · 1.78 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
59
60
61
62
63
64
65
66
SEVENZIP ?= 7z
REPO=hlandau/kconfigreport
BUILD_DIR=build
NETCACHE_DIR=$(BUILD_DIR)/cache/net
KCACHE_DIR=$(BUILD_DIR)/cache/kernel
CONFIGS_DIR=$(BUILD_DIR)/configs
REPORT_DIR=$(BUILD_DIR)/report
.PHONY: all clean send
all: $(REPORT_DIR)/index.xhtml
clean:
rm -rf "$(BUILD_DIR)"
### General operations.
##############################################################################
$(CONFIGS_DIR)/%: $(KCACHE_DIR)/%
mkdir -p "$(CONFIGS_DIR)"
./scripts/extract-ikconfig "$<" > "$@.tmp"
mv "$@.tmp" "$@"
### Include distro-specific methods.
##############################################################################
_CONFIGS=
include scripts/mk/nixos.mk
include scripts/mk/debian.mk
include scripts/mk/fedora.mk
include scripts/mk/arch.mk
include scripts/mk/alpine.mk
ALL_CONFIGS := $(foreach x,$(_CONFIGS),$(CONFIGS_DIR)/$(x)) $(CONFIGS)
### Collation.
##############################################################################
$(BUILD_DIR)/configs.db: $(ALL_CONFIGS)
./scripts/collate "$(BUILD_DIR)/configs.db" "$(CONFIGS_DIR)"
### Output generation.
##############################################################################
$(REPORT_DIR)/index.xhtml: $(BUILD_DIR)/configs.db ./scripts/mkreport
mkdir -p "$(REPORT_DIR)/option"
./scripts/mkreport "$(BUILD_DIR)/configs.db" "$(REPORT_DIR)"
### Upload to github.
##############################################################################
send: $(REPORT_DIR)/index.xhtml
( DIR="$$(mktemp -d ./send.XXXXXXXXX)"; \
git clone . "$$DIR"; \
cd "$$DIR"; \
git checkout --orphan send-1; \
git rm -rf .; \
rsync -a "../$(BUILD_DIR)/report/" .; \
rsync -a "../$(BUILD_DIR)/configs/" configs; \
git add .; \
git commit -m gh-pages; \
git push --force "git@github.com:$(REPO).git" send-1:gh-pages; \
cd ..; \
rm -rf "$$DIR"; \
)