Compare commits

..

No commits in common. "makefile" and "trunk" have entirely different histories.

6 changed files with 31 additions and 19 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
bindings.rlib
target
Cargo.lock

11
Cargo.toml Normal file
View File

@ -0,0 +1,11 @@
[package]
name = "limine-sys"
description = "Rust sys bindings for the Limine boot protocol"
version = "0.2.0"
authors = ["mintsuki <mintsuki@protonmail.com>"]
license = "BSD-2-Clause"
repository = "https://github.com/limine-bootloader/limine-rs-sys"
build = "build.rs"
[build-dependencies]
bindgen = "0.69.4"

View File

@ -1,18 +0,0 @@
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
# SPDX-License-Identifier: FSFAP
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
.POSIX:
RUSTC ?= rustc
bindings.rlib: src/limine.h src/limine.rs
bindgen --use-core src/limine.h | cat src/limine.rs - \
| $(RUSTC) --crate-type=lib - -o $@
.PHONY: clean
clean:
rm -f bindings.rlib

17
build.rs Normal file
View File

@ -0,0 +1,17 @@
extern crate bindgen;
use std::env;
use std::path::PathBuf;
fn main() {
let bindings = bindgen::Builder::default()
.header("limine.h")
.use_core()
.generate()
.expect("Unable to generate bindings");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
}

View File

@ -3,3 +3,4 @@
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));