Skip to content

Commit

Permalink
switch to Jinx (Andy-Python-Programmer#117)
Browse files Browse the repository at this point in the history
Signed-off-by: Anhad Singh <[email protected]>
  • Loading branch information
Andy-Python-Programmer authored Feb 11, 2024
1 parent dd72c3d commit 4b5f108
Show file tree
Hide file tree
Showing 266 changed files with 6,910 additions and 6,933 deletions.
6 changes: 5 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
* text=auto eol=lf
*.real linguist-language=Assembly

jinx-config linguist-language=Shell
host-recipes/* linguist-language=Shell
recipes/* linguist-language=Shell
source-recipes/* linguist-language=Shell
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y nasm
sudo apt-get install -y nasm make
python3 -m pip install requests xbstrap
- name: Build Documentation
run: ./aero.py --document
run: make doc
- name: Formatting Check
run: |
./aero.py --fmt
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,12 @@ base-files/server

# todo: remove these
debug

# XXXXXXXXXXXXXXXX
3rdparty/
.jinx-cache
sources/
host-pkgs/
host-builds/
pkgs/
builds/
47 changes: 47 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
jinx:
if [ ! -d "target/jinx" ]; then \
git clone https://github.com/mintsuki/jinx target/jinx; \
fi

# FIXME: autosync
mkdir -p target/cargo-home
cp build-support/rust/config.toml target/cargo-home/config.toml

.PHONY: distro
distro: jinx
./target/jinx/jinx build-all

SOURCE_DIR := src
USERLAND_DIR := userland
USERLAND_TARGET := builds/userland/target/init
KERNEL_TARGET := src/target/x86_64-aero_os/release/aero_kernel

.PHONY: clean
clean:
rm -rf src/target

$(KERNEL_TARGET): $(shell find $(SOURCE_DIR) -type f -not -path '$(SOURCE_DIR)/target/*')
cd src && cargo build --package aero_kernel --target .cargo/x86_64-aero_os.json --release
@$(MAKE) iso

$(USERLAND_TARGET): $(shell find $(USERLAND_DIR) -type f -not -path '$(USERLAND_DIR)/target/*')
./target/jinx/jinx rebuild userland
@$(MAKE) distro-image

.PHONY: iso
iso: $(KERNEL_TARGET)
./build-support/mkiso.sh

.PHONY: distro-image
distro-image: distro
./build-support/mkimage.sh

.PHONY: qemu
qemu: $(KERNEL_TARGET) $(USERLAND_TARGET)
${QEMU_PATH}/qemu-system-x86_64 -cdrom target/aero.iso -m 8G -serial stdio --boot d -s -enable-kvm -cpu host -drive file=target/disk.img,if=none,id=NVME1,format=raw -device nvme,drive=NVME1,serial=nvme

.PHONY: doc
doc:
rm -rf target/doc
cd src && cargo doc --package aero_kernel --target .cargo/x86_64-aero_os.json --release --target-dir=../target/doc/
cp web/index.html target/doc/index.html
1 change: 1 addition & 0 deletions base-files/bin
2 changes: 2 additions & 0 deletions base-files/etc/X11/xinit/xinitrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/sh
jwm &
File renamed without changes.
1 change: 1 addition & 0 deletions base-files/lib
1 change: 1 addition & 0 deletions base-files/lib64
1 change: 1 addition & 0 deletions base-files/sbin
95 changes: 95 additions & 0 deletions build-support/cross-llvm-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/usr/bin/env python3

# This file was taken from Managarm and I have no clue what it does.

import argparse
import sys
import os

our_version = 17


def do_version():
return '{}.0.6'.format(our_version)


def do_components():
return 'all all-targets analysis asmparser asmprinter binaryformat bitreader bitwriter codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfomsf debuginfopdb demangle dlltooldriver engine executionengine fuzzmutate globalisel gtest gtest_main instcombine instrumentation interpreter ipo irreader libdriver lineeditor linker lto mc mcdisassembler mcjit mcparser mirparser native nativecodegen objcarcopts object objectyaml option orcjit passes profiledata runtimedyld scalaropts selectiondag support symbolize tablegen target testingsupport transformutils vectorize windowsmanifest x86 x86asmparser x86asmprinter x86codegen x86desc x86disassembler x86info x86utils'


def do_targets_built():
return 'X86'


def get_includedir():
return '/sysroot/usr/include'


def get_libdir():
return '/sysroot/usr/lib'


def do_has_rtti():
return 'YES'


def do_shared_mode():
return 'shared'


def do_libs():
return f'-lLLVM-{our_version}'


def do_system_libs():
return f'-lLLVM-{our_version}'


def do_cppflags():
return ''


def do_cxxflags():
return ''


def do_ldflags():
return '-L' + get_libdir()


parser = argparse.ArgumentParser()
parser.add_argument('--version', action='append_const',
dest='command', const=do_version)
parser.add_argument('--targets-built', action='append_const',
dest='command', const=do_targets_built)
parser.add_argument('--components', action='append_const',
dest='command', const=do_components)
parser.add_argument('--includedir', action='append_const',
dest='command', const=get_includedir)
parser.add_argument('--libdir', action='append_const',
dest='command', const=get_libdir)
parser.add_argument('--has-rtti', action='append_const',
dest='command', const=do_has_rtti)
parser.add_argument('--shared-mode', action='append_const',
dest='command', const=do_shared_mode)
parser.add_argument('--link-shared', action='store_const',
dest='link', const='shared')
parser.add_argument('--cppflags', action='append_const',
dest='command', const=do_cppflags)
parser.add_argument('--cxxflags', action='append_const',
dest='command', const=do_cxxflags)
parser.add_argument('--ldflags', action='append_const',
dest='command', const=do_ldflags)
parser.add_argument('--libs', action='append_const',
dest='command', const=do_libs)
parser.add_argument('--system-libs', action='append_const',
dest='command', const=do_system_libs)
parser.add_argument('components', type=str, nargs='*')

print("cross-llvm-config:", sys.argv, file=sys.stderr)

args = parser.parse_args()
for command in args.command:
result = command()
print("cross-llvm-config yields:", result, file=sys.stderr)
print(result)
Loading

0 comments on commit 4b5f108

Please sign in to comment.