This repository has been archived by the owner on Sep 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
106 lines (79 loc) · 2.19 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
include config.mk
.PHONY: all
all: deps rootfs image
.PHONY: clean
clean:
@rm -rf "$(rootfs)" "$(image)" /tmp/debian.iso
@rm -rf dist
.PHONY: deps
deps: deps-rootfs deps-image deps-install
.PHONY: dist
dist: dist/ntos-rootfs-w$(week)-x64.tar.gz dist/ntos-image-w$(week)-x64.tar.gz
.PHONY: help
help:
@cat HELP.txt
# Rootfs
.PHONY: deps-rootfs
deps-rootfs:
apt-get install -y debootstrap
.PHONY: login
login: $(rootfs)
@echo "You are now in the rootfs ($(rootfs)), when you finish type: exit"
@ROOTFS="$(rootfs)" scripts/rootfs/run.sh bash
@$(MAKE) -s rootfs-clean
.PHONY: rootfs
rootfs: $(rootfs) rootfs-clean
.PHONY: rootfs-clean
rootfs-clean:
ROOTFS="$(rootfs)" scripts/rootfs/clean.sh
$(rootfs): scripts/rootfs/create.sh scripts/rootfs/setup.sh
ROOTFS="$(rootfs)" MIRROR="$(mirror)" PACKAGES="$(packages)" $<
ROOTFS="$(rootfs)" MIRROR="$(mirror)" $(word 2,$^)
dist/ntos-rootfs-w$(week)-x64.tar.gz: $(rootfs)
@mkdir -p $$(dirname $@)
cd $< && tar -czf "$$OLDPWD/$@" .
# Image
.PHONY: deps-image
deps-image:
apt-get install -y p7zip squashfs-tools syslinux syslinux-efi wget
.PHONY: image
image: $(image)
IMAGE="$(image)" \
HOSTNAME="$(hostname)" \
USERNAME="$(username)" \
TIMEZONE="$(timezone)" \
scripts/image/menu.sh
$(image): scripts/image/create.sh
@rm -rf "$(image)"
ROOTFS="$(rootfs)" IMAGE="$(image)" $<
dist/ntos-image-w$(week)-x64.tar.gz: $(image)
@mkdir -p $$(dirname $@)
@rm -rf "$(image)/syslinux/syslinux.cfg" "$(image)/EFI/boot/syslinux.cfg"
cd $< && tar -czf "$$OLDPWD/$@" .
@$(MAKE) -s image
# Install
.PHONY: deps-install
deps-install:
apt-get install -y cryptsetup dosfstools fdisk syslinux
.PHONY: install
install: image
IMAGE="$(image)" scripts/install.sh
# Development
.PHONY: ci
ci: lint
.PHONY: clean-dev
clean-dev: clean
@rm -rf $(make_bin)
.PHONY: deps-dev
deps-dev: $(make_bin)/shellcheck
.PHONY: lint
lint: $(make_bin)/shellcheck
$< -s sh \
$$(find .make/scripts/ -name "*.sh" -exec echo {} +) \
$$(find scripts/ -name "*.sh" -exec echo {} +)
.PHONY: lint-md
lint-md:
@docker run --rm -it -v "$$PWD":/files/ ntrrg/md-linter
$(make_bin)/shellcheck: .make/scripts/install-shellcheck.sh
@mkdir -p $$(dirname $@)
@RELEASE=$(shellcheck_release) DEST=$@ $<