rework build system
This commit is contained in:
parent
ac074972f7
commit
0456655b41
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1 @@
|
|||||||
target
|
bindings.rlib
|
||||||
Cargo.lock
|
|
||||||
|
11
Cargo.toml
11
Cargo.toml
@ -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"
|
|
15
Makefile
Normal file
15
Makefile
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# 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:
|
||||||
|
|
||||||
|
bindings.rlib: limine.h limine.rs
|
||||||
|
bindgen --use-core limine.h | cat limine.rs - | rustc --crate-type=lib - -o $@
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
rm -f bindings.rlib
|
17
build.rs
17
build.rs
@ -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!");
|
|
||||||
}
|
|
@ -3,4 +3,3 @@
|
|||||||
#![allow(non_camel_case_types)]
|
#![allow(non_camel_case_types)]
|
||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
|
|
Loading…
Reference in New Issue
Block a user