-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (55 loc) · 1.27 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
compilerdir = sjc
compiler_jar = sjc.jar
path_compiler_jar = $(compilerdir)/$(compiler_jar)
sourcedir = src
builddir = build
includedir = include
raw_out = raw_out.bin
bootloader_img_name = bbk_iso.bin
cd_img_name = cdimage.iso
clean:
rm -rf $(builddir)
rm -rf $(compilerdir)
install-sjc:
curl https://www.fam-frenz.de/stefan/compsnpe.zip -o tools.zip
mkdir -p $(compilerdir)
unzip -d $(compilerdir) -j tools.zip
rm tools.zip
install-sjc-if-needed:
if [ ! -d $(compilerdir) ]; then make install-sjc; fi
compile: \
install-sjc-if-needed
mkdir -p $(builddir)
cp -r $(includedir)/* $(builddir)
java \
-jar $(path_compiler_jar) \
src/main \
-o raw \
-O $(builddir)/$(raw_out) \
-p $(builddir) \
-y \
-s 10000M \
-t ia32 -T nsop \
-u rte \
-g \
-G \
-D sym $(builddir)/symbols.txt
-n
run: \
compile
mkisofs \
-o $(builddir)/$(cd_img_name) \
-N -b $(bootloader_img_name) \
-no-emul-boot \
-boot-load-seg 0x7C0 \
-boot-load-size 4 \
-V "SJCCD" \
-A "SJC compiled bootable OS" \
-graft-points CDBOOT/BOOT_ISO.IMG=$(builddir)/$(raw_out) \
$(includedir)/$(bootloader_img_name)
qemu-system-x86_64 \
-m 1024 \
-rtc base=localtime \
-no-reboot \
-debugcon file:$(builddir)/serial.log \
-boot d -cdrom $(builddir)/$(cd_img_name)