Compare commits
No commits in common. "makefile" and "trunk" have entirely different histories.
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,2 @@
|
||||
bindings.rlib
|
||||
target
|
||||
Cargo.lock
|
||||
|
11
Cargo.toml
Normal file
11
Cargo.toml
Normal 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"
|
18
Makefile
18
Makefile
@ -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
17
build.rs
Normal 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!");
|
||||
}
|
@ -3,3 +3,4 @@
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
|
Loading…
Reference in New Issue
Block a user