-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
109 lines (91 loc) · 3.48 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
PWD=$(shell pwd)
BUILDDIR=$(PWD)/build
SRCDIR=$(PWD)/sources
all:
@echo "This is main makefile required to build FreeVMS."
@echo "Today, only 64 bits x86 are supported."
@echo
@echo "This makefile is able to build FreeVMS distribution that"
@echo "contains kernel, system and userland."
@echo
@echo "Available targets:"
@echo "make clean : purge build tree"
@echo "make kernelconfig : configure kernel"
@echo "make kernel : build kernel"
@echo "make bootstrap : build bootstrap code (sigma0 + kickstart)"
@echo "make bootstrap-clean : clean bootstrap code"
@echo "make bootstrap-install : install bootstrap code"
@echo "make freevms : build system"
@echo "make freevms-clean : clean system"
@echo "make freevms-install : install system"
@echo "make userland : build userland"
@echo "make image : install system in ../mnt (loop device)"
@echo "make convert : convert tabs"
@echo "make start-vb : start VirtualBox"
@echo
@echo "To build FreeVMS, run kernelconfig, kernel, bootstrap, freevms "
@echo "and userland."
clean:
@rm -rf $(BUILDDIR)
kernelconfig:
@rm -rf $(BUILDDIR)/pal
@mkdir -p $(BUILDDIR)
@make -C sources/pal BUILDDIR=$(BUILDDIR)/pal
@make -C $(BUILDDIR)/pal menuconfig
kernel:
@make -C $(BUILDDIR)/pal
$(SRCDIR)/kernel/config.h.in:
@(cd $(SRCDIR)/kernel && autoheader && autoconf)
$(BUILDDIR)/kernel/Makefile: Makefile
@mkdir -p $(BUILDDIR)/kernel
@(cd $(BUILDDIR)/kernel && $(SRCDIR)/kernel/configure \
--with-kickstart-linkbase=0x00100000 \
--with-s0-linkbase=0x00080000 \
--with-roottask-linkbase=0x00200000 \
--prefix=$(BUILDDIR)/kernel/build)
$(BUILDDIR)/bootloader/Makefile: Makefile
@mkdir -p $(BUILDDIR)/bootloader
@(cd $(BUILDDIR)/bootloader && $(SRCDIR)/bootloader/configure \
--prefix=$(BUILDDIR)/bootloader/build)
bootstrap-clean: $(BUILDDIR)/kernel/Makefile $(BUILDDIR)/bootloader/Makefile
@make -C $(BUILDDIR)/kernel clean
@make -C $(BUILDDIR)/bootloader clean
bootstrap: $(SRCDIR)/kernel/config.h.in $(BUILDDIR)/kernel/Makefile \
$(BUILDDIR)/bootloader/Makefile
@make -C $(BUILDDIR)/kernel
@(cd $(SRCDIR)/bootloader && ./autogen.sh)
@make -C $(BUILDDIR)/bootloader
bootstrap-install:
@make -C $(BUILDDIR)/kernel install
@make -C $(BUILDDIR)/bootloader install
freevms-clean:
@make -C $(SRCDIR)/freevms clean
freevms:
@make -C $(SRCDIR)/freevms
build/freevms/vmskernel.sys build/freevms/pager.sys build/freevms/init.exe: \
freevms
image: build/freevms/vmskernel.sys \
build/freevms/pager.sys \
build/freevms/init.exe
cp -f build/pal/x86-kernel ../mnt/boot/
cp -f build/kernel/util/kickstart/kickstart ../mnt/boot/
cp -f build/kernel/build/libexec/l4/sigma0 ../mnt/boot/
cp -f build/kernel/build/lib/l4/* ../mnt
cp -f build/freevms/vmskernel.sys ../mnt/boot
cp -f build/freevms/pager.sys ../mnt/boot
cp -f build/freevms/init.exe ../mnt/boot
userland:
@echo "Nothing to do, but you can write it ;-)"
convert:
find sources/freevms -name "*.[chS]" -exec ./converttab {} \;
../frevms.vdi: ../freevms.img
sync
qemu-img convert -O vdi ../freevms.img ../freevms.vdi
start-vb: ../freevms.vdi
@VBoxManage storageattach FreeVMS --storagectl 'Contrôleur IDE' \
--port 0 --device 0 --medium none
@VBoxManage closemedium disk /home/bertrand/openvms/freevms.vdi
@VBoxManage storageattach FreeVMS --storagectl 'Contrôleur IDE' \
--port 0 --device 0 --medium /home/bertrand/openvms/freevms.vdi \
--type hdd
@VBoxManage startvm FreeVMS