Import('env') env = env.Clone() source_files_rs = [ 'src/common/lib.rs', # Must be listed first (see below). 'src/common/register.rs', 'src/common/nvic.rs', 'src/common/clock.rs', 'src/common/systick.rs', 'src/common/port.rs', 'src/common/gpio.rs', 'src/common/i2c.rs', 'src/common/uart.rs', 'src/common/watchdog.rs', 'src/common/crc32.rs', 'src/common/ringbuf.rs', 'src/common/buffer.rs', 'src/common/usb_serial.rs', 'src/common/display.rs', 'src/common/screen.rs', 'src/common/gps.rs', ] source_files_c = [ 'src/common/startup.c', 'src/common/asm_helpers.c', 'src/common/systick.c', 'src/common/ringbuf.c', 'src/common/flash.c', 'src/common/uart0.c', 'src/common/usb_device_ch9.c', 'src/common/usb_device_dci.c', 'src/common/usb_device_descriptor.c', 'src/common/usb_device_khci.c', 'src/common/usb_osa_bm.c', 'src/common/virtual_com.c', ] libcommon_rlib = env.Rustc('libcommon.rlib', source_files_rs[0]) for f in source_files_rs: Depends(libcommon_rlib, f) libcommon_a = env.Library('libcommon.a', source_files_c) for f in source_files_c: Depends(libcommon_a, f)