DoorPi/Makefile
2021-03-09 17:02:04 +01:00

48 lines
1.1 KiB
Makefile

BR2_EXTERNAL=../br_external
all: sdcard.img
sdcard.img: root_overlay
sdcard.img: buildroot/.config
make -C buildroot all
cp buildroot/output/images/sdcard.img sdcard.img
root_overlay: root_overlay/bin/test.py
root_overlay: root_overlay/etc/door_tokens
root_overlay: root_overlay/etc/dropbear/dropbear_ecdsa_host_key
root_overlay: root_overlay/root/.ssh/authorized_keys
root_overlay: root_overlay/root/key
root_overlay/root/.ssh/authorized_keys: ~/.ssh/id_rsa.pub
cp ^< $@
buildroot/.config: config
ln -sf ../config $@
root_overlay/etc/door_tokens:
mkdir -p `dirname $@`
touch $@
root_overlay/root/key:
mkdir -p `dirname $@`
dd if=/dev/urandom of=$@ bs=1 count=16
root_overlay/bin/test.py: door_control/door.py
mkdir -p `dirname $@`
cp $< $@
root_overlay/etc/dropbear/dropbear_ecdsa_host_key:
mkdir -p `dirname $@`
ssh-keygen -t ecdsa -f $@
clean:
make -C buildroot clean
rm -f sdcard.img
rm -f root_overlay/root/.ssh/authorized_keys
rm -f root_overlay/bin/test.py
menuconfig:
make -C buildroot menuconfig
.PHONY: all clean sdcard.img menuconfig root_overlay