1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-27 19:18:59 +02:00

Get AP examples working on Mac OS too.

This commit is contained in:
Andrew Walbran
2023-03-23 14:43:48 +00:00
parent fc36e40eef
commit fa56c70dcb
5 changed files with 30 additions and 5 deletions

View File

@ -12,6 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
UNAME := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
TARGET = aarch64-linux-gnu
else
TARGET = aarch64-none-elf
endif
OBJCOPY = $(TARGET)-objcopy
.PHONY: build qemu_minimal qemu qemu_logger
all: rtc.bin
@ -20,7 +28,7 @@ build:
cargo build
rtc.bin: build
aarch64-linux-gnu-objcopy -O binary target/aarch64-unknown-none/debug/rtc $@
$(OBJCOPY) -O binary target/aarch64-unknown-none/debug/rtc $@
qemu: rtc.bin
qemu-system-aarch64 -machine virt -cpu max -serial mon:stdio -display none -kernel $< -s

View File

@ -16,7 +16,11 @@ use cc::Build;
use std::env;
fn main() {
#[cfg(target_os = "linux")]
env::set_var("CROSS_COMPILE", "aarch64-linux-gnu");
#[cfg(not(target_os = "linux"))]
env::set_var("CROSS_COMPILE", "aarch64-none-elf");
Build::new()
.file("entry.S")
.file("exceptions.S")