-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
50 lines (42 loc) · 1.28 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
KERNEL_DIR = kernel
LOADER_DIR = loader
SHELL_DIR = shell
LIBKERNEL_DIR = libKernel
ROOT_DIR=$(shell pwd)
export
.PHONY: build
build:
$(MAKE) -C $(LOADER_DIR)
$(MAKE) -C $(KERNEL_DIR)
$(MAKE) -C $(LIBKERNEL_DIR)
$(MAKE) -C $(SHELL_DIR)
clean:
rm -rf images/*
$(MAKE) -C $(LOADER_DIR) clean
$(MAKE) -C $(KERNEL_DIR) clean
$(MAKE) -C $(LIBKERNEL_DIR) clean
$(MAKE) -C $(SHELL_DIR) clean
configure:
mkdir -p images
$(MAKE) -C $(LOADER_DIR) configure
$(MAKE) -C $(KERNEL_DIR) configure
$(MAKE) -C $(LIBKERNEL_DIR) configure
$(MAKE) -C $(SHELL_DIR) configure
pack: images/floppy.img loader/build/bootloader.bin
dd if=./loader/build/bootloader.bin of=./images/floppy.img conv=notrunc bs=512
images/floppy.img:
dd if=/dev/zero of=./images/floppy.img bs=512 count=2880
dd if=./fat_0.hex of=./images/floppy.img conv=notrunc bs=512 seek=1
dd if=./fat_0.hex of=./images/floppy.img conv=notrunc bs=512 seek=10
install: kernel/build/kernel.rnb shell/build/shell.rnb
mount -o loop images/floppy.img /mountpoint -t msdos
cp kernel/build/kernel.rnb /mountpoint/kernel.rnb
cp shell/build/shell.rnb /mountpoint/shell.rnb
sleep 2
umount /mountpoint
uninstall:
mount -o loop images/floppy.img /mountpoint -t msdos
rm /mountpoint/kernel.rnb
rm /mountpoint/shell.rnb
sleep 2
umount /mountpoint