1cc_library {
2    name: "libsonivox",
3    srcs: [
4        "lib_src/eas_chorus.c",
5        "lib_src/eas_chorusdata.c",
6        "lib_src/eas_data.c",
7        "lib_src/eas_dlssynth.c",
8        "lib_src/eas_flog.c",
9        "lib_src/eas_ima_tables.c",
10        "lib_src/eas_imaadpcm.c",
11        "lib_src/eas_imelody.c",
12        "lib_src/eas_imelodydata.c",
13        "lib_src/eas_math.c",
14        "lib_src/eas_mdls.c",
15        "lib_src/eas_midi.c",
16        "lib_src/eas_mididata.c",
17        "lib_src/eas_mixbuf.c",
18        "lib_src/eas_mixer.c",
19        "lib_src/eas_ota.c",
20        "lib_src/eas_otadata.c",
21        "lib_src/eas_pan.c",
22        "lib_src/eas_pcm.c",
23        "lib_src/eas_pcmdata.c",
24        "lib_src/eas_public.c",
25        "lib_src/eas_reverb.c",
26        "lib_src/eas_reverbdata.c",
27        "lib_src/eas_rtttl.c",
28        "lib_src/eas_rtttldata.c",
29        "lib_src/eas_smf.c",
30        "lib_src/eas_smfdata.c",
31        "lib_src/eas_voicemgt.c",
32        "lib_src/eas_wtengine.c",
33        "lib_src/eas_wtsynth.c",
34        "lib_src/eas_xmf.c",
35        "lib_src/eas_xmfdata.c",
36        "lib_src/wt_22khz.c",
37        "lib_src/jet.c",
38        "host_src/eas_config.c",
39        "host_src/eas_hostmm.c",
40        "host_src/eas_report.c",
41
42        // not using these modules
43        //"host_src/eas_main.c",
44        //"host_src/eas_wave.c",
45        //"lib_src/eas_wavefile.c",
46        //"lib_src/eas_wavefiledata.c",
47    ],
48
49    cflags: [
50        "-O2",
51        "-DUNIFIED_DEBUG_MESSAGES",
52        "-DEAS_WT_SYNTH",
53        "-D_IMELODY_PARSER",
54        "-D_RTTTL_PARSER",
55        "-D_OTA_PARSER",
56        "-D_XMF_PARSER",
57        "-DNUM_OUTPUT_CHANNELS=2",
58        "-D_SAMPLE_RATE_22050",
59        "-DMAX_SYNTH_VOICES=64",
60        "-D_16_BIT_SAMPLES",
61        "-D_FILTER_ENABLED",
62        "-DDLS_SYNTHESIZER",
63        "-D_REVERB_ENABLED",
64
65        "-Wno-unused-parameter",
66        "-Werror",
67
68        // not using these options
69        // "-D_WAVE_PARSER",
70        // "-D_IMA_DECODER", // (needed for IMA-ADPCM wave files)
71        // "-D_CHORUS_ENABLED",
72    ],
73
74    local_include_dirs: [
75        "host_src",
76        "lib_src",
77    ],
78    export_include_dirs: ["include"],
79
80    shared_libs: [
81        "liblog",
82    ],
83
84    arch: {
85        arm: {
86            instruction_set: "arm",
87
88            srcs: [
89                "lib_src/ARM-E_filter_gnu.s",
90                //"lib_src/ARM-E_interpolate_loop_gnu.s",
91                //"lib_src/ARM-E_interpolate_noloop_gnu.s",
92                "lib_src/ARM-E_mastergain_gnu.s",
93                //"lib_src/ARM-E_voice_gain_gnu.s",
94            ],
95
96            asflags: [
97                // In order to use #include instead of .include
98                "-xassembler-with-cpp",
99
100                "-Wa,--defsym,SAMPLE_RATE_22050=1",
101                "-Wa,--defsym,STEREO_OUTPUT=1",
102                "-Wa,--defsym,FILTER_ENABLED=1",
103                "-Wa,--defsym,SAMPLES_16_BIT=1",
104            ],
105
106            cflags: [
107                "-DNATIVE_EAS_KERNEL",
108            ],
109
110            // .s files not ported for Clang assembler yet.
111            clang_asflags: ["-no-integrated-as"],
112        },
113        arm64: {
114            // .s files not ported for Clang assembler yet.
115            clang_asflags: ["-no-integrated-as"],
116        },
117    },
118}
119