From de20d7430df08731d9108acb83e1234ba7f1fe16 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sat, 19 Sep 2020 14:53:29 -0400 Subject: file manager --- makefile | 68 ++++++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 25 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index bb8e2dc..c698f3c 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,6 @@ kgccargs = -Wall -Wsuggest-attribute=pure -Wsuggest-attribute=const -m32 -Og -ffreestanding -fno-asynchronous-unwind-tables ugccargs = ${kgccargs} -Isrc/user/include +ugppargs = ${kgccargs} -Isrc/user/include/cpp -Isrc/user/include nasmargs = -f elf32 partlink = -r -m elf_i386 @@ -30,7 +31,7 @@ out/fs/bin/%: obj/%.elf out/fs: out/fs/bin/init out/fs/bin/meminfo out/fs/bin/highway \ out/fs/bin/hello out/fs/bin/dumptext out/fs/bin/dumphex \ - out/fs/bin/dirinfo + out/fs/bin/dirinfo out/fs/bin/fileman mkdir -p out/fs cp -r fs-skel/* out/fs/ @@ -42,14 +43,14 @@ obj/kernel/%.kao: src/kernel/%.asm mkdir -p $(shell dirname $@) nasm ${nasmargs} $< -o $@ -out/kernel.bin: obj/kernel/drive.ko obj/kernel/fat.ko obj/kernel/ide.ko \ - obj/kernel/idt.ko obj/kernel/log.ko obj/kernel/main.ko \ - obj/kernel/main2.ko obj/kernel/pmap.ko obj/kernel/paging.ko \ - obj/kernel/panic.ko obj/kernel/pci.ko obj/kernel/elf.ko \ - obj/kernel/serial.ko obj/kernel/task.ko obj/kernel/util.ko \ - obj/kernel/vga.ko obj/kernel/isrs.kao obj/kernel/kbd.ko +out/kernel.bin: obj/kernel/drive.ko obj/kernel/fat.ko obj/kernel/ide.ko \ + obj/kernel/idt.ko obj/kernel/log.ko obj/kernel/main.ko \ + obj/kernel/panic.ko obj/kernel/pci.ko obj/kernel/elf.ko \ + obj/kernel/serial.ko obj/kernel/task.ko obj/kernel/util.ko \ + obj/kernel/vga.ko obj/kernel/isrs.kao obj/kernel/kbd.ko \ + obj/kernel/pmap.ko obj/kernel/paging.ko mkdir -p out - ld -T src/kernel/elf-link.ld obj/kernel/* -o obj/kernel.elf + ld -T src/kernel/elf-link.ld $^ -o obj/kernel.elf objcopy -O binary obj/kernel.elf out/kernel.bin out/boot.bin: src/boot.asm @@ -64,29 +65,46 @@ obj/%.ao: src/user/%.asm mkdir -p $(shell dirname $@) nasm ${nasmargs} $< -o $@ -obj/knob.so: obj/knob/env.o obj/knob/file.o obj/knob/format.o \ - obj/knob/heap.o obj/knob/quit.o obj/knob/user.o \ - obj/knob/task.o obj/knob/entry.ao obj/knob/block.o - ld ${partlink} obj/knob/* -o obj/knob.so +obj/%.po: src/user/%.cpp + mkdir -p $(shell dirname $@) + g++ ${ugppargs} -c $< -o $@ + +obj/c.rto: obj/runtimes/c/entry.ao + ld ${partlink} obj/runtimes/c/* -o obj/c.rto + +obj/cpp.rto: + #TODO -obj/init.elf: obj/init/init.o obj/knob.so - ld -T src/user/elf.ld obj/init/* obj/knob.so -o obj/init.elf +obj/knob.so: obj/knob/env.o obj/knob/file.o obj/knob/format.o \ + obj/knob/heap.o obj/knob/user.o obj/knob/task.o \ + obj/knob/block.o + ld ${partlink} $^ -o $@ -obj/meminfo.elf: obj/meminfo/meminfo.o obj/knob.so - ld -T src/user/elf.ld obj/meminfo/* obj/knob.so -o obj/meminfo.elf +obj/cove.so: obj/cove/cove.po obj/cove/buttons.po obj/cove/label.po \ + obj/cove/vlist.po + ld ${partlink} $^ -o $@ + +obj/init.elf: obj/init/init.o obj/knob.so obj/c.rto + ld -T src/user/runtimes/c/elf.ld $^ -o $@ + +obj/meminfo.elf: obj/meminfo/meminfo.o obj/knob.so obj/c.rto + ld -T src/user/runtimes/c/elf.ld $^ -o $@ obj/highway.elf: obj/highway/main.o obj/highway/cmds.o obj/highway/line.o \ - obj/highway/vars.o obj/knob.so - ld -T src/user/elf.ld obj/highway/* obj/knob.so -o obj/highway.elf + obj/highway/vars.o obj/knob.so obj/c.rto + ld -T src/user/runtimes/c/elf.ld $^ -o $@ obj/hello.elf: obj/hello/hello.ao - ld -T src/user/elf.ld obj/hello/* -o obj/hello.elf + ld -T src/user/runtimes/asm/elf.ld $^ -o $@ + +obj/dumptext.elf: obj/dumptext/dumptext.o obj/knob.so obj/c.rto + ld -T src/user/runtimes/c/elf.ld $^ -o $@ -obj/dumptext.elf: obj/dumptext/dumptext.o obj/knob.so - ld -T src/user/elf.ld obj/dumptext/* obj/knob.so -o obj/dumptext.elf +obj/dumphex.elf: obj/dumphex/dumphex.o obj/knob.so obj/c.rto + ld -T src/user/runtimes/c/elf.ld $^ -o $@ -obj/dumphex.elf: obj/dumphex/dumphex.o obj/knob.so - ld -T src/user/elf.ld obj/dumphex/* obj/knob.so -o obj/dumphex.elf +obj/dirinfo.elf: obj/dirinfo/dirinfo.o obj/knob.so obj/c.rto + ld -T src/user/runtimes/c/elf.ld $^ -o $@ -obj/dirinfo.elf: obj/dirinfo/dirinfo.o obj/knob.so - ld -T src/user/elf.ld obj/dirinfo/* obj/knob.so -o obj/dirinfo.elf \ No newline at end of file +obj/fileman.elf: obj/fileman/fileman.o obj/knob.so obj/c.rto + ld -T src/user/runtimes/c/elf.ld $^ -o $@ \ No newline at end of file -- cgit v1.2.3