Added component makefiles

This commit is contained in:
2024-12-15 21:06:44 -08:00
parent 067992221f
commit b156510422
5 changed files with 196 additions and 0 deletions

19
components/make/bootstrap Normal file
View File

@ -0,0 +1,19 @@
$(BUILD)/.inter/libbootstrap.a: $(shell find ./sources/bootstrap -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/.inter
cd sources/bootstrap && \
$(CARGO) \
-Zbuild-std=core,alloc,compiler_builtins \
-Zbuild-std-features=compiler-builtins-mem rustc \
--target "x86_64-unknown-redox" \
--release \
-- \
--emit link="../../$(BUILD)/.inter/libbootstrap.a"
$(BUILD)/boot/bootstrap: $(BUILD)/.inter/libbootstrap.a
@mkdir -p $(BUILD)/boot
x86_64-unknown-redox-ld \
-o "$(BUILD)/boot/bootstrap" \
--gc-sections \
-T "./sources/bootstrap/src/x86_64.ld" \
-z max-page-size=4096 \
"$(BUILD)/.inter/libbootstrap.a"

75
components/make/drivers Normal file
View File

@ -0,0 +1,75 @@
$(BUILD)/etc/pcid/initfs.toml: $(shell find ./sources/drivers -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/etc/pcid
cp sources/drivers/initfs.toml $@
$(BUILD)/bin/acpid: $(shell find ./sources/drivers -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/drivers && \
$(CARGO) build --release --target x86_64-unknown-redox -p acpid
cp sources/drivers/target/x86_64-unknown-redox/release/acpid $@
$(BUILD)/bin/fbcond: $(shell find ./sources/drivers -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/drivers && \
$(CARGO) build --release --target x86_64-unknown-redox -p fbcond
cp sources/drivers/target/x86_64-unknown-redox/release/fbcond $@
$(BUILD)/bin/inputd: $(shell find ./sources/drivers -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/drivers && \
$(CARGO) build --release --target x86_64-unknown-redox -p inputd
cp sources/drivers/target/x86_64-unknown-redox/release/inputd $@
$(BUILD)/bin/lived: $(shell find ./sources/drivers -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/drivers && \
$(CARGO) build --release --target x86_64-unknown-redox -p lived
cp sources/drivers/target/x86_64-unknown-redox/release/lived $@
$(BUILD)/bin/nvmed: $(shell find ./sources/drivers -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/drivers && \
$(CARGO) build --release --target x86_64-unknown-redox -p nvmed
cp sources/drivers/target/x86_64-unknown-redox/release/nvmed $@
$(BUILD)/bin/pcid: $(shell find ./sources/drivers -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/drivers && \
$(CARGO) build --release --target x86_64-unknown-redox -p pcid
cp sources/drivers/target/x86_64-unknown-redox/release/pcid $@
$(BUILD)/bin/vesad: $(shell find ./sources/drivers -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/drivers && \
$(CARGO) build --release --target x86_64-unknown-redox -p vesad
cp sources/drivers/target/x86_64-unknown-redox/release/vesad $@
$(BUILD)/bin/ahcid: $(shell find ./sources/drivers -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/drivers && \
$(CARGO) build --release --target x86_64-unknown-redox -p ahcid
cp sources/drivers/target/x86_64-unknown-redox/release/ahcid $@
$(BUILD)/bin/ided: $(shell find ./sources/drivers -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/drivers && \
$(CARGO) build --release --target x86_64-unknown-redox -p ided
cp sources/drivers/target/x86_64-unknown-redox/release/ided $@
$(BUILD)/bin/ps2d: $(shell find ./sources/drivers -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/drivers && \
$(CARGO) build --release --target x86_64-unknown-redox -p ps2d
cp sources/drivers/target/x86_64-unknown-redox/release/ps2d $@
$(BUILD)/bin/virtio-blkd: $(shell find ./sources/drivers -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/drivers && \
$(CARGO) build --release --target x86_64-unknown-redox -p virtio-blkd
cp sources/drivers/target/x86_64-unknown-redox/release/virtio-blkd $@
$(BUILD)/bin/virtio-gpud: $(shell find ./sources/drivers -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/drivers && \
$(CARGO) build --release --target x86_64-unknown-redox -p virtio-gpud
cp sources/drivers/target/x86_64-unknown-redox/release/virtio-gpud $@

35
components/make/simple Normal file
View File

@ -0,0 +1,35 @@
$(BUILD)/bin/init: $(shell find ./sources/init -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/init && \
$(CARGO) build --release --target x86_64-unknown-redox
cp sources/init/target/x86_64-unknown-redox/release/init $@
$(BUILD)/bin/logd: $(shell find ./sources/logd -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/logd && \
$(CARGO) build --release --target x86_64-unknown-redox
cp sources/logd/target/x86_64-unknown-redox/release/logd $@
$(BUILD)/bin/ramfs: $(shell find ./sources/ramfs -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/ramfs && \
$(CARGO) build --release --target x86_64-unknown-redox
cp sources/ramfs/target/x86_64-unknown-redox/release/ramfs $@
$(BUILD)/bin/randd: $(shell find ./sources/randd -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/randd && \
$(CARGO) build --release --target x86_64-unknown-redox
cp sources/randd/target/x86_64-unknown-redox/release/randd $@
$(BUILD)/bin/redoxfs: $(shell find ./sources/redoxfs -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/redoxfs && \
$(CARGO) build --release --target x86_64-unknown-redox
cp sources/redoxfs/target/x86_64-unknown-redox/release/redoxfs $@
$(BUILD)/bin/zerod: $(shell find ./sources/zerod -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/zerod && \
$(CARGO) build --release --target x86_64-unknown-redox --bin zerod
cp sources/zerod/target/x86_64-unknown-redox/release/zerod $@

29
components/make/zerod Normal file
View File

@ -0,0 +1,29 @@
$(BUILD)/bin/init: $(shell find ./sources/init -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/init && \
$(CARGO) build --release --target x86_64-unknown-redox
cp sources/init/target/x86_64-unknown-redox/release/init $@
$(BUILD)/bin/logd: $(shell find ./sources/logd -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/logd && \
$(CARGO) build --release --target x86_64-unknown-redox
cp sources/logd/target/x86_64-unknown-redox/release/logd $@
$(BUILD)/bin/ramfs: $(shell find ./sources/ramfs -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/ramfs && \
$(CARGO) build --release --target x86_64-unknown-redox
cp sources/ramfs/target/x86_64-unknown-redox/release/ramfs $@
$(BUILD)/bin/randd: $(shell find ./sources/randd -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/randd && \
$(CARGO) build --release --target x86_64-unknown-redox
cp sources/randd/target/x86_64-unknown-redox/release/randd $@
$(BUILD)/bin/redoxfs: $(shell find ./sources/redoxfs -type f -not -path "*/target/*")
@mkdir -p $(BUILD)/bin
cd sources/redoxfs && \
$(CARGO) build --release --target x86_64-unknown-redox
cp sources/redoxfs/target/x86_64-unknown-redox/release/redoxfs $@