mirror of
https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials.git
synced 2024-11-11 07:10:59 +00:00
Fix script generation in Makefile
This would fail if the target folder didnt exist already.
This commit is contained in:
parent
1b164e50a1
commit
447b0aaa4e
@ -1,6 +1,6 @@
|
|||||||
## SPDX-License-Identifier: MIT OR Apache-2.0
|
## SPDX-License-Identifier: MIT OR Apache-2.0
|
||||||
##
|
##
|
||||||
## Copyright (c) 2018-2019 Andre Richter <andre.o.richter@gmail.com>
|
## Copyright (c) 2018-2020 Andre Richter <andre.o.richter@gmail.com>
|
||||||
|
|
||||||
# Default to the RPi3
|
# Default to the RPi3
|
||||||
ifndef BSP
|
ifndef BSP
|
||||||
@ -98,7 +98,7 @@ qemu: all
|
|||||||
$(DOCKER_EXEC_QEMU) $(QEMU_RELEASE_ARGS) \
|
$(DOCKER_EXEC_QEMU) $(QEMU_RELEASE_ARGS) \
|
||||||
-kernel $(OUTPUT)
|
-kernel $(OUTPUT)
|
||||||
|
|
||||||
define kernel_test_runner
|
define KERNEL_TEST_RUNNER
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
$(OBJCOPY_CMD) $$1 $$1.img
|
$(OBJCOPY_CMD) $$1 $$1.img
|
||||||
@ -107,9 +107,10 @@ define kernel_test_runner
|
|||||||
ruby tests/runner.rb $(DOCKER_EXEC_QEMU) $(QEMU_TEST_ARGS) -kernel $$TEST_BINARY
|
ruby tests/runner.rb $(DOCKER_EXEC_QEMU) $(QEMU_TEST_ARGS) -kernel $$TEST_BINARY
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
export KERNEL_TEST_RUNNER
|
||||||
test: $(SOURCES)
|
test: $(SOURCES)
|
||||||
@mkdir -p target
|
@mkdir -p target
|
||||||
$(file > target/kernel_test_runner.sh,$(kernel_test_runner))
|
@echo "$$KERNEL_TEST_RUNNER" > target/kernel_test_runner.sh
|
||||||
@chmod +x target/kernel_test_runner.sh
|
@chmod +x target/kernel_test_runner.sh
|
||||||
RUSTFLAGS="$(RUSTFLAGS_PEDANTIC)" $(XTEST_CMD) $(TEST_ARG)
|
RUSTFLAGS="$(RUSTFLAGS_PEDANTIC)" $(XTEST_CMD) $(TEST_ARG)
|
||||||
endif
|
endif
|
||||||
|
@ -341,7 +341,7 @@ The file `kernel_test_runner.sh` does not exist by default. We generate it on de
|
|||||||
`make test` target:
|
`make test` target:
|
||||||
|
|
||||||
```Makefile
|
```Makefile
|
||||||
define kernel_test_runner
|
define KERNEL_TEST_RUNNER
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
$(OBJCOPY_CMD) $$1 $$1.img
|
$(OBJCOPY_CMD) $$1 $$1.img
|
||||||
@ -350,9 +350,10 @@ define kernel_test_runner
|
|||||||
ruby tests/runner.rb $(DOCKER_EXEC_QEMU) $(QEMU_TEST_ARGS) -kernel $$TEST_BINARY
|
ruby tests/runner.rb $(DOCKER_EXEC_QEMU) $(QEMU_TEST_ARGS) -kernel $$TEST_BINARY
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
export KERNEL_TEST_RUNNER
|
||||||
test: $(SOURCES)
|
test: $(SOURCES)
|
||||||
@mkdir -p target
|
@mkdir -p target
|
||||||
$(file > target/kernel_test_runner.sh,$(kernel_test_runner))
|
@echo "$$KERNEL_TEST_RUNNER" > target/kernel_test_runner.sh
|
||||||
@chmod +x target/kernel_test_runner.sh
|
@chmod +x target/kernel_test_runner.sh
|
||||||
RUSTFLAGS="$(RUSTFLAGS_PEDANTIC)" $(XTEST_CMD) $(TEST_ARG)
|
RUSTFLAGS="$(RUSTFLAGS_PEDANTIC)" $(XTEST_CMD) $(TEST_ARG)
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user