-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (32 loc) · 920 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
36
37
38
39
40
41
42
43
44
45
CC ?= gcc
CFLAGS ?= -fno-stack-protector
LD ?= ld
LDFLAGS ?=
AS ?= as
ASFLAGS ?=
all: dumb_cycle
clean: clean_dumb_cycle
dumb_cycle: src/main.o src/mem.o src/runtime.o
$(LD) $(LDFLAGS) -o dumb_cycle src/main.o src/mem.o src/runtime.o
clean_dumb_cycle: clean_main clean_mem clean_runtime
rm -f dumb_cycle
src/mem.o: src/mem.c
$(CC) $(CFLAGS) -c -o src/mem.o src/mem.c
clean_mem:
rm -f src/mem.o
src/main.o: src/main.c
$(CC) $(CFLAGS) -c -o src/main.o src/main.c
clean_main:
rm -f src/main.o
src/runtime.o: src/runtime.s
$(AS) $(ASFLAGS) -o src/runtime.o src/runtime.s
clean_runtime:
rm -f src/runtime.o
test: dumb_cycle vm
cp dumb_cycle vm/fs/bin/dumb_cycle
cd vm; ./mkinitfs.sh
qemu-system-x86_64 -kernel vm/vmlinuz -initrd vm/initramfs -accel kvm \
-vga std -no-reboot & sleep 1 && vncviewer :5900
vm:
curl -o vm.tar.gz https://musing.permutationlock.com/static/vm.tar.gz
tar -xvf vm.tar.gz