Add Rust
This commit is contained in:
parent
e674a2da7e
commit
2664eca633
7 changed files with 37 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,5 +2,6 @@
|
||||||
/config/2-conditionals.mk
|
/config/2-conditionals.mk
|
||||||
/polytreewm
|
/polytreewm
|
||||||
/src/*.o
|
/src/*.o
|
||||||
|
/target/
|
||||||
/tests/*.o
|
/tests/*.o
|
||||||
/tests/*.test
|
/tests/*.test
|
||||||
|
|
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "polytreewm"
|
||||||
|
version = "0.0.0"
|
17
Cargo.toml
Normal file
17
Cargo.toml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
[package]
|
||||||
|
name = "polytreewm"
|
||||||
|
version = "0.0.0"
|
||||||
|
authors = ["Alex Kotov <kotovalexarian@gmail.com>"]
|
||||||
|
edition = "2021"
|
||||||
|
description = "PolytreeWM is an extremely fast, small, and dynamic tiling window manager for X"
|
||||||
|
readme = true
|
||||||
|
homepage = "https://github.com/PolytreeDE/polytreewm"
|
||||||
|
repository = "https://github.com/PolytreeDE/polytreewm.git"
|
||||||
|
license = "MIT"
|
||||||
|
keywords = []
|
||||||
|
categories = []
|
||||||
|
publish = false
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "polytreewm"
|
||||||
|
crate-type = ["staticlib"]
|
8
Makefile
8
Makefile
|
@ -58,10 +58,10 @@ ALL_EXE = polytreewm $(TEST_EXE)
|
||||||
# Executables #
|
# Executables #
|
||||||
###############
|
###############
|
||||||
|
|
||||||
polytreewm: src/main.o $(MODULES_OBJ)
|
polytreewm: src/main.o $(MODULES_OBJ) target/debug/libpolytreewm.a
|
||||||
$(CC) -o $@ $^ $(LDFLAGS)
|
$(CC) -o $@ $^ $(LDFLAGS)
|
||||||
|
|
||||||
%.test: %.o tests/main.o $(MODULES_OBJ)
|
%.test: %.o tests/main.o $(MODULES_OBJ) target/debug/libpolytreewm.a
|
||||||
$(CC) -o $@ $^ $(LDFLAGS)
|
$(CC) -o $@ $^ $(LDFLAGS)
|
||||||
|
|
||||||
################
|
################
|
||||||
|
@ -73,6 +73,9 @@ polytreewm: src/main.o $(MODULES_OBJ)
|
||||||
|
|
||||||
dwm.o: $(DWM_SRC) $(DWM_HDR)
|
dwm.o: $(DWM_SRC) $(DWM_HDR)
|
||||||
|
|
||||||
|
target/debug/libpolytreewm.a:
|
||||||
|
$(CARGO) build
|
||||||
|
|
||||||
#########
|
#########
|
||||||
# Tasks #
|
# Tasks #
|
||||||
#########
|
#########
|
||||||
|
@ -82,6 +85,7 @@ test: $(TEST_EXE)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(ALL_OBJ) $(ALL_EXE)
|
rm -f $(ALL_OBJ) $(ALL_EXE)
|
||||||
|
$(CARGO) clean
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
rm -f $(CONFIGMKS_TO_REMOVE)
|
rm -f $(CONFIGMKS_TO_REMOVE)
|
||||||
|
|
|
@ -6,7 +6,7 @@ PolytreeWM is an extremely fast, small, and dynamic tiling window manager for X.
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
In order to build PolytreeWM you need the Xlib header files.
|
In order to build PolytreeWM you need Cargo for Rust and the Xlib header files.
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
CARGO = cargo
|
||||||
CC = cc
|
CC = cc
|
||||||
PKGCONFIG = pkg-config
|
PKGCONFIG = pkg-config
|
||||||
|
|
||||||
|
|
4
src/lib.rs
Normal file
4
src/lib.rs
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn foo() -> u32 {
|
||||||
|
123
|
||||||
|
}
|
Loading…
Reference in a new issue