-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (62 loc) · 2.62 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
# .env file should have
# - ${DEV_RPI}: for sshing into a device, `<username>@<host>`
include .env
# Assumption that this makefile is run from the root of `albert`
MODULE_NAME=albert
ROOT_PWD=$(PWD)
BR_EXT=BR2_EXTERNAL=$(ROOT_PWD)/br-ext-tree
build-dev: $(MODULE_NAME)-create-dev-defconfig
@make build-image defconfig=$(MODULE_NAME)_dev_defconfig
build:
@make build-image defconfig=$(MODULE_NAME)_defconfig
build-image: buildroot/.git
# cd buildroot/ && git reset --hard
# config
@make $(defconfig)
# Rebuild projects
@make $(MODULE_NAME)-rebuild
# Run build
cd buildroot && make $(BR_EXT)
@make check
build-image-no-rebuild-custom: buildroot/.git
@make $(defconfig)
cd buildroot && make $(BR_EXT)
@make check
check:
ls buildroot/output/build/$(MODULE_NAME)-ui-0.0.2
ls buildroot/output/target/usr/bin/$(MODULE_NAME)-ui
check-packages:
./buildroot/utils/check-package -b $(ROOT_PWD)/br-ext-tree/package/albert-ui/*
./buildroot/utils/check-package -b $(ROOT_PWD)/br-ext-tree/package/albert-temperature-sensor/*
flash: buildroot/output/images/sdcard.img
stat -c %y buildroot/output/images/sdcard.img
dd bs=5M if=buildroot/output/images/sdcard.img of=/dev/sdc conv=fsync
# If submodule is not initialized, initialzie it
buildroot/.git:
git submodule update --init
$(MODULE_NAME)-create-dev-defconfig:
cd br-ext-tree/configs && \
echo "# === AUTOGENERATED FILE ============" > $(MODULE_NAME)_dev_defconfig && \
echo "# Edit input files then run make $@" >> $(MODULE_NAME)_dev_defconfig && \
echo "# to regenerate this file" >> $(MODULE_NAME)_dev_defconfig && \
cat $(MODULE_NAME)_defconfig dev_defconfig.partial >> $(MODULE_NAME)_dev_defconfig
# Removes cached build and runs rebuild
$(MODULE_NAME)-rebuild:
cd buildroot && make $(MODULE_NAME)-ui-dirclean $(BR_EXT)
cd buildroot && make $(MODULE_NAME)-ui-rebuild $(BR_EXT)
cd buildroot && make $(MODULE_NAME)-temperature-sensor-dirclean $(BR_EXT)
cd buildroot && make $(MODULE_NAME)-temperature-sensor-rebuild $(BR_EXT)
savedefconfig:
cd buildroot && make savedefconfig BR2_DEFCONFIG=$(ROOT_PWD)/br-ex-tree/configs/albert_defconfig
savedevdefconfig:
cd buildroot && make savedefconfig BR2_DEFCONFIG=../br-ex-tree/configs/albert_dev_defconfig
barebox-menuconfig linux-menuconfig menuconfig uboot-menuconfig $(MODULE_NAME)_defconfig $(MODULE_NAME)_dev_defconfig graph-depends show-info pkg-stats:
@echo $(BR_EXT)
cd buildroot && make $@ $(BR_EXT)
run:
cd br-ext-tree/package/$(MODULE_NAME)-ui && make $@
clean:
cd buildroot && make clean
ccache --clear --dir $$HOME/.buildroot-ccache
dev:
rsync -avz ./br-ext-tree/package/* ${DEV_RPI}:/home/d0nkrs/albert/br-ext-tree/package/