Compare commits

..

2 Commits

Author SHA1 Message Date
8e1926443a
moves source files to src/ 2024-07-15 00:44:27 -06:00
0456655b41
rework build system 2024-07-15 00:32:39 -06:00
6 changed files with 19 additions and 31 deletions

3
.gitignore vendored
View File

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

View File

@ -1,11 +0,0 @@
[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 Normal file
View File

@ -0,0 +1,18 @@
# 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

View File

@ -1,17 +0,0 @@
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,4 +3,3 @@
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));