e52b43a88e0820b7ebf6704e47b045f332afe9c8
[gps-watch.git] / SConscript.libcommon
1 Import('env')
2 env = env.Clone()
3
4 source_files_rs = [
5     'src/common/lib.rs', # Must be listed first (see below).
6     'src/common/register.rs',
7     'src/common/nvic.rs',
8     'src/common/clock.rs',
9     'src/common/systick.rs',
10     'src/common/port.rs',
11     'src/common/gpio.rs',
12     'src/common/i2c.rs',
13     'src/common/uart.rs',
14     'src/common/watchdog.rs',
15     'src/common/crc32.rs',
16     'src/common/ringbuf.rs',
17     'src/common/buffer.rs',
18     'src/common/usb_serial.rs',
19     'src/common/display.rs',
20     'src/common/screen.rs',
21 ]
22
23 source_files_c = [
24     'src/common/startup.c',
25     'src/common/asm_helpers.c',
26     'src/common/systick.c',
27     'src/common/ringbuf.c',
28     'src/common/flash.c',
29     'src/common/usb_device_ch9.c',
30     'src/common/usb_device_dci.c',
31     'src/common/usb_device_descriptor.c',
32     'src/common/usb_device_khci.c',
33     'src/common/usb_osa_bm.c',
34     'src/common/virtual_com.c',
35 ]
36
37 libcommon_rlib = env.Rustc('libcommon.rlib', source_files_rs[0])
38
39 for f in source_files_rs:
40     Depends(libcommon_rlib, f)
41
42 libcommon_a = env.Library('libcommon.a', source_files_c)
43
44 for f in source_files_c:
45     Depends(libcommon_a, f)