-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (37 loc) · 1.12 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
DOCKER_IMAGE_NAME = syspro
all: bootloader kernel apps copy
OVMF.fd:
cp /usr/share/ovmf/OVMF.fd $(CURDIR)
bootloader:
make all -C bootloader
kernel:
make all -C kernel
apps:
make all -C apps
qemu: OVMF.fd
qemu-system-x86_64 -m 4G -bios ./OVMF.fd -hda fat:rw:./fs -smp 32\
-netdev user,id=n1,hostfwd=tcp::8080-:80 -device virtio-net-pci,netdev=n1\
-object filter-dump,id=f1,netdev=n1,file=dump.pcap \
-monitor unix:qemu-monitor-socket,server,nowait
copy: bootloader kernel apps
mkdir -p fs/EFI/BOOT
cp bootloader/BOOTX64.EFI fs/EFI/BOOT/
cp kernel/kernel ./fs/
cp apps/app1 ./fs/
cp apps/app2 ./fs/
cp apps/app3 ./fs/
monitor:
socat - unix:qemu-monitor-socket
docker-build: Dockerfile
docker build -t $(DOCKER_IMAGE_NAME) --no-cache=true\
--build-arg USER_ID=$(shell id -u)\
--build-arg GROUP_ID=$(shell id -g) .
docker-make:
docker run -it --rm -v $(CURDIR):/work $(DOCKER_IMAGE_NAME) make -C /work
clean:
rm -r fs || :
rm OVMF.fd dump.pcap || :
make clean -C bootloader || :
make clean -C kernel || :
make clean -C apps || :
.PHONY: all bootloader kernel apps copy docker-run docker-build qemu clean