[usbdev] Partial build files Temporary example scripts and BUILD files illustrating how to build stream_test application and the serial-port only libusb-free variant. Change-Id: Iecd5d81161cdb1b27413bfdf727e72aea9b84486 Signed-off-by: Adrian Lees <a.lees@lowrisc.org>
diff --git a/sw/host/tests/usbdev/usbdev_stream/BUILD b/sw/host/tests/usbdev/usbdev_stream/BUILD new file mode 100644 index 0000000..bec4500 --- /dev/null +++ b/sw/host/tests/usbdev/usbdev_stream/BUILD
@@ -0,0 +1,41 @@ +# Copyright lowRISC contributors (OpenTitan project). +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "usbdev_stream", + srcs = [ + "stream_test.cc", + "usb_device.cc", + "usbdev_int.cc", + "usbdev_iso.cc", + "usbdev_serial.cc", + "usbdev_stream.cc", + "usbdev_utils.cc", + ], + hdrs = [ + "stream_test.h", + "usb_device.h", + "usbdev_int.h", + "usbdev_iso.h", + "usbdev_serial.h", + "usbdev_stream.h", + "usbdev_utils.h", + ], + # Not a local define since targets that depend on this need to use + # the same configuration. + defines = [ + "STREAMTEST_LIBUSB=1", + ], + linkopts = ["-lusb-1.0"], +) + +cc_binary( + name = "stream_test", + srcs = ["stream_test.cc"], + deps = [ + ":usbdev_stream", + ], +)
diff --git a/sw/host/tests/usbdev/usbdev_stream/build.sh b/sw/host/tests/usbdev/usbdev_stream/build.sh new file mode 100755 index 0000000..a120bac --- /dev/null +++ b/sw/host/tests/usbdev/usbdev_stream/build.sh
@@ -0,0 +1,14 @@ +#!/bin/sh +# Copyright lowRISC contributors (OpenTitan project). +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + +g++ -Wall -Werror -std=c++14 -c -o stream_test.o -DSTREAMTEST_LIBUSB=1 stream_test.cc +g++ -Wall -Werror -std=c++14 -c -o usbdev_iso.o -DSTREAMTEST_LIBUSB=1 usbdev_iso.cc +g++ -Wall -Werror -std=c++14 -c -o usbdev_int.o -DSTREAMTEST_LIBUSB=1 usbdev_int.cc +g++ -Wall -Werror -std=c++14 -c -o usbdev_serial.o -DSTREAMTEST_LIBUSB=1 usbdev_serial.cc +g++ -Wall -Werror -std=c++14 -c -o usbdev_stream.o -DSTREAMTEST_LIBUSB=1 usbdev_stream.cc +g++ -Wall -Werror -std=c++14 -c -o usbdev_utils.o -DSTREAMTEST_LIBUSB=1 usbdev_utils.cc +g++ -Wall -Werror -std=c++14 -c -o usb_device.o -DSTREAMTEST_LIBUSB=1 usb_device.cc + +g++ -g -O2 -o stream_test stream_test.o usbdev_iso.o usbdev_int.o usbdev_serial.o usbdev_stream.o usbdev_utils.o usb_device.o -lusb-1.0
diff --git a/sw/host/tests/usbdev/usbdev_stream/build_standalone.sh b/sw/host/tests/usbdev/usbdev_stream/build_standalone.sh new file mode 100755 index 0000000..82557ff --- /dev/null +++ b/sw/host/tests/usbdev/usbdev_stream/build_standalone.sh
@@ -0,0 +1,6 @@ +#!/bin/sh +# Copyright lowRISC contributors (OpenTitan project). +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + +g++ -std=c++14 -Wall -Werror -g -O2 -o serial_test stream_test.cc usbdev_serial.cc usbdev_stream.cc usbdev_utils.cc usb_device.cc