-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
35 lines (29 loc) · 851 Bytes
/
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
BINDIR := bin
IMGTARGET := $(BINDIR)/start.img
MNTPATH := mnt
STAGE1PATH := bootloader/stage1/bin/stage1.bin
STAGE2PATH := bootloader/stage2/bin/stage2.bin
SYSTEMPATH := system/bin/system.bin
.PHONY: install bootloader system clean all
all: bootloader system
install: bootloader system
@echo "creating image..."
@mkdir -p $(BINDIR)
@dd if=/dev/zero of=$(IMGTARGET) bs=512 count=2048
@echo "installing stage1..."
@dd if=$(STAGE1PATH) of=$(IMGTARGET) bs=512 conv=notrunc
@echo "mounting image..."
@mkdir -p $(MNTPATH)
@sudo mount -o users,loop $(IMGTARGET) $(MNTPATH)
@echo "installing stage2..."
@sudo cp $(STAGE2PATH) $(MNTPATH)
@echo "installing system..."
@sudo cp $(SYSTEMPATH) $(MNTPATH)
@sudo umount $(MNTPATH)
bootloader:
@make -C bootloader
system:
@make -C system
clean:
@make -C system clean
@make -C bootloader clean