summaryrefslogtreecommitdiff
path: root/Makefile
blob: e408200373ead9ef068f19ff02fee9dbd0d828c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
all: initramfs.img

initramfs.img: gen_init_cpio dropbear_ed25519_host_key
	./make

gen_init_cpio: gen_init_cpio.c
	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) gen_init_cpio.c -o $@

dropbear_ed25519_host_key:
	dropbearkey -t ed25519 -f $@

install: initramfs.img
	rm -f /boot/initramfs.img.old /boot/initramfs.img.new
	cp initramfs.img /boot/initramfs.img.new || rm -f /boot/initramfs.img.new
	if [ -e /boot/initramfs.img ]; then mv /boot/initramfs.img /boot/initramfs.img.old; fi
	mv /boot/initramfs.img.new /boot/initramfs.img

clean:
	rm -f initramfs.img initramfs.d gen_init_cpio

-include initramfs.d

.PHONY: all install clean
MAKEFLAGS += -r # slightly faster