Modularise makefiles
This commit is contained in:
parent
b7a19200a8
commit
e3f3f27fbc
23 changed files with 525 additions and 526 deletions
9
mk/userspace/binutils.mk
Normal file
9
mk/userspace/binutils.mk
Normal file
|
@ -0,0 +1,9 @@
|
|||
binutils: \
|
||||
filesystem/bin/hex \
|
||||
filesystem/bin/hexdump \
|
||||
filesystem/bin/strings
|
||||
|
||||
filesystem/bin/%: programs/binutils/Cargo.toml programs/binutils/src/bin/%.rs $(BUILD)/libstd.rlib
|
||||
mkdir -p filesystem/bin
|
||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
43
mk/userspace/coreutils.mk
Normal file
43
mk/userspace/coreutils.mk
Normal file
|
@ -0,0 +1,43 @@
|
|||
coreutils: \
|
||||
filesystem/bin/basename \
|
||||
filesystem/bin/cat \
|
||||
filesystem/bin/chmod \
|
||||
filesystem/bin/clear \
|
||||
filesystem/bin/cp \
|
||||
filesystem/bin/cut \
|
||||
filesystem/bin/date \
|
||||
filesystem/bin/dd \
|
||||
filesystem/bin/df \
|
||||
filesystem/bin/du \
|
||||
filesystem/bin/echo \
|
||||
filesystem/bin/env \
|
||||
filesystem/bin/false \
|
||||
filesystem/bin/free \
|
||||
filesystem/bin/head \
|
||||
filesystem/bin/kill \
|
||||
filesystem/bin/ls \
|
||||
filesystem/bin/mkdir \
|
||||
filesystem/bin/mv \
|
||||
filesystem/bin/printenv \
|
||||
filesystem/bin/ps \
|
||||
filesystem/bin/pwd \
|
||||
filesystem/bin/realpath \
|
||||
filesystem/bin/reset \
|
||||
filesystem/bin/rmdir \
|
||||
filesystem/bin/rm \
|
||||
filesystem/bin/seq \
|
||||
filesystem/bin/sleep \
|
||||
filesystem/bin/sort \
|
||||
filesystem/bin/tail \
|
||||
filesystem/bin/tee \
|
||||
filesystem/bin/time \
|
||||
filesystem/bin/touch \
|
||||
filesystem/bin/true \
|
||||
filesystem/bin/wc \
|
||||
filesystem/bin/yes
|
||||
#filesystem/bin/shutdown filesystem/bin/test
|
||||
|
||||
filesystem/bin/%: programs/coreutils/Cargo.toml programs/coreutils/src/bin/%.rs $(BUILD)/libstd.rlib
|
||||
mkdir -p filesystem/bin
|
||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
14
mk/userspace/drivers.mk
Normal file
14
mk/userspace/drivers.mk
Normal file
|
@ -0,0 +1,14 @@
|
|||
drivers: \
|
||||
filesystem/sbin/pcid \
|
||||
filesystem/sbin/e1000d \
|
||||
filesystem/sbin/rtl8168d
|
||||
|
||||
initfs/bin/%: drivers/%/Cargo.toml drivers/%/src/** $(BUILD)/libstd.rlib
|
||||
mkdir -p initfs/bin
|
||||
$(CARGO) rustc --manifest-path $< $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
||||
|
||||
filesystem/sbin/%: drivers/%/Cargo.toml drivers/%/src/** $(BUILD)/libstd.rlib
|
||||
mkdir -p filesystem/sbin
|
||||
$(CARGO) rustc --manifest-path $< $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
16
mk/userspace/extrautils.mk
Normal file
16
mk/userspace/extrautils.mk
Normal file
|
@ -0,0 +1,16 @@
|
|||
extrautils: \
|
||||
filesystem/bin/calc \
|
||||
filesystem/bin/cksum \
|
||||
filesystem/bin/cur \
|
||||
filesystem/bin/grep \
|
||||
filesystem/bin/less \
|
||||
filesystem/bin/man \
|
||||
filesystem/bin/mdless \
|
||||
filesystem/bin/mtxt \
|
||||
filesystem/bin/rem \
|
||||
#filesystem/bin/dmesg filesystem/bin/info filesystem/bin/watch
|
||||
|
||||
filesystem/bin/%: programs/extrautils/Cargo.toml programs/extrautils/src/bin/%.rs $(BUILD)/libstd.rlib
|
||||
mkdir -p filesystem/bin
|
||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
11
mk/userspace/games.mk
Normal file
11
mk/userspace/games.mk
Normal file
|
@ -0,0 +1,11 @@
|
|||
games: \
|
||||
filesystem/bin/ice \
|
||||
filesystem/bin/minesweeper \
|
||||
filesystem/bin/reblox \
|
||||
filesystem/bin/rusthello \
|
||||
filesystem/bin/snake
|
||||
|
||||
filesystem/bin/%: programs/games/Cargo.toml programs/games/src/%/**.rs $(BUILD)/libstd.rlib
|
||||
mkdir -p filesystem/bin
|
||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
11
mk/userspace/ion.mk
Normal file
11
mk/userspace/ion.mk
Normal file
|
@ -0,0 +1,11 @@
|
|||
ion: \
|
||||
filesystem/bin/ion \
|
||||
filesystem/bin/sh
|
||||
|
||||
filesystem/test/ion: programs/ion/Cargo.toml programs/ion/src/** $(BUILD)/libstd.rlib $(BUILD)/libtest.rlib
|
||||
mkdir -p filesystem/test
|
||||
$(CARGO) test --no-run --manifest-path $< $(CARGOFLAGS)
|
||||
cp programs/ion/target/$(TARGET)/release/deps/ion-* $@
|
||||
|
||||
filesystem/bin/sh: filesystem/bin/ion
|
||||
cp $< $@
|
42
mk/userspace/mod.mk
Normal file
42
mk/userspace/mod.mk
Normal file
|
@ -0,0 +1,42 @@
|
|||
userspace: \
|
||||
drivers \
|
||||
coreutils \
|
||||
extrautils \
|
||||
games \
|
||||
ion \
|
||||
netutils \
|
||||
orbutils \
|
||||
pkgutils \
|
||||
userutils \
|
||||
schemes \
|
||||
filesystem/bin/acid \
|
||||
filesystem/bin/contain \
|
||||
filesystem/bin/smith \
|
||||
filesystem/bin/tar
|
||||
|
||||
include mk/userspace/binutils.mk
|
||||
include mk/userspace/coreutils.mk
|
||||
include mk/userspace/drivers.mk
|
||||
include mk/userspace/extrautils.mk
|
||||
include mk/userspace/games.mk
|
||||
include mk/userspace/ion.mk
|
||||
include mk/userspace/netutils.mk
|
||||
include mk/userspace/orbutils.mk
|
||||
include mk/userspace/pkgutils.mk
|
||||
include mk/userspace/schemes.mk
|
||||
include mk/userspace/userutils.mk
|
||||
|
||||
$(BUILD)/libstd.rlib: rust/src/libstd/Cargo.toml rust/src/libstd/**
|
||||
mkdir -p $(BUILD)
|
||||
$(CARGO) rustc --verbose --manifest-path $< --features "panic-unwind" $(CARGOFLAGS) -L native=libc-artifacts/usr/lib -o $@
|
||||
cp rust/src/target/$(TARGET)/release/deps/*.rlib $(BUILD)
|
||||
|
||||
$(BUILD)/libtest.rlib: rust/src/libtest/Cargo.toml rust/src/libtest/** $(BUILD)/libstd.rlib
|
||||
mkdir -p $(BUILD)
|
||||
$(CARGO) rustc --verbose --manifest-path $< $(CARGOFLAGS) -L native=libc-artifacts/usr/lib -o $@
|
||||
cp rust/src/target/$(TARGET)/release/deps/*.rlib $(BUILD)
|
||||
|
||||
filesystem/bin/%: programs/%/Cargo.toml programs/%/src/** $(BUILD)/libstd.rlib
|
||||
mkdir -p filesystem/bin
|
||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
14
mk/userspace/netutils.mk
Normal file
14
mk/userspace/netutils.mk
Normal file
|
@ -0,0 +1,14 @@
|
|||
netutils: \
|
||||
filesystem/bin/dhcpd \
|
||||
filesystem/bin/dns \
|
||||
filesystem/bin/httpd \
|
||||
filesystem/bin/irc \
|
||||
filesystem/bin/nc \
|
||||
filesystem/bin/ntp \
|
||||
filesystem/bin/telnetd \
|
||||
filesystem/bin/wget
|
||||
|
||||
filesystem/bin/%: programs/netutils/Cargo.toml programs/netutils/src/%/**.rs $(BUILD)/libstd.rlib
|
||||
mkdir -p filesystem/bin
|
||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
15
mk/userspace/orbutils.mk
Normal file
15
mk/userspace/orbutils.mk
Normal file
|
@ -0,0 +1,15 @@
|
|||
orbutils: \
|
||||
filesystem/ui/bin/browser \
|
||||
filesystem/ui/bin/calculator \
|
||||
filesystem/ui/bin/character_map \
|
||||
filesystem/ui/bin/editor \
|
||||
filesystem/ui/bin/file_manager \
|
||||
filesystem/ui/bin/launcher \
|
||||
filesystem/ui/bin/orblogin \
|
||||
filesystem/ui/bin/terminal \
|
||||
filesystem/ui/bin/viewer
|
||||
|
||||
filesystem/ui/bin/%: programs/orbutils/Cargo.toml programs/orbutils/src/%/**.rs $(BUILD)/libstd.rlib
|
||||
mkdir -p filesystem/ui/bin
|
||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
7
mk/userspace/pkgutils.mk
Normal file
7
mk/userspace/pkgutils.mk
Normal file
|
@ -0,0 +1,7 @@
|
|||
pkgutils: \
|
||||
filesystem/bin/pkg
|
||||
|
||||
filesystem/bin/%: programs/pkgutils/Cargo.toml programs/pkgutils/src/%/**.rs $(BUILD)/libstd.rlib
|
||||
mkdir -p filesystem/bin
|
||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
25
mk/userspace/schemes.mk
Normal file
25
mk/userspace/schemes.mk
Normal file
|
@ -0,0 +1,25 @@
|
|||
schemes: \
|
||||
filesystem/sbin/ethernetd \
|
||||
filesystem/sbin/ipd \
|
||||
filesystem/sbin/orbital \
|
||||
filesystem/sbin/ptyd \
|
||||
filesystem/sbin/randd \
|
||||
filesystem/sbin/redoxfs \
|
||||
filesystem/sbin/redoxfs-mkfs \
|
||||
filesystem/sbin/tcpd \
|
||||
filesystem/sbin/udpd
|
||||
|
||||
initfs/bin/%: schemes/%/Cargo.toml schemes/%/src/** $(BUILD)/libstd.rlib
|
||||
mkdir -p initfs/bin
|
||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
||||
|
||||
filesystem/sbin/%: schemes/%/Cargo.toml schemes/%/src/** $(BUILD)/libstd.rlib
|
||||
mkdir -p filesystem/sbin
|
||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
||||
|
||||
filesystem/sbin/redoxfs-mkfs: schemes/redoxfs/Cargo.toml schemes/redoxfs/src/** $(BUILD)/libstd.rlib
|
||||
mkdir -p filesystem/bin
|
||||
$(CARGO) rustc --manifest-path $< --bin redoxfs-mkfs $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
12
mk/userspace/userutils.mk
Normal file
12
mk/userspace/userutils.mk
Normal file
|
@ -0,0 +1,12 @@
|
|||
userutils: \
|
||||
filesystem/bin/getty \
|
||||
filesystem/bin/id \
|
||||
filesystem/bin/login \
|
||||
filesystem/bin/passwd \
|
||||
filesystem/bin/su \
|
||||
filesystem/bin/sudo
|
||||
|
||||
filesystem/bin/%: programs/userutils/Cargo.toml programs/userutils/src/bin/%.rs $(BUILD)/libstd.rlib
|
||||
mkdir -p filesystem/bin
|
||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||
$(STRIP) $@
|
Loading…
Add table
Add a link
Reference in a new issue