diff options
author | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2020-02-16 22:21:11 -0500 |
---|---|---|
committer | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2020-02-16 22:21:11 -0500 |
commit | 7395bc29e6d762619fb5a45f76c7cdf8d92d4689 (patch) | |
tree | a7b035a9e5bafd4907dabf6eda215ee804898d90 /Makefile | |
parent | cf0b5d4433b6486c8f76be1a92a00ea5bd936190 (diff) | |
download | minitramfs-7395bc29e6d762619fb5a45f76c7cdf8d92d4689.tar.xz minitramfs-7395bc29e6d762619fb5a45f76c7cdf8d92d4689.zip |
update
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -1,21 +1,24 @@ +CC = gcc +CFLAGS ?= -O2 -pipe +MAKEFLAGS += -L -R -r + all: initramfs.img -initramfs.img: +initramfs.img: gen_init_cpio ./make -include initramfs.d -install: install-initramfs.img +gen_init_cpio: gen_init_cpio.c + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@ -install-initramfs.img: initramfs.img - rm -f $@.old $@.new - cp $< $@.new - if [ -e $@ ]; then mv $@ $@.old; fi - mv $@.new $@ +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/$< clean: - $(RM) -r initramfs.img initramfs.d kernel - -.PHONY: all install install-initramfs.img clean + rm -f -r initramfs.img initramfs.d gen_init_cpio -MAKEFLAGS = -L -R -r +.PHONY: all install clean |