summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2020-04-21 23:10:07 -0400
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2020-04-21 23:35:14 -0400
commit7739d1863cb6ea5de819e1ae1c1ee10e8109d32b (patch)
treea9eeabbf583cc19ee1539bed51e08075d226132e /Makefile
parent542cfed39c3b3b93e5bab3f7c45d741b71e7c3d7 (diff)
downloadminitramfs-7739d1863cb6ea5de819e1ae1c1ee10e8109d32b.tar.xz
minitramfs-7739d1863cb6ea5de819e1ae1c1ee10e8109d32b.zip
POSIXify, add docs, other changes
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 16 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 6832bbd..3a2f16b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,27 @@
-CC = gcc
-CFLAGS ?= -O2 -pipe
-MAKEFLAGS += -L -R -r
-
all: initramfs.img
-initramfs.img: gen_init_cpio
+initramfs.img: gen_init_cpio dropbear_rsa_host_key dropbear_ecdsa_host_key
./make
--include initramfs.d
-
gen_init_cpio: gen_init_cpio.c
- $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) gen_init_cpio.c -o $@
+
+dropbear_rsa_host_key:
+ dropbearkey -t rsa -f $@
+
+dropbear_ecdsa_host_key:
+ dropbearkey -t ecdsa -f $@
install: initramfs.img
- rm -f /boot/$<.old /boot/$<.new
- cp $< /boot/$<.new || rm -f /boot/$<.new
- if [ -e /boot/$< ]; then mv /boot/$< /boot/$<.old; fi
- mv /boot/$<.new /boot/$<
+ 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 -r initramfs.img initramfs.d gen_init_cpio
+ rm -f initramfs.img initramfs.d gen_init_cpio
+
+-include initramfs.d
.PHONY: all install clean
+MAKEFLAGS += -r # slightly faster