-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
109 lines (80 loc) · 2.63 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
107
108
109
MODULE = $(notdir $(CURDIR))
CWD = $(CURDIR)
GZ = $(CWD)/gz
TMP = $(CWD)/tmp
SRC = $(TMP)/src
FW = $(CWD)/firmware
BR_VER = 2019.05.2
BR = buildroot-$(BR_VER)
BR_GZ = $(BR).tar.gz
.PHONY: os dirs gz src build firmware emu doc wiki merge update
APP ?= os
HW ?= x86
include app/$(APP).mk
include hw/$(HW).mk
include cpu/$(CPU).mk
include arch/$(ARCH).mk
###########################################
DOC = README.md wiki/*.md
doc: docs/index.html
docs/index.html: $(DOC) Makefile
pandoc --metadata pagetitle=" " -f gfm -t html -s --toc -o $@ $(DOC)
wiki:
cd wiki ; git pull -v
# git clone -o gh [email protected]:ponyatov/itstep.wiki.git wiki
########################################### OS
os: dirs gz src build firmware
dirs:
mkdir -p $(GZ) $(TMP) $(SRC) $(FW) $(FW)/$(HW)
distclean:
$(MAKE) -C $(BR) distclean ; rm -rf $(SRC)
gz: $(GZ)/$(BR_GZ)
CONFIG_MK = $(CWD)/app/$(APP).mk $(CWD)/hw/$(HW).mk
CONFIG_MK += $(CWD)/cpu/$(CPU).mk $(CWD)/arch/$(ARCH).mk
CONFIG_BR = $(CWD)/all.br $(CWD)/app/$(APP).br $(CWD)/hw/$(HW).br
CONFIG_BR += $(CWD)/cpu/$(CPU).br $(CWD)/arch/$(ARCH).br
CONFIG_BB = $(CWD)/app/$(APP).bbox
CONFIG_KR = $(CWD)/all.kernel $(CWD)/hw/$(HW).kernel
CONFIG_KR += $(CWD)/cpu/$(CPU).kernel $(CWD)/arch/$(ARCH).kernel
EXTRA_BB = $(CWD)/buildroot:$(CWD)/gambox:$(CWD)/netkit:$(CWD)/iot
build: $(BR)/.config
cd $(BR) ; make menuconfig && make
$(BR)/.config: $(BR)/README Makefile $(CONFIG_BR) $(CONFIG_BB) $(CONFIG_MK)
cd $(BR) ; make BR2_EXTERNAL=\"$(EXTRA_BB)\" $(BR_DEFCONFIG)_defconfig
cat $(CONFIG_BR) >> $@
echo BR2_DL_DIR=\"$(CWD)/gz\" >> $@
echo BR2_ROOTFS_OVERLAY=\"$(CWD)/rootfs\" >> $@
echo BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES=\"$(CONFIG_KR)\" >> $@
echo BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH=\"$(CWD)/wiki/logo.png\" >> $@
echo BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES=\"$(CONFIG_BB)\" >> $@
src: buildroot
buildroot: $(BR)/README
ln -fs $(BR) buildroot
$(BR)/README: $(GZ)/$(BR_GZ)
tar zx < $< && touch $@
$(GZ)/$(BR_GZ):
wget -c -O $@ https://github.com/buildroot/buildroot/archive/$(BR_VER).tar.gz
firmware/%: $(BR)/output/images/%
cp $< $@
MERGE = Makefile README.md .gitignore
MERGE += app hw cpu arch all.* firmware rootfs src buildroot*
MERGE += mex
MERGE += metaL
.PHONY: merge release
merge:
git checkout master
git checkout ponyatov -- $(MERGE)
# $(MAKE) wiki ; $(MAKE) doc
.PHONY: debian
debian:
$(MAKE) -C docker
.PHONY: dock
dock: Dockerfile .dockerignore
docker build -t itstep .
docker run --rm -it -v $(CWD):/itstep itstep mc
.PHONY: update requirements.txt
update:
pip install -U pip
pip install -U -r requirements.txt
requirements.txt:
pip freeze | grep -v 0.0.0 > $@