I've got it running reliably. Thing is, I've also tried to port the codebase at work to it (which is a 60000-file codebase) including dependency ordering and that took a while, so I technically worked on it during company time. I still need to get in writing that I can opensource it (but I have already asked without putting it in writing, and my boss is OK with it).b.zaar wrote:@Candy
How far along are you in the design and code? Is this an open source thing I can contribute to?
I have a few ideas for the syntax which makes it a mix between Bash, C and Make that I'd like #included if you are looking for help.
Here's my OS' rulefile:
Code: Select all
arm-CXX-user=~/cross/bin/arm-none-eabi-g++ -std=c++11
arm-CXX-kernel=~/cross/bin/x86_64-pc-elf-g++ -std=c++11 -fno-exceptions -fno-rtti
arm-AR=~/cross/bin/arm-none-eabi-ar
arm-LD=~/cross/bin/arm-none-eabi-ld
x86-CXX-kernel=~/cross/bin/x86_64-pc-elf-g++ -std=c++11 -fno-exceptions -fno-rtti -mcmodel=large
x86-CXX-user=~/cross/bin/x86_64-pc-elf-g++ -std=c++11
x86-CC-kernel=~/cross/bin/x86_64-pc-elf-gcc -std=gnu99 -mcmodel=large
x86-CC-user=~/cross/bin/x86_64-pc-elf-gcc -std=gnu99
x86-AR=~/cross/bin/x86_64-pc-elf-ar
x86-LD=~/cross/bin/x86_64-pc-elf-ld
x86-ASM=~/cross/bin/yasm
host-AR=ar
host-CXX-user=g++ -std=c++11
host-CC-user=gcc -D_FILE_OFFSET_BITS=64 -std=gnu99
kernel-DEPS=libs/libcpp libs/libos
loader-DEPS=
tools/fusedriver-DEPS=libs/libstarfs
libs/libstarfs-DEPS=
libs/libcpp-DEPS=
libs/libos-DEPS=
libs/libz-DEPS=libs/libcpp
libs/libpng-DEPS=libs/libz
tools/mkfs-DEPS=libs/libstarfs
tools/fusedriver-ADDITIONAL-LIBS=-lfuse -lulockmgr
tools/mkfs-ADDITIONAL-LIBS=
COMPILER-c=CC
COMPILER-cpp=CXX
.*\.c.*>>(.*)/src/(.*)\.(c|cpp) => out/$(ARCH:x86 arm host)/$(CONFIG:user kernel)/obj/\1/\2.o
$($(ARCH)-$(COMPILER-\3)-$(CONFIG)) $(subst (.*),-I@1/include,$(rep_subst (.*),@1 $(@1-DEPS),\1)) -c -o $@ $^
.*\.S>>(.*)\.(arm|x86)\.S => out/\2/$(CONFIG:user kernel)/obj/\1.o
$(\2-CXX-$(CONFIG)) -c -o $@ $^
boot/structure.asm => out/x86/kernel/bin/bootsector.bin
$(x86-ASM) -o $@ $^
#todo: remove x86 in next line and make generic. Also fix arm build.
out/x86/kernel/bin/.* out/host/bin/tools/mkfs.elf out/host/bin/tools/fusedriver.elf => disk.img
./makeimage.sh
out/([^/]*)/kernel/obj/kernel/.*\.o => out/\1/kernel/bin/kernel.elf out/\1/kernel/bin/kernel.elf.map
$(\1-LD) -o $@ -T kernel/link/\1.ld $^ -z max-page-size=0x1000 -Map [email protected]
out/([^/]*)/([^/]*)/obj/(libs/[^/]*)/.*\.o => out/\1/\2/lib/\3.a
$(\1-AR) rcs $@ $^
out/x86/kernel/obj/loader/.*\.o => out/x86/kernel/bin/loader.bin out/x86/kernel/bin/loader.bin.map
$(x86-LD) -o $@ -T loader/link.ld $^ -Map [email protected]
out/host/user/obj/(tools/[^/]*)/.*\.o $(subst (.*),out/host/user/lib/@1.a,$(\1-DEPS)) => out/host/bin/\1.elf
$(host-CC-user) -o $@ $^ $(\1-ADDITIONAL-LIBS)
disk.img => all
touch all
Combuster: All three sound like a great idea. WRT the syntax, do you have a concrete proposal?
I'm looking for people thinking along first and foremost - I'm honestly fresh out of ideas and used to its syntax, and I have trouble finding complex projects that need solutions to not fix it to the projects I can find. If you have syntax ideas I'm all ears - I dislike regexes as they are hard to read, but they're hard to beat for recognizability and compactness. It is already between Make and Bash, so what'd you want to add / change?b.zaar wrote:@Candy
How far along are you in the design and code? Is this an open source thing I can contribute to?
I have a few ideas for the syntax which makes it a mix between Bash, C and Make that I'd like #included if you are looking for help.