summaryrefslogtreecommitdiff
path: root/pkg/tinyalsa/gen.lua
blob: d20c45a5c51fb3f30e18bbfb0a643b8c1f602098 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
cflags{
	'-std=c99', '-Wall', '-Wpedantic', '-Wno-overflow',
	'-D _POSIX_C_SOURCE=201112L',
	'-I $srcdir/include',
	'-isystem $builddir/pkg/linux-headers/include',
}

pkg.deps = {'pkg/linux-headers/headers'}

pkg.hdrs = copy('$outdir/include/tinyalsa', '$srcdir/include/tinyalsa', {
	'attributes.h',
	'pcm.h',
	'mixer.h',
	'asoundlib.h',
	'version.h',
})

lib('libtinyalsa.a', [[
	src/(
		limits.c
		pcm.c
		pcm_hw.c
		mixer.c
		mixer_hw.c
	)
]])

for _, tool in ipairs{'tinycap', 'tinymix', 'tinypcminfo', 'tinyplay'} do
	file('bin/'..tool, '755', exe(tool, {'utils/'..tool..'.c', 'libtinyalsa.a'}))
	man{'utils/'..tool..'.1'}
end

fetch 'git'