aboutsummaryrefslogtreecommitdiff
path: root/Marmot/Makefile
diff options
context:
space:
mode:
authorJon duSaint2022-05-03 16:36:47 -0700
committerJon duSaint2022-05-03 16:36:47 -0700
commit7c75c02f784be12343e2e4f82726f3a5f0ddb6a7 (patch)
treece0bea4ad2f88a77392efaf3d3c3b66a547f8459 /Marmot/Makefile
parent88753ad637bec0c665a611be6e703a519b0660ad (diff)

Marmot: add old project

Diffstat (limited to '')
-rw-r--r--Marmot/Makefile49
1 files changed, 49 insertions, 0 deletions
diff --git a/Marmot/Makefile b/Marmot/Makefile
new file mode 100644
index 0000000..c834095
--- /dev/null
+++ b/Marmot/Makefile
@@ -0,0 +1,49 @@
+# Makefile for Marmot
+
+CC = /usr/bin/gcc
+LD = /usr/bin/ld
+PERL = /usr/bin/perl
+
+ASFLAGS = -Wa,--fatal-warnings
+CFLAGS = -Wall -O2 -ffreestanding -funsigned-char -fno-common -I. -I.
+LDFLAGS = -Map link.map --script=ld.conf
+
+SFILES = boot.S loader.S interrupts.S vesa.S font.S util.S
+CFILES = mm.c video.c irq.c task.c apic.c cpu.c pci.c alloc.c panic.c
+
+
+.PHONY : all
+all : marmot.iso
+
+# Run this rule manually - should never need to be done
+.PHONY : fonts
+fonts :
+ $(PERL) hexfont2data.pl basic_font.hex font.S
+
+marmot.iso : boot.img
+ mkdir -p iso_files
+ cp -f boot.img marmot.bmp iso_files/
+ genisoimage -b boot.img -o marmot.iso iso_files
+
+boot.img : boot
+ $(PERL) mksym.pl
+ dd if=/dev/urandom of=$@ bs=512 count=2880
+ dd if=boot of=$@ bs=512 seek=0 conv=notrunc
+ $(PERL) cs.pl
+
+boot : $(SFILES:.S=.o) $(CFILES:.c=.o)
+ $(LD) $^ $(LDFLAGS) -o $@
+
+.PHONY : asm
+asm : $(CFILES:.c=.s)
+
+%.o : %.S
+ $(CC) $(CFLAGS) $(ASFLAGS) -c -o $@ $<
+
+%.s : %.c
+ $(CC) $(CFLAGS) -S $<
+
+.PHONY : clean
+clean :
+ rm -fr iso_files
+ rm -f boot boot.img marmot.iso link.map symbols.txt *.s *.o *~